[kaffe] Problem with garbage collection and p-threads

Martin Edlund Martin.Edlund at ascomtateco.se
Tue Oct 29 01:41:25 PST 2002


Hi!

I work together with Josef on this project, and this is the output we get from gdb
This does not make any sense to us, but hopefully some of you can get something from it.

//Martin
-------------------------------------------------------------------
soft_trace: java/lang/System.runFinalization()V
soft_trace: java/lang/Runtime.getRuntime()Ljava/lang/Runtime;
[Switching to Thread 31582]

Program received signal SIGUSR1, User defined signal 1.
0x400e458b in __sigsuspend (set=0xbf7ffb9c) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48
48      ../sysdeps/unix/sysv/linux/sigsuspend.c: No such file or directory.
(gdb) backtrace full
#0  0x400e458b in __sigsuspend (set=0xbf7ffb9c) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48
        resultvar = 3212835740
        saved_errno = 4
#1  0x4009d1a0 in pthread_cond_wait (cond=0x818a398, mutex=0x818a380) at restart.h:49
        jmpbuf = {{__jmpbuf = {1074436732, -1082131556, -1082130848, -1082131424, -1082131768, 
      1074385259}, __mask_was_saved = 0, __saved_mask = {__val = {0, 0, 0, 0, 0, 0, 0, 0, 1074375668, 
        0, 0, 1073860985, 3212835868, 1074373684, 200, 1074374340, 1074370484, 1074352752, 9, 
        135348680, 3, 3212835720, 1073832860, 1073819444, 262742500, 3212835844, 1073859563, 
        1074373684, 1074352752, 3212835864, 1073770324, 134514600}}}}
        mask = {__val = {0, 0, 1073818928, 1073819648, 1074352752, 9, 135348680, 3, 1074401537, 681, 
    134479873, 135832448, 1073861180, 3212835848, 1073782701, 1073818872, 1074354824, 7, 1073782526, 
    1074303112, 135832472, 135832448, 1073818928, 1073832860, 1074303764, 1073859563, 1074373684, 
    3212835940, 1073783072, 0, 0, 1074384992}}
        self = 0xbf7ffe60
        self = 0xbf7ffe60
#2  0x4006eaca in jcondvar_wait (cv=0x818a398, mux=0x818a380, timeout=0)
    at ../../../../../kaffe/kaffe/kaffevm/systems/unix-pthreads/lock-impl.c:39
        cur = (nativeThread *) 0x8187ec0
        stat = 4
        abst = {tv_sec = 1073783072, tv_nsec = 0}
        now = {tv_sec = 0, tv_usec = 1074195072}
#3  0x4004516a in _waitCond (lkp=0x4008f068, timeout=0) at ../../../kaffe/kaffe/kaffevm/ksem.h:87
        r = 1 '\001'
        sem = (Ksem *) 0x818a380
        timeout = 0
        lk = (iLock *) 0x40088df8
        holder = (void *) 0xbf7ffce4
        tid = (Hjava_lang_Thread *) 0x8187e50
        ptr = (Hjava_lang_Thread **) 0x818a380
        r = 32 ' '
#4  0x4003523f in finaliserMan (arg=0x4008e8e0)
    at ../../../kaffe/kaffe/kaffevm/mem/gc-incremental.c:764
        info = (gc_block *) 0x4004de01
        unit = (gc_unit *) 0xbf7ffd14
        gcif = (Collector *) 0x4008e8e0
        iLockRoot = 0
#5  0x4004da7e in startSpecialThread (arg=0x8187e50) at ../../../kaffe/kaffe/kaffevm/thread.c:273
        tid = (Hjava_lang_Thread *) 0x8
        func = (void (*)()) 0x4
        argument = (void *) 0xfffffffc
#6  0x400701cb in tRun (p=0x8187ec0)
    at ../../../../../kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:550
        p = (void *) 0xfffffffc
        cur = (nativeThread *) 0x8187ec0
        t = (nativeThread *) 0x4
        ss = 32768
        oldCancelType = 0
        iLockRoot = -1082131136
#7  0x4009deca in pthread_start_thread (arg=0xbf7ffe60) at manager.c:213
        self = 0xbf7ffe60
        request = {req_thread = 0xbf7ffe60, req_kind = REQ_DEBUG, req_args = {create = {attr = 0x0, 
      fn = 0, arg = 0x0, mask = {__val = {0 <repeats 32 times>}}}, free = {thread_id = 0}, exit = {
      code = 0}, post = 0x0}}
        outcome = (void *) 0xfffffffc
(gdb) 
-------------------------------------------------------------------
-----Original Message-----
From: Dalibor Topic [mailto:robilad at yahoo.com]
Sent: den 25 oktober 2002 15:44
To: Josef Nordangård; kaffe at kaffe.org
Subject: Re: [kaffe] Problem with garbage collection and p-threads


Hi Josef,

--- Josef_Nordangård <Josef.Nordangard at ascomtateco.se>
wrote:
> Hi!
> 
> The garbage collection is not working properly when
> an application using JNI is running. There is simply
> no collection of no-longer-used memory at all,
> instead the entire process is frozen when the gc
> should start. Kaffe is build with p-threads due to
> our native code is using p-threads. 

thanks for the bug report. Could you take a look at
FAQ.debugging, configure kaffe with --enable-debug and
fire up the gdb to see where kaffe is hanging?

> Is there anyone who has used p-thread compiled kaffe
> together with JNI? Is this supposed to work? If not,
> how much work would it take to fix it?

It would be great if you could try to fix pthreads
support in kaffe. A couple of regression test still
fail on i386-linux, if I recall it correctly, and
that's always a bad sign.

best regards,

dalibor topic

__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/

_______________________________________________
kaffe mailing list
kaffe at kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe




More information about the kaffe mailing list