[Gc] Segfault in GC_mark_from

ktreichel at web.de ktreichel at web.de
Fri Oct 10 04:56:21 PDT 2008


> -----Ursprüngliche Nachricht-----
> Von: "Ivan Maidanski" <ivmai at mail.ru>
> Gesendet: 10.10.08 12:15:37
> An: gc at napali.hpl.hp.com
> Betreff: Re: [Gc] Segfault in GC_mark_from


> ktreichel at web.de wrote:
> > 
> > Hi,
> > 
> > after building libgc with assertions enabled we get the following:
> > 
> > Assertion failure: allchblk.c:445
> > GC_ASSERT(!IS_MAPPED(nexthdr));
> > 
> > print nexthdr
> > $2 = {hb_next = 0x477000, hb_prev = 0x85000, hb_block = 0x43c000, hb_obj_kind = 4 '\004', hb_flags = 4 '\004', hb_last_reclaimed = 6725, hb_sz = 36864, hb_descr = 190487, hb_large_block = 1 '\001', hb_map = 0x33ef8, hb_n_marks = 0, hb_marks = {0 <repeats 16 times>, 1}}
> > 
> > i have to mention that libgc is built with --enable-unmap
> > 
> > i'll try if i can find more.
> > 
> > Klaus
> 
> Hi!
> 
> Are You using the latest CVS snapshot?
> Which compiler (and for which target OS) are You using?

The box where the segfault happens is a x86 GNU/Linux box.
The gc version used is cvs until 2008-08-21 (last ChangeLog entry)

> 
> At present I'm having SEGV in GC_is_mapped() which is called indirectly from GC_register_finalizer (thru GC_allocobj() and GC_finalize()). GC is compiled under FreeBSD with -DALL_INTERIOR_POINTERS -DNO_EXECUTE_PERMISSION -DLARGE_CONFIG -DUSE_MMAP -DUSE_MUNMAP -DGC_THREADS -DTHREAD_LOCAL_ALLOC [-DGC_ASSERTIONS].
> I can't reproduce it with neither fewer macros defined nor with -DDBG_HDRS_ALL.
> Other Unix OSes haven't been tried yet.
> 
> I'm trying to found out more...
> 

After some more investigation we have this:

Segfault in mark.c line 795.

(gdb) p limit
$3 = 0x39d150 <Address 0x39d150 out of bounds>

(gdb) p mark_stack[0]
$4 = {mse_start = 0x21000 "", mse_descr = 24}
(gdb) p mark_stack_top[0]
$5 = {mse_start = 0x39d154 <Address 0x39d154 out of bounds>, mse_descr = 1953500}
(gdb)

***Static roots:
Total size: 0
***Heap sections:
Total heap size: 3670016
Section 0 from 0x21000 to 0x31000 0/16 blacklisted
Section 1 from 0x41000 to 0x51000 0/16 blacklisted
Section 2 from 0x51000 to 0x61000 0/16 blacklisted
Section 3 from 0x61000 to 0x75000 0/20 blacklisted
Section 4 from 0x75000 to 0x8c000 0/23 blacklisted
Section 5 from 0x8c000 to 0xb3000 0/39 blacklisted
Section 6 from 0xb3000 to 0xfd000 1/74 blacklisted
Section 7 from 0xfd000 to 0x160000 1/99 blacklisted
Section 8 from 0x160000 to 0x1e4000 1/132 blacklisted
Section 9 from 0x1e4000 to 0x2aa000 3/198 blacklisted
Section 10 from 0x2aa000 to 0x3b1000 6/263 blacklisted                    !!!!! look here !!!!!
***Free blocks:
Free list 2:
0x74000 size 8192 not black listed
Free list 5:
0x92000 size 20480 not black listed
Free list 8:
0x179000 size 32768 not black listed
Free list 33:
0x192000 size 192512 partially black listed
Free list 36:
0x1c2000 size 290816 partially black listed
Free list 60:
0x244000 size 1495040 partially black listed
Total of 2039808 bytes on free list
***Blocks in use:
(kind(0=ptrfree,1=normal,2=unc.):size_in_bytes, #_marks_set)
(4:239640,1)(0:16,83)(4:39952,0)(4:24592,1)(4:202776,1)(4:153624,1)(4:159768,1)(4:221208,1)(4:172056,1)(1:136,0)(2:14344,1)
(2:32776,1)(2:14344,1)(2:32776,1)(1:64,5)(4:64,0)(1:56,21)(2:14344,1)(2:32776,1)(0:8,436)(2:14344,1)(2:32776,1)(4:32,1)
(4:16400,1)(1:448,1)(4:2064,1)(4:48,1)(1:48,1)(4:24,8)(4:16,9)(4:40,8)(2:4080,1)(4:72,1)(1:24,1)(1:16,1)(4:56,6)(2:14344,1)
(0:1360,3)(1:56,73)(2:32776,1)(1:32,2)(1:8,3)(2:136,26!=507)(1:216,1)(2:24,162!=503)
blocks = 45, bytes = 1630208
***Finalization statistics:
14 finalization table entries; 0 disappearing links
0 objects are eligible for immediate finalization
(gdb)

memory mapped according to /proc/<pid>/maps:

1000-39d000

This means that the Heap Section 10 is wrong.

This problem is not reproducible on other boxes.


Klaus

_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066




More information about the Gc mailing list