[Gc] Abort using GC as a leak detector.

Talbot, George Gtalbot at locuspharma.com
Wed Aug 19 08:51:28 PDT 2009


Hi all,

Trying to use the GC as a leak detector according to this: http://www.hpl.hp.com/personal/Hans_Boehm/gc/leak.html

I'm doing the "Simplified leak detection under Linux" instructions, and have updated to the latest CVS.

When I run my program, during static initialization, the program is allocating memory and the GC is aborting with "dirty bits not set up".  Any ideas?

0x00002ba07e83f55c in GC_abort (msg=0x2ba07e845a01 "dirty bits not set up") at misc.c:1133
1133        if (GETENV("GC_LOOP_ON_ABORT") != NULL) {
(gdb) bt
#0  0x00002ba07e83f55c in GC_abort (msg=0x2ba07e845a01 "dirty bits not set up") at misc.c:1133
#1  0x00002ba07e83d969 in GC_push_next_marked_dirty (h=0x0) at mark.c:1836
#2  0x00002ba07e83e588 in GC_mark_some (cold_gc_frame=0x7fff2c49b70c "�+") at mark.c:329
#3  0x00002ba07e836b22 in GC_stopped_mark (stop_func=0x2ba07e835f70 <GC_never_stop_func>) at alloc.c:565
#4  0x00002ba07e836db0 in GC_try_to_collect_inner (stop_func=0x2ba07e835f70 <GC_never_stop_func>) at alloc.c:391
#5  0x00002ba07e83be08 in GC_generic_malloc_inner (lb=127, k=1) at malloc.c:112
#6  0x00002ba07e83bec9 in GC_generic_malloc (lb=127, k=1) at malloc.c:159
#7  0x00002ba07e83c05a in GC_malloc (lb=140733936424894) at malloc.c:281
#8  0x00002ba07e838587 in GC_debug_malloc (lb=8, s=0x2ba07e845b2d "RT", i=0) at dbg_mlc.c:582
#9  0x00002ba080e88cbd in operator new () from /usr/lib/libstdc++.so.6
#10 0x00002ba08088fb0f in resource_file_handler () at io/qresource.cpp:1409
#11 0x00002ba08088fbcb in qt_force_resource_init () at io/qresource.cpp:1411
#12 0x00002ba08088fbf4 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at io/qresource.cpp:1413
#13 0x00002ba08088fc1b in global constructors keyed to _ZN16QResourcePrivate5clearEv () at io/qresource.cpp:1415
#14 0x00002ba0809096f6 in __do_global_ctors_aux () from /usr/lib/libQtCore.so.4
#15 0x00002ba080815523 in _init () from /usr/lib/libQtCore.so.4
#16 0x00002ba08155e000 in ?? ()
#17 0x00002ba07e618d76 in ?? () from /lib64/ld-linux-x86-64.so.2
#18 0x00002ba07e618e9e in ?? () from /lib64/ld-linux-x86-64.so.2
#19 0x00002ba07e60ba9a in ?? () from /lib64/ld-linux-x86-64.so.2
#20 0x0000000000000001 in ?? ()
#21 0x00007fff2c49d7a7 in ?? ()
#22 0x0000000000000000 in ?? ()

Running on x86_64, if that makes a difference.  My command line invoking my program looks like this:

LD_PRELOAD=/usr/local/lib/libgc.so GC_FIND_LEAK=1 GC_PRINT_STATS=1 GC_LOOP_ON_ABORT=1 unix/lcd

And here's the output when I run it from stdout/stderr:

Increasing heap size by 262144 after 0 allocated bytes
Initiating full world-stop collection!
Initiating full world-stop collection!

--> Marking for collection 1 after 0 allocated bytes
Collection 0 reclaimed 0 bytes ---> heapsize = 262144 bytes
World-stopped marking took 0 msecs (0 in average)
Heap contains 0 pointer-containing + 0 pointer-free reachable bytes
Finalize + initiate sweep took 0 + 0 msecs
Complete collection took 0 msecs
Adding block map for size of 11 granules (176 bytes)

--> Marking for collection 2 after 176 allocated bytes
dirty bits not set up
Killed

Increasing heap size by 262144 after 0 allocated bytes
Initiating full world-stop collection!
Initiating full world-stop collection!

--> Marking for collection 1 after 0 allocated bytes
Collection 0 reclaimed 0 bytes ---> heapsize = 262144 bytes
World-stopped marking took 0 msecs (0 in average)
Heap contains 0 pointer-containing + 0 pointer-free reachable bytes
Finalize + initiate sweep took 0 + 0 msecs
Complete collection took 0 msecs
Adding block map for size of 11 granules (176 bytes)

--> Marking for collection 2 after 176 allocated bytes
dirty bits not set up
Aborted (core dumped)

Any help would be appreciated.  I've not yet modified this program to be GC-aware.

Thanks.

--
George T. Talbot
<gtalbot at locuspharma.com>



More information about the Gc mailing list