This is the mail archive of the java@gcc.gnu.org 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]
Other format: [Raw text]

Re: Freeze in GC_suspend_handler



Is this from a clean build of the gcc 3.1 release tree?  It would would be nice to understand exactly where and why _Jv_MarkObj is failing.

I built the last snapshot (gcc version 3.1.1 20020603 (prerelease)) from source, to have debugging symbols and a known source tree. The same SEGV occurs, inside the GC, but interestingly at a different entry point from my program. One thing that looks suspicious in the stack trace is the call to _Jv_AllocBytes(int) with parameter (size=0).

The SEGV occurs at gcc/libjava/boehm.cc:193
I suppose you can browse this file, from that version. Here is the context, finishing with the offending line:
// For the interpreter, we also need to mark the memory
// containing static members
if ((field->flags & java::lang::reflect::Modifier::STATIC))
{
p = (ptr_t) field->u.addr;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c8clabel);

// also, if the static member is a reference,
// mark also the value pointed to. We check for isResolved
// since marking can happen before memory is allocated for
// static members.
if (JvFieldIsRef (field) && field->isResolved())
{
jobject val = *(jobject*) field->u.addr;

Here is the gdb session:

(gdb) run --runtime=share/java/nice.jar -r regtest.basic
Starting program: /home/daniel/Nice/bin/nicec.bin --runtime=share/java/nice.jar -r regtest.basic
[New Thread 1024 (LWP 21140)]
[New Thread 2049 (LWP 21141)]
[New Thread 1026 (LWP 21142)]
Compiling package nice.lang
Compiling package regtest.basic

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 21140)]
_Jv_MarkObj (addr=0x86ac070, msp=0x405272a4, msl=0x8284000)
at ../../../gcc/libjava/boehm.cc:193
193 ../../../gcc/libjava/boehm.cc: No such file or directory.
in ../../../gcc/libjava/boehm.cc
Current language: auto; currently c++
(gdb) bt
#0 _Jv_MarkObj (addr=0x86ac070, msp=0x405272a4, msl=0x8284000)
at ../../../gcc/libjava/boehm.cc:193
#1 0x403e4062 in GC_mark_from (mark_stack_top=0x827c398,
mark_stack=0x827c000, mark_stack_limit=0x8284000)
at ../../../gcc/boehm-gc/mark.c:594
#2 0x403e389f in GC_mark_some (cold_gc_frame=0x405a4b70 "x?'\b")
at ../../../gcc/boehm-gc/mark.c:357
#3 0x403db7b5 in GC_stopped_mark (stop_func=0x405a4b70 <GC_mark_stack_top>)
at ../../../gcc/boehm-gc/alloc.c:489
#4 0x403db4b3 in GC_try_to_collect_inner (
stop_func=0x403dafa0 <GC_never_stop_func>)
at ../../../gcc/boehm-gc/alloc.c:350
#5 0x403dc4af in GC_collect_or_expand (needed_blocks=1, ignore_off_page=0)
at ../../../gcc/boehm-gc/alloc.c:974
#6 0x403dc597 in GC_allocobj (sz=12, kind=0)
at ../../../gcc/boehm-gc/alloc.c:1019
#7 0x403e2186 in GC_generic_malloc_inner (lb=48, k=0)
at ../../../gcc/boehm-gc/malloc.c:134
#8 0x403e3001 in GC_generic_malloc_many (lb=48, k=0, result=0x405a45d4)
at ../../../gcc/boehm-gc/mallocx.c:496
#9 0x403e0918 in GC_local_malloc_atomic (bytes=46)
at ../../../gcc/boehm-gc/linux_threads.c:370
#10 0x403d8b95 in _Jv_AllocBytes(int) (size=0)
at ../../../gcc/libjava/boehm.cc:325
#11 0x4021f77c in _Jv_makeUtf8Const(char*, int) (
s=0xbffff040 "bossa.syntax.Block$LocalVariable$Symbol", len=0)
at ../../../gcc/libjava/prims.cc:251
#12 0x40249719 in java::lang::Class::forName(java::lang::String*, bool, java::lang::ClassLoader*) (className=0x872ecc0, initialize=1 '\001', loader=0x0)
at ../../../gcc/libjava/java/lang/natClass.cc:80
#13 0x402497ff in java::lang::Class::forName(java::lang::String*) (
className=0x0) at ../../../gcc/libjava/java/lang/natClass.cc:103
#14 0x0805a345 in nice.lang.fun.instanceof(java.lang.Object, java.lang.String)
(ARG_1=0x84442c0, ARG_2=0x872ecc0) at ~/Nice/stdlib.new/nice/lang:29
#15 0x080da886 in bossa.syntax.fun.analyseIdent(bossa.syntax.IdentExp, bossa.syntax.Info, boolean) (ARG_1=0x833e828, ARG_2=0x880a720, ARG_3=true)
at ~/Nice/src.new/bossa/syntax:355
#16 0x080da79d in bossa.syntax.fun.analyseAssigned(bossa.syntax.IdentExp, bossa.syntax.Info) (ARG_1=0x833e828, ARG_2=0x880a720)
at ~/Nice/src.new/bossa/syntax:221
#17 0x080d4674 in bossa.syntax.dispatch.analyseAssigned(bossa.syntax.Expression, bossa.syntax.Info) (ARG_1=0x833e828, ARG_2=0x880a720)
at bossa/syntax/TypeMaper.java:40
#18 0x080da6ee in bossa.syntax.fun.analyseAssigned(bossa.syntax.TupleExp, bossa.syntax.Info) (ARG_1=0x83decf0, ARG_2=0x880a720)
at ~/Nice/src.new/bossa/syntax:221
#19 0x080d46c2 in bossa.syntax.dispatch.analyseAssigned(bossa.syntax.Expression, bossa.syntax.Info) (ARG_1=0x83decf0, ARG_2=0x880a720)
at bossa/syntax/TypeMaper.java:40
#20 0x080da5ee in bossa.syntax.fun.analyse(bossa.syntax.AssignExp, bossa.syntax.Info) (ARG_1=0x83decd8, ARG_2=0x880a720) at ~/Nice/src.new/bossa/syntax:229
#21 0x080d4748 in bossa.syntax.dispatch.analyse(bossa.syntax.Expression, bossa.syntax.Info) (ARG_1=0x83decd8, ARG_2=0x880a720)
at bossa/syntax/TypeMaper.java:40
#22 0x080d9089 in bossa.syntax.fun.analyse(bossa.syntax.ExpressionStmt, bossa.syntax.Info) (ARG_1=0x8552420, ARG_2=0x880a720)
at ~/Nice/src.new/bossa/syntax:514
#23 0x080d4cb4 in bossa.syntax.dispatch.analyse(bossa.syntax.Statement, bossa.syntax.Info) (ARG_1=0x8552420, ARG_2=0x880a720) at bossa/syntax/TypeMaper.java:40
#24 0x080d9231 in bossa.syntax.fun.analyse(bossa.syntax.Statement[], bossa.syntax.Info) (ARG_1=0x83e5110, ARG_2=0x880a720) at ~/Nice/src.new/bossa/syntax:507
#25 0x080d9173 in bossa.syntax.fun.analyse(bossa.syntax.Block, bossa.syntax.Info) (ARG_1=0x85e4920, ARG_2=0x880a720) at ~/Nice/src.new/bossa/syntax:496
#26 0x080d4c6c in bossa.syntax.dispatch.analyse(bossa.syntax.Statement, bossa.syntax.Info) (ARG_1=0x85e4920, ARG_2=0x880a720) at bossa/syntax/TypeMaper.java:40
#27 0x080d9231 in bossa.syntax.fun.analyse(bossa.syntax.Statement[], bossa.syntax.Info) (ARG_1=0x83e50e0, ARG_2=0x880a720) at ~/Nice/src.new/bossa/syntax:507
#28 0x080d9173 in bossa.syntax.fun.analyse(bossa.syntax.Block, bossa.syntax.Info) (ARG_1=0x85e49c0, ARG_2=0x880a720) at ~/Nice/src.new/bossa/syntax:496
#29 0x080d4c6c in bossa.syntax.dispatch.analyse(bossa.syntax.Statement, bossa.syntax.Info) (ARG_1=0x85e49c0, ARG_2=0x880a720) at bossa/syntax/TypeMaper.java:40
#30 0x080d9231 in bossa.syntax.fun.analyse(bossa.syntax.Statement[], bossa.syntax.Info) (ARG_1=0x83e50b0, ARG_2=0x880a720) at ~/Nice/src.new/bossa/syntax:507
#31 0x080d9173 in bossa.syntax.fun.analyse(bossa.syntax.Block, bossa.syntax.Info) (ARG_1=0x85e4a60, ARG_2=0x880a720) at ~/Nice/src.new/bossa/syntax:496
#32 0x080d4c6c in bossa.syntax.dispatch.analyse(bossa.syntax.Statement, bossa.syntax.Info) (ARG_1=0x85e4a60, ARG_2=0x880a720) at bossa/syntax/TypeMaper.java:40
#33 0x080d9231 in bossa.syntax.fun.analyse(bossa.syntax.Statement[], bossa.syntax.Info) (ARG_1=0x83e5080, ARG_2=0x880a720) at ~/Nice/src.new/bossa/syntax:507
#34 0x080d9173 in bossa.syntax.fun.analyse(bossa.syntax.Block, bossa.syntax.Info) (ARG_1=0x85e4ab0, ARG_2=0x880a720) at ~/Nice/src.new/bossa/syntax:496
#35 0x080d4c6c in bossa.syntax.dispatch.analyse(bossa.syntax.Statement, bossa.syntax.Info) (ARG_1=0x85e4ab0, ARG_2=0x880a720) at bossa/syntax/TypeMaper.java:40
#36 0x080db9c5 in bossa.syntax.fun.analyse(bossa.syntax.Statement, bossa.syntax.VarScope, bossa.syntax.TypeScope, boolean) (ARG_1=0x85e4ab0, ARG_2=0x87d7d80,
ARG_3=0x87d7d60, ARG_4=false) at ~/Nice/src.new/bossa/syntax:46
#37 0x080d38df in bossa.syntax.dispatch.analyse(bossa.syntax.Statement, bossa.syntax.VarScope, bossa.syntax.TypeScope, boolean) (ARG_1=0x85e4ab0,
ARG_2=0x87d7d80, ARG_3=0x87d7d60, ARG_4=false)
at bossa/syntax/TypeMaper.java:40
#38 0x080c7997 in bossa.syntax.ToplevelFunction.resolve() (this=0x85220a0)
at bossa/syntax/ToplevelFunction.java:78
#39 0x080a9196 in bossa.syntax.Node.doResolve() (this=0x85220a0)
at bossa/syntax/Node.java:284
#40 0x080ae1c8 in bossa.syntax.AST.resolve(bossa.syntax.Node) (this=0x865f660,
n=0x85220a0) at bossa/syntax/AST.java:45
#41 0x080ae3cf in bossa.syntax.AST.resolveScoping() (this=0x865f660)
at bossa/syntax/AST.java:68
#42 0x0806374d in bossa.modules.Package.load() (this=0x830ec78)
at bossa/modules/Package.java:257
#43 0x0805f27d in mlsub.compilation.fun.lambda11(mlsub.compilation.Module) (
ARG_1=0x830ec78) at ~/Nice/src.new/mlsub/compilation:31
#44 0x0805f3c3 in mlsub.compilation.fun.apply1(gnu.expr.ModuleMethod, java.lang.Object) () at ~/Nice/src.new/mlsub/compilation:31
#45 0x081571ef in gnu.expr.ModuleMethod.apply1(java.lang.Object) (
this=0x8682cf0, arg1=0x830ec78) at gnu/expr/ModuleMethod.java:88
#46 0x0805c08c in nice.lang.fun.iter(nice.lang.Sequence, java.lang.Object) (
ARG_1=0x8680710, ARG_2=0x8682cf0) at ~/Nice/stdlib.new/nice/lang:57
#47 0x08059ddd in nice.lang.dispatch.iter(nice.lang.Collection, java.lang.Object) (ARG_1=0x8680710, ARG_2=0x8682cf0) at nice/lang/Native.java:49
#48 0x0805eef7 in mlsub.compilation.fun.compileComponent(nice.lang.List, boolean) (ARG_1=0x8680710, ARG_2=true) at ~/Nice/src.new/mlsub/compilation:34
#49 0x0805ed6a in mlsub.compilation.dispatch.compileComponent(nice.lang.List, boolean) (ARG_1=0x8680710, ARG_2=true) at mlsub/compilation/Compilation.java:27
#50 0x0805f86c in mlsub.compilation.fun$make.lambda7(nice.lang.List) (
this=0x8680780, ARG_1=0x8680710) at mlsub/compilation/fun$make.java:59
#51 0x0805f969 in mlsub.compilation.fun$make.apply1(gnu.expr.ModuleMethod, java.lang.Object) () at mlsub/compilation/fun$make.java:59
#52 0x081571ef in gnu.expr.ModuleMethod.apply1(java.lang.Object) (
this=0x8682c90, arg1=0x8680710) at gnu/expr/ModuleMethod.java:88
#53 0x0805c08c in nice.lang.fun.iter(nice.lang.Sequence, java.lang.Object) (
ARG_1=0x8680760, ARG_2=0x8682c90) at ~/Nice/stdlib.new/nice/lang:57
#54 0x08059ddd in nice.lang.dispatch.iter(nice.lang.Collection, java.lang.Object) (ARG_1=0x8680760, ARG_2=0x8682c90) at nice/lang/Native.java:49
#55 0x0805ee31 in mlsub.compilation.fun.make(mlsub.compilation.Compilation) (
ARG_1=0x82d9f90) at ~/Nice/src.new/mlsub/compilation:58
#56 0x0805ed39 in mlsub.compilation.dispatch.make(mlsub.compilation.Compilation) (ARG_1=0x82d9f90) at mlsub/compilation/Compilation.java:27
#57 0x08057a6e in nice.tools.compiler.fun.compile(java.lang.String[]) (
ARG_1=0x82cba68) at ~/Nice/src.new/nice/tools/compiler:166
#58 0x080566dd in nice.tools.compiler.fun.main(java.lang.String[]) (
ARG_1=0x82cba68) at ~/Nice/src.new/nice/tools/compiler:206
#59 0x40247818 in gnu::gcj::runtime::FirstThread::call_main() (this=0x82d9fc0)
at ../../../gcc/libjava/gnu/gcj/runtime/natFirstThread.cc:46
#60 0x402d1098 in gnu.gcj.runtime.FirstThread.run() (this=0x82d9fc0)
at ../../../gcc/libjava/gnu/gcj/runtime/FirstThread.java:54
#61 0x4025453c in _Jv_ThreadRun(java::lang::Thread*) (thread=0x82d9fc0)
at ../../../gcc/libjava/java/lang/natThread.cc:285
#62 0x40220cbc in _Jv_RunMain(java::lang::Class*, char const*, int, char const**, bool) (klass=0x81f2de0, name=0x0, argc=137207744, argv=0xbffffb24,
is_jar=false) at ../../../gcc/libjava/prims.cc:1010
#63 0x40220ddd in JvRunMain (klass=0x0, argc=0, argv=0x0)
at ../../../gcc/libjava/prims.cc:1020
#64 0x080553f4 in main (argc=4, argv=0xbffffb24) at /tmp/ccC2hpHs.i:11




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