When I use apt-get to install or upgrade my Ubuntu hardy system, I often get messages like this:
$ sudo apt-get install foo
Reading package lists... Done
Segmentation faulty tree... 50%
$ sudo apt-get install foo
Reading package lists... Done
Building dependency tree
Reading state information... Done
Segmentation fault
$ sudo apt-get install foo
Reading package lists... Done
Building dependency tree
Reading state information... Done
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct NULL not valid
Aborted
cc -Os -g -Wall -DLOCAL_ROOT=\"/usr/share/polipo/www/\" -DDISK_CACHE_ROOT=\"/var/cache/polipo/\" -DCHUNK_SIZE=16384 -c -o http_parse.o http_parse.c
http_parse.c:1564: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.2/README.Bugs>.
make: *** [http_parse.o] Error 1
It doesn't happen all the time, so if you retry enough you can usually get things done, but it does segfault an annoying large percentage of the time.
Any idea what's going on or how to fix it?