This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
SV: GCJ 3.3 garbage collection live-lock(conjencture) and GDB for iditos and
- From: Øyvind Harboe <oyvind dot harboe at zylin dot com>
- To: <java at gcc dot gnu dot org>
- Date: Wed, 26 Feb 2003 10:18:28 +0100
- Subject: SV: GCJ 3.3 garbage collection live-lock(conjencture) and GDB for iditos and
I've found something which may be yet another clue to the live-lock problem.
GDB discoveres a segmentation fault, which does not appear during normal
execution of my program. My conjencture is that the normal Windows running
environment is a bit more forgiving than GDB; this is intentionally
so to make programs run in the field while making the bugs easier to find.
The "usual suspect" is my com.zylin.util.StringManipulation.java file,
which I use to work around String.replaceAll() not being supported by GCJ.
(Darn java.util.regexp!). The only particular thing about this function
is that it creates and deletes String objects like they
were going out of fashion.
package com.zylin.util;
public class StringManipulation
{
/** replaceAll() isn't supported by GCJ */
static public String replaceAll(String in, String a, String b)
{
String t="";
int i;
for (i=0; i<(in.length()-a.length()+1); i++)
{
String c=in.substring(i, i+a.length());
if (c.equals(a))
{
t+=b;
i=i+a.length()-1;
} else
{
t+=in.substring(i, i+1);
}
}
if (i<in.length())
{
t+=in.substring(i, in.length()-1);
}
return t;
}
C:\eclipse\workspace\output\edgemaster>\mingw\bin\gdb edgemaster.exe
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) run
Starting program: C:\eclipse\workspace\output\edgemaster/edgemaster.exe
Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 1924.0x8ac]
0x005cc8ed in javax.comm.SerialPortImpl.finalize() ()
at javax/comm/SerialPortImpl.java:598
598 javax/comm/SerialPortImpl.java: No such file or directory.
in javax/comm/SerialPortImpl.java
(gdb) thread apply all bt
Thread 6 (thread 1924.0x918):
#0 0x77f837b2 in ?? ()
#1 0x77ea9c13 in _libwsock32_a_iname ()
#2 0x006d9ddb in java::lang::Thread::sleep(long long, int) ()
#3 0x006b5a48 in java::lang::Thread::sleep(long long) ()
#4 0x005ca27a in javax.comm.SerialPortEventTask.run() ()
at javax/comm/SerialPortEventTask.java:216
#5 0x006da0e7 in _Jv_ThreadRun(java::lang::Thread*) ()
#6 0x006ed0f7 in _Z12really_startPv at 4 ()
#7 0x00746b98 in thread_start at 4 ()
#8 0x77e8b2d8 in _libwsock32_a_iname ()
Thread 3 (thread 1924.0x914):
#0 0x77f837c0 in ?? ()
#1 0x006e9998 in gnu::gcj::runtime::FinalizerThread::finalizerReady() ()
#2 0x0073b9d6 in GC_notify_or_invoke_finalizers ()
#3 0x006efa61 in GC_generic_malloc ()
#4 0x006efbaa in GC_malloc_atomic ()
#5 0x006a082e in _Jv_AllocPtrFreeObject ()
#6 0x006cfa89 in _Jv_AllocString ()
#7 0x006cfab0 in _Jv_NewString ()
#8 0x00698177 in com.zylin.util.StringManipulation.replaceAll(java.lang.String,
---Type <return> to continue, or q <return> to quit---
java.lang.String, java.lang.String) (in=0x2420f60, a=0x2420f20, b=0x1113f90)
at com/zylin/util/StringManipulation.java:28
#9 0x006922f9 in com.cyviz.xpo.Connection.result() (this=0x208dc60)
at com/cyviz/xpo/Connection.java:361
#10 0x0068fe80 in com.cyviz.xpo.Box.readLocationSignal() (this=0x1a165c8)
at com/cyviz/xpo/Box.java:444
#11 0x0069021f in com.cyviz.xpo.Box.readConfiguration() (this=0x1a165c8)
at com/cyviz/xpo/Box.java:511
#12 0x00693770 in com.cyviz.xpo.Connection.completeConnection() (
this=0x208dc60) at com/cyviz/xpo/Connection.java:631
#13 0x006955ac in com.cyviz.xpo.Connection.connect(com.cyviz.gui.Progress, java.
lang.String) (t_progress=0x1351f20, portName=0x19fbe10)
at com/cyviz/xpo/Connection.java:1042
#14 0x00674f67 in com.cyviz.blender.Blender$EdgeBlenderSession.MainLoop() (
this=0x1360f50) at Blender.java:887
#15 0x00679604 in com.cyviz.blender.Blender$EdgeBlenderSession.access$10(com.cyv
iz.blender.Blender$EdgeBlenderSession) (ARG_1=0x1360f50) at Blender.java:879
#16 0x0066f2ea in com.cyviz.blender.Blender$7.run() (this=0x19fd290)
at Blender.java:1292
#17 0x006b57c9 in java::lang::Thread::run() ()
#18 0x006da0e7 in _Jv_ThreadRun(java::lang::Thread*) ()
#19 0x006ed0f7 in _Z12really_startPv at 4 ()
#20 0x00746b98 in thread_start at 4 ()
---Type <return> to continue, or q <return> to quit---
#21 0x77e8b2d8 in _libwsock32_a_iname ()
Thread 2 (thread 1924.0x8ac):
#0 0x005cc8ed in javax.comm.SerialPortImpl.finalize() ()
at javax/comm/SerialPortImpl.java:598
#1 0x006d864e in _Jv_FinalizeObject(java::lang::Object*) ()
#2 0x006ec960 in call_finalizer(void*, void*) ()
#3 0x0073b988 in GC_invoke_finalizers ()
#4 0x006e9a6d in gnu::gcj::runtime::FinalizerThread::run() ()
#5 0x006da0e7 in _Jv_ThreadRun(java::lang::Thread*) ()
#6 0x006ed0f7 in _Z12really_startPv at 4 ()
#7 0x00746b98 in thread_start at 4 ()
#8 0x77e8b2d8 in _libwsock32_a_iname ()
Thread 1 (thread 1924.0x2a0):
#0 0x77e585eb in _libwsock32_a_iname ()
#1 0x10008184 in _libwsock32_a_iname ()
#2 0x004de6d9 in org.eclipse.swt.widgets.Display.sleep() (this=0x1399ed8)
at org/eclipse/swt/widgets/Display.java:1788
#3 0x0068ac28 in com.cyviz.gui.XPOSWT.runGUI() (this=0x1351f20)
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
---Type <return> to continue, or q <return> to quit---
#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=0xc824e8) at c:/temp/ccSscaaa.i:13
0x005cc8ed 598 in javax/comm/SerialPortImpl.java
(gdb)
(gdb)
(gdb)
(gdb) quit
The program is running. Exit anyway? (y or n) y
C:\eclipse\workspace\output\edgemaster>