GCJ 3.3 garbage collection live-lock(conjencture) and GDB for iditos and

Øyvind Harboe oyvind.harboe@zylin.com
Wed Feb 26 09:24:00 GMT 2003


I've gotten enough clues from the various postings all of you have contributed that 
I was able to make significant progress within 30 minutes of trying. 
There is such a thing as GDB for idiots! :-)

My conjencture is that my app is live-locked in thread #3 and #2, and that 
garbage collection is somehow involved.

- MinGW GDB works on Mohans GCJ 3.3
- Compile your app with -g option(includes symbols into .exe).
- Run your app as you normally do from a shell
- From a a second shell, launch GDB
- I have included two debug sessions below. The first is the live-locked app, the second
my healthy app.

Q: How do I "pause" an app after I have "continue"'d it? 

Livelocked app:
C:\eclipse\workspace\output\edgemaster>\mingw\bin\gdb
GNU gdb 5.1.1 (mingw experimental)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "mingw32".
(gdb) attach 472
Attaching to process 472
[Switching to thread 472.0x7e4]
(gdb) symbol-file edgemaster.exe
Reading symbols from edgemaster.exe...done.
(gdb) thread apply all bt
Thread 5 (thread 472.0x7e4):
#0  0x77f97705 in _libwsock32_a_iname ()
#1  0x77e8fdd5 in _libwsock32_a_iname ()
#2  0x77e8b2d8 in _libwsock32_a_iname ()
Thread 4 (thread 472.0x9b0):
#0  0x77f837b2 in _libwsock32_a_iname ()
#1  0x77ea9d00 in _libwsock32_a_iname ()
#2  0x77ea9c13 in _libwsock32_a_iname ()
#3  0x006d9ddb in java::lang::Thread::sleep(long long, int) ()
#4  0x006b5a48 in java::lang::Thread::sleep(long long) ()
#5  0x005ca27a in javax.comm.SerialPortEventTask.run() ()
    at javax/comm/SerialPortEventTask.java:216
#6  0x006da0e7 in _Jv_ThreadRun(java::lang::Thread*) ()
#7  0x006ed0f7 in _Z12really_startPv@4 ()
#8  0x00746b98 in thread_start@4 ()
#9  0x77e8b2d8 in _libwsock32_a_iname ()
Thread 3 (thread 472.0x6b4):
#0  0x77f83786 in _libwsock32_a_iname ()
#1  0x77f85c55 in _libwsock32_a_iname ()
#2  0x77f85bd1 in _libwsock32_a_iname ()
---Type <return> to continue, or q <return> to quit---
#3  0x006e995e in gnu::gcj::runtime::FinalizerThread::finalizerReady() ()
#4  0x0073b9d6 in GC_notify_or_invoke_finalizers ()
#5  0x006efa61 in GC_generic_malloc ()
#6  0x006efbaa in GC_malloc_atomic ()
#7  0x006a082e in _Jv_AllocPtrFreeObject ()
#8  0x006cfa89 in _Jv_AllocString ()
#9  0x006cfab0 in _Jv_NewString ()
#10 0x00698177 in com.zylin.util.StringManipulation.replaceAll(java.lang.String,
 java.lang.String, java.lang.String) (in=0x231b9d0, a=0x231b990, b=0x1113f90)
    at com/zylin/util/StringManipulation.java:28
#11 0x006922f9 in com.cyviz.xpo.Connection.result() (this=0x25519c0)
    at com/cyviz/xpo/Connection.java:361
#12 0x0068fe80 in com.cyviz.xpo.Box.readLocationSignal() (this=0x1a17438)
    at com/cyviz/xpo/Box.java:444
#13 0x0069021f in com.cyviz.xpo.Box.readConfiguration() (this=0x1a17438)
    at com/cyviz/xpo/Box.java:511
#14 0x006948f9 in com.cyviz.xpo.Connection.busScan() (this=0x25519c0)
    at com/cyviz/xpo/Connection.java:877
#15 0x0069378f in com.cyviz.xpo.Connection.completeConnection() (
    this=0x25519c0) at com/cyviz/xpo/Connection.java:634
#16 0x006955ac in com.cyviz.xpo.Connection.connect(com.cyviz.gui.Progress, java.
lang.String) (t_progress=0x1350f20, portName=0x19fcd60)
    at com/cyviz/xpo/Connection.java:1042
