[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#81829: corrupt /var/cache/apt/*.bin files



I was running an update of my debian/sarge box today, and encountered 
the following error message at the [I]nstall step in dselect.

Reading Package Lists... Done
/usr/lib/dpkg/methods/apt/install: line 57: 15737 Segmentation fault      
$APTGET $OPTS "$APT_OPT0" "$APT_OPT1" dselect-upgrade

I searched for the error message on google groups, and found a few 
complaints about it, but most had no reply at all, and the few that did 
have replies were totally unhelpful. I did find Debian bug 196070 which 
was marked fixed in July of last year with no useful information posted 
in the bug report, other than the clarification that the crash was being 
caused by apt, not by dselect. So I cut dselect out of the loop, and 
tried apt-get from the command-line.

[root:~]apt-get upgrade
Reading Package Lists... Done
Segmentation faulty Tree... 50%

The "Segmentation Fault" error was being drawn over the top of the last
line of text. "apt-get clean" did nothing, and "apt-get check"  
segfaulted the same way as "apt-get upgrade". "apt-get update" seemed to
download the package lists just fine, but then "apt-get upgrade" would
still crash.

But the error message "Segmentation faulty" was cute, and more clear and 
concise than the error I was getting by way of dselect, so I searched 
google groups for "Segmentation faulty" and that got some more useful 
posts. One suggested deleting /var/cache/apt/*.bin

[root:~]ls -l /var/cache/apt/*.bin
-rw-r--r--    1 root     root      4973681 Apr  7 15:55 
/var/cache/apt/pkgcache.bin
-rw-r--r--    1 root     root      4882303 Apr  7 15:08 
/var/cache/apt/srcpkgcache.bin
[root:~]mkdir bak
[root:~]mkdir bak/var              
[root:~]mkdir bak/var/cache        
[root:~]mkdir bak/var/cache/apt    
[root:~]mkdir bak/var/cache/apt/bin
[root:~]mv /var/cache/apt/*.bin ~/bak/var/cache/apt/bin

And after that, everything was happy again. I was able to run "apt-cache 
update" and then "apt-cache upgrade" and everything worked.

Afterwards, knowing the problem, a search of the debian bug archives 
turned up Bug 81829 and many duplicates. I read all the duplicates, and 
they were all the same story. Somebody reports segfaults in apt-get. A 
developer is unable to reproduce the error, and suggests to the 
reporter, "hey, I'll bet your apt cache got corrupted somehow" and 
advises the reporter to run "rm /var/cache/apt/*.bin" ... Only one 
reporter bothered to save the corrupt bin files, and then he deleted 
them before anybody asked for them. But I still have mine, and can 
consistenly reproduce the segmentation fault on demand:

[root:~]cp -p ~/bak/var/cache/apt/*.bin /var/cache/apt/    
[root:~]ls -l /var/cache/apt/
total 9660
drwxr-xr-x    3 root     root         8192 Apr  7 16:12 archives
-rw-r--r--    1 root     root      4973681 Apr  7 15:55 pkgcache.bin
-rw-r--r--    1 root     root      4882303 Apr  7 15:08 srcpkgcache.bin
[root:~]apt-get upgrade
Reading Package Lists... Done
Segmentation faulty Tree... 65%

So. Anybody want my corrupt /var/cache/apt/.bin files? I am eager to do 
whatever I can to assist in resolving this lil' bug once and for all. 

---
James Paige



Reply to: