[Hackage] #269: Not having an up-to-date package list causes indexing out of bounds error

#269: Not having an up-to-date package list causes indexing out of bounds error ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: cabal-install tool | Version: 1.2.3.0 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.8.2 Platform: | ---------------------------------+------------------------------------------ Not having an up-to-date package list causes {{{ cabal: Data.ByteString.Lazy.index: index too large: 0 }}} (.. which is a bad error message.) -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/269 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#269: Not having an up-to-date package list causes indexing out of bounds error ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: cabal-install tool | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: ---------------------------------+------------------------------------------ Comment (by duncan): We think this is due to truncated downloads. We've got a sample 00-index.tar.gz that elicits this problem. So there are two things to do: * work out where it's failing when reading truncated files (eg is it the gunzip or the tar format parsing that fails) * detect truncated downloads and decide what to do wit them. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/269#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#269: Not having an up-to-date package list causes indexing out of bounds error ---------------------------------+------------------------------------------ Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: cabal-install tool | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: ---------------------------------+------------------------------------------ Comment (by duncan): I think what happens is that when we get a short download we still save it to disk. Then when we gunzip it it fails when gzip notices that the file is short. However we were still writing the file, so the bit that has been written out already remains. If the user does not notice the error then they'll continue and we end up trying to parse the truncated tar file. So there are three cases of bad error handling here: * The HTTP lib is not notifying us that the download was shorter than expected. Perhaps we're expected to do this manually. * When we decompress the .tar.gz, we should do it into a temp file and only overwrite the target if the decompress succeeds. * The tar code needs auditing to check that it handles corrupt tar files correctly. There's newer tar code in the hackage-server that we could test with and steal if necessary. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/269#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#269: Not having an up-to-date package list causes indexing out of bounds error
---------------------------------+------------------------------------------
Reporter: guest | Owner:
Type: defect | Status: closed
Priority: low | Milestone:
Component: cabal-install tool | Version: 1.2.3.0
Severity: normal | Resolution: fixed
Keywords: | Difficulty: normal
Ghcversion: 6.8.2 | Platform:
---------------------------------+------------------------------------------
Changes (by duncan):
* status: new => closed
* resolution: => fixed
Comment:
Fixed points 2 and 3 above. This should be enough to give much better
behaviour in the case of a truncated download.
{{{
Sat Aug 23 00:00:33 BST 2008 Duncan Coutts
participants (1)
-
Hackage