This is the mail archive of the mailing list for the Java project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

static constructors and GC initialization

I'm trying to figure out why sprof fails to dlopen

We're crashing in the GC because _Jv_AllocBytes (called from the
static constructors in seems to result in a collection
being attempted while the dlopen is in progress.

Is it supposed to be safe to call _Jv_AllocBytes before _Jv_InitGC?
(This can happen because the natClass initializers might be called
before _Jv_RegisterClasses.)

Should we try and get rid of all the static constructors that allocate
and move them to an initialization routine that is guaranteed to be
run after the GC initialization?


  [ bryce ]

#0  GC_mark_from_mark_stack () at ../../../boehm-gc/mark.c:584
#1  0x40471a72 in GC_mark_some (cold_gc_frame=0xbffff350 "")
    at ../../../boehm-gc/mark.c:278
#2  0x4046bf82 in GC_stopped_mark (stop_func=0x4046ba40
    at ../../../boehm-gc/alloc.c:445
#3  0x4046bda5 in GC_try_to_collect_inner (
    stop_func=0x4046ba40 <GC_never_stop_func>) at
#4  0x40473d90 in GC_init_inner () at ../../../boehm-gc/misc.c:561
#5  0x40470a9d in GC_generic_malloc_inner (lb=10, k=0)
    at ../../../boehm-gc/malloc.c:63
#6  0x40470baf in GC_generic_malloc (lb=10, k=0)
    at ../../../boehm-gc/malloc.c:133
#7  0x40470c74 in GC_malloc_atomic (lb=10) at
#8  0x4033309d in _Z14_Jv_AllocBytesi (size=10)
    at ../../../libjava/
#9  0x4024ce17 in _Z17_Jv_makeUtf8ConstPci (s=0x403409b8 "()V", len=3)

    at ../../../libjava/
#10 0x4026745a in __static_initialization_and_destruction_0
    __priority=65535) at ../../../libjava/java/lang/
#11 0x40267482 in global constructors keyed to
_ZN4java4lang5Class7forNameEPNS0_6StringEPNS0_11ClassLoaderE () at
#12 0x40339aa7 in __do_global_ctors_aux ()
    at ../../../../libstdc++-v3/libsupc++/
#13 0x402450be in _init () from /usr/local/gcc/lib/
#14 0x4000e167 in _dl_init (main_map=0x804e990, argc=2,
    env=0xbffff9b8) at dl-init.c:112
#15 0x401310a3 in dl_open_worker (a=0xbffff708) at dl-open.c:325

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]