This is the mail archive of the
libc-alpha@cygnus.com
mailing list for the glibc project.
java VM SEGV on 2.0.98
- To: libc-alpha@cygnus.com
- Subject: java VM SEGV on 2.0.98
- From: pw@dancer.ca.sandia.gov (Pete Wyckoff)
- Date: Thu, 22 Oct 1998 17:44:03 -0700
- Cc: pw@dancer.ca.sandia.gov
Something (presumably) in the jdk1.1.6v5 VM is corrupting glibc
structures during dynamic symbol lookup. I know, what do you care?
But a hack to glibc "fix"es it. linux-2.1.125, ix86,
glibc-2.0.98 with "-g -O", all shared libraries.
The java executable (from blackdown, built against glibc-2.0.7, they claim)
fails with stack trace:
#0 0x400a01e9 in dlsym (handle=0xffffffff, name=0x4007b3e4 "getmsg")
at dlsym.c:87
#1 0x40067839 in socket (domain=-1073744800, type=1024, protocol=1024)
at ../../../../src/genunix/java/green_threads/src/iomgr.c:255
#2 0x40067952 in InitializeAsyncIO ()
at ../../../../src/genunix/java/green_threads/src/iomgr.c:272
#3 0x4006307b in sysInitializeJavaVM ()
at ../../../../src/genunix/java/javai/javai.c:801
#4 0x40058561 in JNI_CreateJavaVM ()
at ../../../../src/share/java/runtime/jni.c:3924
#5 0x40062834 in java_main ()
at ../../../../src/genunix/java/javai/javai.c:149
#6 0x8061db6 in main (argc=2, argv=0xbffff5a4, envp=0xbffff5b0)
at ../../../../src/genunix/java/javai/java.c:31
I blindly modified elf/dlsym.c to avoid the problem as follows:
dlsym (void *handle, const char *name)
{
struct dlsym_args args;
args.caller = (ElfW(Addr)) __builtin_return_address (0);
args.handle = handle;
args.name = name;
#if 0 /* original */
return (_dlerror_run (dlsym_doit, &args)
? NULL : (void *) (args.loadbase + args.ref->st_value));
#else
if (_dlerror_run (dlsym_doit, &args)) {
return NULL;
} else {
if (args.ref) /* this dereference was causing SEGV */
return (void *) (args.loadbase + args.ref->st_value);
else {
printf("dlsym: not expecting NULL args, name = %s\n", name);
return NULL;
}
}
#endif
}
The symbols which cause problems are then printed out:
dlsym: not expecting NULL args, name = getmsg
dlsym: not expecting NULL args, name = putmsg
dlsym: not expecting NULL args, name = Java_java_lang_System_currentTimeMillis_stub
dlsym: not expecting NULL args, name = Java_java_lang_System_arraycopy_stub
dlsym: not expecting NULL args, name = Java_java_lang_Class_getPrimitiveClass_stub
...
Perhaps there's something about the "stub"-ness of these things. get/putmsg
are the only glibc symbols which appear, the rest are from jdk libs. An
older jdk (1.1.3) used to work on this machine under linux-2.1.x and some
single-digit glibc-2.0.x, but not with the new glibc-2.0.98.
Sorry for the lack of info. Just a warning in case more reports start
rolling in.
-- Pete
---------------------------------------------
Pete Wyckoff | wyckoff@ca.sandia.gov
Sandia National Labs | 925 294 3503 (voice)
MS 9011, P.O. Box 969 | 925 294 1225 (fax)
Livermore, CA 94551 |