---Type <return> to continue, or q <return> to quit---
#17 0x00674f67 in com.cyviz.blender.Blender$EdgeBlenderSession.MainLoop() (
    this=0x22fd370) at Blender.java:887
#18 0x00679604 in com.cyviz.blender.Blender$EdgeBlenderSession.access$10(com.cyv
iz.blender.Blender$EdgeBlenderSession) (ARG_1=0x22fd370) at Blender.java:879
#19 0x0066f2ea in com.cyviz.blender.Blender$7.run() (this=0x1a09928)
    at Blender.java:1292
#20 0x006b57c9 in java::lang::Thread::run() ()
#21 0x006da0e7 in _Jv_ThreadRun(java::lang::Thread*) ()
#22 0x006ed0f7 in _Z12really_startPv@4 ()
#23 0x00746b98 in thread_start@4 ()
#24 0x77e8b2d8 in _libwsock32_a_iname ()
Thread 2 (thread 472.0x7e8):
#0  0x77f8e644 in _libwsock32_a_iname ()
#1  0x77f8e440 in _libwsock32_a_iname ()
#2  0x77f8e4db in _libwsock32_a_iname ()
#3  0x77fa0316 in _libwsock32_a_iname ()
#4  0x006d864e in _Jv_FinalizeObject(java::lang::Object*) ()
#5  0x006ec960 in call_finalizer(void*, void*) ()
#6  0x0073b988 in GC_invoke_finalizers ()
#7  0x006e9a6d in gnu::gcj::runtime::FinalizerThread::run() ()
#8  0x006da0e7 in _Jv_ThreadRun(java::lang::Thread*) ()
#9  0x006ed0f7 in _Z12really_startPv@4 ()
---Type <return> to continue, or q <return> to quit---
#10 0x00746b98 in thread_start@4 ()
#11 0x77e8b2d8 in _libwsock32_a_iname ()
Thread 1 (thread 472.0x838):
#0  0x77e585eb in _libwsock32_a_iname ()
#1  0x10008184 in _libwsock32_a_iname ()
#2  0x004de6d9 in org.eclipse.swt.widgets.Display.sleep() (this=0x139aed8)
    at org/eclipse/swt/widgets/Display.java:1788
#3  0x0068ac28 in com.cyviz.gui.XPOSWT.runGUI() (this=0x1350f20)
    at com/cyviz/gui/XPOSWT.java:1044
#4  0x006847b4 in com.cyviz.gui.EdgeMaster.main(java.lang.String[]) (
    args=0x1117fe0) at com/cyviz/gui/EdgeMaster.java:21
#5  0x00742ebc in gnu::gcj::runtime::FirstThread::call_main() ()
#6  0x006e9d62 in gnu::gcj::runtime::FirstThread::run() ()
#7  0x006da0e7 in _Jv_ThreadRun(java::lang::Thread*) ()
#8  0x006a1782 in _Jv_RunMain(java::lang::Class*, char const*, int, char const**
, bool) ()
#9  0x006a18c8 in JvRunMain ()
#10 0x004012a2 in main (argc=1, argv=0xc837e8) at c:/temp/ccSscaaa.i:13
#0  0x77f97705 in _libwsock32_a_iname ()
(gdb)
(gdb)

Healthy app:

C:\eclipse\workspace\output\edgemaster>\mingw\bin\gdb
GNU gdb 5.1.1 (mingw experimental)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "mingw32".
(gdb) attach 764
Can't attach to process.
(gdb) attach 2472
Attaching to process 2472
[Switching to thread 2472.0x81c]
(gdb) symbol-file edgemaster.exe
Reading symbols from edgemaster.exe...done.
(gdb) thread apply all bt
Thread 5 (thread 2472.0x81c):
#0  0x77f97705 in _libwsock32_a_iname ()
#1  0x77e8fdd5 in _libwsock32_a_iname ()
#2  0x77e8b2d8 in _libwsock32_a_iname ()
Thread 4 (thread 2472.0x698):
#0  0x77f837b2 in _libwsock32_a_iname ()
#1  0x77ea9d00 in _libwsock32_a_iname ()
#2  0x77ea9c13 in _libwsock32_a_iname ()
#3  0x006d9ddb in java::lang::Thread::sleep(long long, int) ()
#4  0x006b5a48 in java::lang::Thread::sleep(long long) ()
#5  0x005ca27a in javax.comm.SerialPortEventTask.run() ()
    at javax/comm/SerialPortEventTask.java:216
