some information on apt woes
Summary:
Latest versions of apt don't compile with g++3.0 even on x86.
Upstream CVS apt has bugs which might or might not be related to my changes to compile with g++3.0. Upstream CVS apt doesn't even compile (for me) using older compilers on x86.
One current parisc apt failure mode of both 0.4.0 and 0.5.3 appears to be a kernel VM problem though that doesn't make sense since the variable to make 0.4.0 fail is to update to glibc 2.2.3 from 2.2.1 unless it's just the right change to the memory map to tweek some bug.
Many thanks to tausq (Randolph Chung) for providing a patch with many of the changes required to make apt compile with g++3.0
If someone with a clue about VM would take a look I'd appreaciate it because I'm really burnt out on apt right now.
VM Problem?
Reproduce by removing /var/cache/apt/*.bin then running apt-get update. apt-get updates which don't download new packages file seem to work.
The test generates a type 6 fault trying to fetch an instruction from an apt-specific shared library from which code has been happily executing up to this point. The failure has the hallmarks (IIR is 0x43ffff80) of fetching from an unmapped page. Gdb disassembly of this area immediately after the fault shows garbage.
The fault appears to happen shortly
after the pkgcache.bin file, in which apt builds a memory-mapped database, is munmap-ped. As we've seen, apt functions correctly even with this defect which is consistent with the apt database being updated properly in spite of the fault.
apt 0.5.3 + parisc problem:
Like 0.4.0, apt 0.5.3 (hacked to compile with g++3.0 and working ok on x86) faults in the above test case. However apt-get installs also fail, by segfaulting prior to doing their work. Through layers of C++ code it appears that a bad data value is being read from the (memory-mapped) database. That value is used to construct a pointer which is invalid leading to a type=15 fault.
I can't find the bad data value in the database file from which it must be coming, leading me to conclude I either haven't yet found the root cause (quite possible -- it has taken hours to grok and trace the layers of C++) or that the database is corrupt due to premature death of the apt-get update. I'm guessing the former.
Generic apt 0.5.3 problem:
'apt-cache dump' built with my changes crashes on both x86 and parisc (the 0.5.3 x86 official debian package works fine). This could indicate some subtle defect with the conversion to g++3.0 most of which deals with strings. Apt seems to use C++ strings extensively, but is always poking around inside their guts, so it would be easy to do something stupid there I think. It's also possible that the g++3.0 is unconvering an existing defect.
-P
Quoted 4 lines · On Sat, May 26, 2001 at 10:08:09PM -0600, [email protected] wrote:
One current parisc apt failure mode of both 0.4.0 and 0.5.3 appears to be a kernel VM problem though that doesn't make sense since the variable to make 0.4.0 fail is to update to glibc 2.2.3 from 2.2.1 unless it's just the right change to the memory map to tweek some bug.
The faults I've seen from 0.4.0 are very different from those which you report. 0.4.0 segfaults during exit as it attempts to execute code in the dynamic linker (possibly a destructor?), after the dynamic linker has been unmapped.
The 0.5.3 crashes I've seen look more like dereferencing random data.
Signature · 1 line
Revolutions do not require corporate support.
Quoted 8 lines · On Sat, May 26, 2001 at 10:08:09PM -0600, [email protected] wrote:
Quoted 4 lines
One current parisc apt failure mode of both 0.4.0 and 0.5.3 appears to be a kernel VM problem though that doesn't make sense since the variable to make 0.4.0 fail is to update to glibc 2.2.3 from 2.2.1 unless it's just the right change to the memory map to tweek some bug.
The faults I've seen from 0.4.0 are very different from those which you report.
That's why I said "One" above... That "one" seems easily repeatable across different boxes so seemed the best candidate for investigation and sharing.
Quoted 3 lines
0.4.0 segfaults during exit as it attempts to execute code
in the dynamic linker (possibly a destructor?), after the dynamic linker has been unmapped.
It's possible I didn't examine the 0.4.0 memory map carefully enough to distinguish the dynamic linker from other code. I'm certain of the analysis for 0.5.3 however.
Quoted 2 lines
The 0.5.3 crashes I've seen look more like dereferencing random data.
Sorry I must've been obtuse. Bad value used to construct an invalid pointer leading to a type=15 fault" was supposed to indicate the same thing. Again I picked and analyzed one repeatable case, so my pointer was constant from test to test not random. Using apt in multiple ways probably produces more random-looking failures.
Quoted 1 line
Revolutions do not require corporate support.
Signature · 6 lines
-Paul Bame
We are somehow fooled into believing that the profoundly undemocratic,
indeed fascist, structure inside corporations, some of the most powerful
institutions of our time, is no threat to our democracy.
Lip de Los NacosApt 0.4.0 repeatable problem details (may be other problems too):
(This does not look like a VM problem like 0.5.3 does in this case)
$ sudo rm /var/cache/apt/*.bin $ sudo apt-get update ... Fetched 1521kB in 5s (256kB/s) Segmentation faultsts... 87% $ dmesg | tail -20
do_page_fault() pid=11284 command='apt-get' type=6 address=0x322e3137 vm_start = 0x0001f000, vm_end = 0x0003c000
YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
PSW: 00000000000001100000000000001111
r0-3 0000000000000000 00000000003fd700 000000004008b74b 000000000001f850 r4-7 00000000400ca8e0 0000000000026140 000000007ff01010 000000007ff00e64 r8-11 000000007ff00f60 000000007ff01020 0000000000368dee 000000007ff00dc8 r12-15 000000007ff00e60 0000000000000030 000000007ff00df8 000000007ff00df0 r16-19 000000007ff00c50 000000007ff00de4 000000007ff00c38 000000002d737061 r20-23 000000000001e5c8 0000000000000000 00000000322e3137 0000000000000001 r24-27 0000000000000001 0000000000000003 0000000000026120 000000000001d900 r28-31 0000000000000001 0000000000000000 000000007ff01100 000000004008b74b sr0-3 00000000003fd700 00000000003fd700 0000000000000000 00000000003fd700 sr4-7 00000000003fd700 00000000003fd700 00000000003fd700 00000000003fd700
IASQ: 00000000003fd700 00000000003fd700 IAOQ: 00000000322e3137 00000000322e313b
IIR: 43ffff80 ISR: 00000000003fd700 IOR: 000000004001f148ORIG_R28: 0000000000127acc
Note that the IAOQ is the string "2.14" so this one looks like a wild function pointer dereference. The code at %rp says:
6072c: 0d 80 10 9a ldw 0(sr0,r12),r26 60730: 87 40 20 2a cmpib,=,n 0,r26,0x6074c 60734: 0f 58 10 94 ldw c(sr0,r26),r20 60738: 34 19 00 06 ldi 3,r25 6073c: 0e 90 10 96 ldw 8(sr0,r20),r22 60740: eb f0 11 d8 b,l 0x81034,r31 60744: 08 1f 02 42 copy r31,rp
which goes to here, which looks like it's probably $$dyncall()
81034: c7 d6 c0 12 bb,*>=,n r22,1e,0x81044 81038: d6 c0 1c 1e depwi 0,31,2,r22 8103c: 0e c8 10 93 ldw 4(sr0,r22),r19 81040: 0e c0 10 96 ldw 0(sr0,r22),r22 81044: ea c0 c0 00 bv r0(r22) 81048: 6b c2 3f d1 stw rp,-18(sp)