#6  0x006da0e7 in _Jv_ThreadRun(java::lang::Thread*) ()
#7  0x006ed0f7 in _Z12really_startPv@4 ()
#8  0x00746b98 in thread_start@4 ()
#9  0x77e8b2d8 in _libwsock32_a_iname ()
Thread 3 (thread 2472.0x1d8):
#0  0x77f837b2 in _libwsock32_a_iname ()
#1  0x77ea9d00 in _libwsock32_a_iname ()
#2  0x77ea9c13 in _libwsock32_a_iname ()
---Type <return> to continue, or q <return> to quit---
#3  0x006d95e8 in java::lang::Object::wait(long long, int) ()
#4  0x006a1d14 in java::lang::Object::wait() ()
#5  0x00674de2 in com.cyviz.blender.Blender$EdgeBlenderSession.waitForMore() (
    this=0x1360f50) at Blender.java:860
#6  0x00674502 in com.cyviz.blender.Blender$EdgeBlenderSession.MainLoopCore() (
    this=0x1360f50) at Blender.java:780
#7  0x006751e4 in com.cyviz.blender.Blender$EdgeBlenderSession.MainLoop() (
    this=0x1360f50) at Blender.java:920
#8  0x00679604 in com.cyviz.blender.Blender$EdgeBlenderSession.access$10(com.cyv
iz.blender.Blender$EdgeBlenderSession) (ARG_1=0x1360f50) at Blender.java:879
#9  0x0066f2ea in com.cyviz.blender.Blender$7.run() (this=0x1115088)
    at Blender.java:1292
#10 0x006b57c9 in java::lang::Thread::run() ()
#11 0x006da0e7 in _Jv_ThreadRun(java::lang::Thread*) ()
#12 0x006ed0f7 in _Z12really_startPv@4 ()
#13 0x00746b98 in thread_start@4 ()
#14 0x77e8b2d8 in _libwsock32_a_iname ()
Thread 2 (thread 2472.0x93c):
#0  0x77f837b2 in _libwsock32_a_iname ()
#1  0x77ea9d00 in _libwsock32_a_iname ()
#2  0x77ea9c13 in _libwsock32_a_iname ()
#3  0x006d95e8 in java::lang::Object::wait(long long, int) ()
---Type <return> to continue, or q <return> to quit---
#4  0x006a1d14 in java::lang::Object::wait() ()
#5  0x006e9a5e in gnu::gcj::runtime::FinalizerThread::run() ()
#6  0x006da0e7 in _Jv_ThreadRun(java::lang::Thread*) ()
#7  0x006ed0f7 in _Z12really_startPv@4 ()
#8  0x00746b98 in thread_start@4 ()
#9  0x77e8b2d8 in _libwsock32_a_iname ()
Thread 1 (thread 2472.0x8a4):
#0  0x77e585eb in _libwsock32_a_iname ()
#1  0x10008184 in _libwsock32_a_iname ()
#2  0x004de6d9 in org.eclipse.swt.widgets.Display.sleep() (this=0x139aed8)
    at org/eclipse/swt/widgets/Display.java:1788
#3  0x0068ac28 in com.cyviz.gui.XPOSWT.runGUI() (this=0x1350f20)
    at com/cyviz/gui/XPOSWT.java:1044
#4  0x006847b4 in com.cyviz.gui.EdgeMaster.main(java.lang.String[]) (
    args=0x1117fe0) at com/cyviz/gui/EdgeMaster.java:21
#5  0x00742ebc in gnu::gcj::runtime::FirstThread::call_main() ()
#6  0x006e9d62 in gnu::gcj::runtime::FirstThread::run() ()
#7  0x006da0e7 in _Jv_ThreadRun(java::lang::Thread*) ()
#8  0x006a1782 in _Jv_RunMain(java::lang::Class*, char const*, int, char const**
, bool) ()
#9  0x006a18c8 in JvRunMain ()
#10 0x004012a2 in main (argc=1, argv=0xc837e8) at c:/temp/ccSscaaa.i:13
---Type <return> to continue, or q <return> to quit---
#0  0x77f97705 in _libwsock32_a_iname ()
(gdb)
(gdb)

 



More information about the Java mailing list