Strange crash when linking static.

Clemens Eisserer ceisserer@utanet.at
Fri Oct 1 21:20:00 GMT 2004


Hi there!
I have a strange problem when building my static linked application that 
usses JNI and Network.
During linking I get the following message which does not sound too bad:
/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/libgcj.a(gc_dlopen.o)(.text+0xbc): 
In function `GC_dlopen':
: warning: Using 'dlopen' in statically linked applications requires at 
runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/libgcj.a(natRuntime.o)(.text+0xd0a): 
In function 
`java::lang::Runtime::insertSystemProperties(java::util::Properties*)':
: warning: Using 'getpwuid_r' in statically linked applications requires 
at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/libgcj.a(natInetAddress.o)(.text+0x503): 
In function `java::net::InetAddress::lookup(java::lang::String*, 
java::net::InetAddress*, bool)':
: warning: Using 'gethostbyaddr_r' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for 
linking
/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/libgcj.a(natInetAddress.o)(.text+0x22f): 
In function `java::net::InetAddress::lookup(java::lang::String*, 
java::net::InetAddress*, bool)':
: warning: Using 'gethostbyname_r' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for 
linking
looks quite fine, however does anybody know a way to make static builds 
independent from a shared glibc?
Hmm, but thats not my real problem.
If I start the application, I get the following:
[pid 6555] open("PATH/lib-gnu.so", O_RDONLY) = -1 ENOENT (No such file 
or directory)
[pid 6555] open("./lib-gnu.so", O_RDONLY) = -1 ENOENT (No such file or 
directory)
[pid 6555] open("/lib/lib-gnu.so", O_RDONLY) = -1 ENOENT (No such file 
or directory)
[pid 6555] open("/usr/lib/lib-gnu.so", O_RDONLY) = -1 ENOENT (No such 
file or directory)
[pid 6555] access("./gnu/gcj/convert/Input_UTF8.class", F_OK) = -1 
ENOENT (No such file or directory)
[pid 6555] uname({sys="Linux", node="CC02EISS", ...}) = 0
[pid 6555] socket(PF_UNIX, SOCK_STREAM, 0) = 5
[pid 6555] getrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=1024}) = 0
[pid 6555] uname({sys="Linux", node="CC02EISS", ...}) = 0
[pid 6555] uname({sys="Linux", node="CC02EISS", ...}) = 0
[pid 6555] connect(5, {sa_family=AF_UNIX, path="/tmp/.X11-unix/X0"}, 
19) = 0
[pid 6555] uname({sys="Linux", node="CC02EISS", ...}) = 0
[pid 6555] fcntl64(5, F_SETFD, FD_CLOEXEC) = 0
[pid 6555] access("/home/ce/.Xauthority", R_OK) = 0
[pid 6555] open("/home/ce/.Xauthority", O_RDONLY) = 6
[pid 6555] fstat64(6, {st_mode=S_IFREG|0600, st_size=102, ...}) = 0
[pid 6555] old_mmap(NULL, 131072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7bf0000
[pid 6555] read(6, "1円0円0円10円CC02EISS0円0010円0円22円MIT-MAGIC-COOKI"..., 
131072) = 102
[pid 6555] close(6) = 0
[pid 6555] munmap(0xb7bf0000, 131072) = 0
[pid 6555] writev(5, [{"l0円\v0円0円0円22円0円20円0円0円0円", 12}, 
{"MIT-MAGIC-COOKIE-1", 18}, {"0円0円", 2}, 
{"@216円271円zQ27円$2570円}243円227円y}332円a", 16}], 4) = 48
[pid 6555] fcntl64(5, F_GETFL) = 0x2 (flags O_RDWR)
[pid 6555] fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK) = 0
[pid 6555] read(5, "1円0円\v0円0円0円303円0円", 8) = 8
[pid 6555] read(5, 
"`5236円3円0円0円200円3円377円377円37円0円0円1円0円0円24円0円377円377円1円"..., 780) = 780
[pid 6555] write(5, 
"70円5円0円0円0円200円3円216円0円0円0円10円0円0円0円377円377円377円0円b0円5円"..., 64) = 64
[pid 6555] read(5, 
"1円0円2円0円0円0円0円0円1円203円0円0円0円0円0円0円0円0円0円0円3円0円0円0円h\r320円"..., 32) = 32
[pid 6555] read(5, 
"1円10円3円0円322円\r0円0円37円0円0円0円0円0円0円0円H70円0円0円0円0円0円0円0円"..., 32) = 32
[pid 6555] readv(5, [{"*Box.background:\t#dcdcdc\n*Box.fo"..., 14152}, 
{"", 0}], 2) = 14152
[pid 6555] write(5, "203円0円1円0円", 4) = 4
[pid 6555] read(5, 
"1円0円4円0円0円0円0円0円377円377円?0円0円0円0円0円1円0円0円0円3円0円0円0円h\r"..., 32) = 32
[pid 6555] writev(5, [{"b0円5円0円\t0円200円3円", 8}, {"XKEYBOARD", 9}, 
{"0円0円0円", 3}], 3) = 20
[pid 6555] read(5, 
"1円0円5円0円0円0円0円0円1円227円o261円0円0円0円0円1円0円0円0円3円0円0円0円h\r"..., 32) = 32
[pid 6555] write(5, "227円0円2円0円1円0円0円0円", 8) = 8
[pid 6555] read(5, 
"1円1円6円0円0円0円0円0円1円0円0円0円0円0円0円0円1円0円0円0円3円0円0円0円h\r320円"..., 32) = 32
[pid 6555] write(5, "20円0円5円0円\v0円0円0円Custom Init0円", 20) = 20
[pid 6555] read(5, 
"1円0円7円0円0円0円0円0円362円1円0円0円0円0円0円0円1円0円0円0円3円0円0円0円h\r320円"..., 32) = 32
[pid 6555] write(5, "20円0円5円0円\v0円0円0円Custom Data0円", 20) = 20
[pid 6555] read(5, 
"1円0円10円0円0円0円0円0円363円1円0円0円0円0円0円0円1円0円0円0円3円0円0円0円h\r"..., 32) = 32
[pid 6555] open("/usr/X11R6/lib/X11/locale/locale.alias", O_RDONLY) = 6
[pid 6555] fstat64(6, {st_mode=S_IFREG|0444, st_size=57372, ...}) = 0
[pid 6555] old_mmap(NULL, 131072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7bd0000
[pid 6555] read(6, "#\t$XdotOrg: xc/nls/locale.alias,"..., 131072) = 57372
[pid 6555] read(6, "", 131072) = 0
[pid 6555] close(6) = 0
[pid 6555] munmap(0xb7bd0000, 131072) = 0
[pid 6555] open("/usr/X11R6/lib/X11/locale/locale.dir", O_RDONLY) = 6
[pid 6555] fstat64(6, {st_mode=S_IFREG|0444, st_size=30119, ...}) = 0
[pid 6555] old_mmap(NULL, 131072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7bb0000
[pid 6555] read(6, "#\t$XdotOrg: xc/nls/locale.dir,v "..., 131072) = 30119
[pid 6555] close(6) = 0
[pid 6555] munmap(0xb7bb0000, 131072) = 0
[pid 6555] open("/usr/X11R6/lib/X11/locale/C/XI18N_OBJS", O_RDONLY) = 6
[pid 6555] fstat64(6, {st_mode=S_IFREG|0444, st_size=333, ...}) = 0
[pid 6555] old_mmap(NULL, 131072, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7b90000
[pid 6555] read(6, "# CATEGORY(XLC|XIM|OM)\tSHARED_LI"..., 131072) = 333
[pid 6555] read(6, "", 131072) = 0
[pid 6555] close(6) = 0
[pid 6555] munmap(0xb7b90000, 131072) = 0
[pid 6555] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
[pid 6555] rt_sigprocmask(SIG_UNBLOCK, [SEGV], NULL, 8) = 0
[pid 6555] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
[pid 6555] rt_sigprocmask(SIG_UNBLOCK, [SEGV], NULL, 8) = 0
[pid 6555] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
[pid 6555] rt_sigprocmask(SIG_UNBLOCK, [SEGV], NULL, 8) = 0
[pid 6555] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
[pid 6555] rt_sigprocmask(SIG_UNBLOCK, [SEGV], NULL, 8) = 0
[pid 6555] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
[pid 6555] rt_sigprocmask(SIG_UNBLOCK, [SEGV], NULL, 8) = 0
[pid 6555] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
[pid 6555] rt_sigprocmask(SIG_UNBLOCK, [SEGV], NULL, 8) = 0
[pid 6555] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
[pid 6555] rt_sigprocmask(SIG_UNBLOCK, [SEGV], NULL, 8) = 0
[pid 6555] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
[pid 6555] rt_sigprocmask(SIG_UNBLOCK, [SEGV], NULL, 8) = 0
[pid 6555] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
[pid 6555] rt_sigprocmask(SIG_UNBLOCK, [SEGV], NULL, 8) = 0
this rt_sigprocmask-syscall is repeated all the time, somtimes with some 
brk-syscalls mixed.
I tried to debug the whole thing using gdb, however gdb says that it 
faild setting a breakpoint in a shared library.
After this message gdb blocks the terminal and killing this gdb even 
killed the bash running gdb ;-)
Any ideas whats wrong? I use gcj-3.3.3 distributed with Fedora Core 2....
Any help would be very welcome. since I am not the type of hacker that 
could solve such problems by hand :-(
Btw. The dynamic linked version works perfect and a static linked hello 
world also works perfect.
Thanks a lot, lg Clemens Eisserer
PS: "Thanks for this great software", everytime I use it this words come 
in my mind. Its so great, really great!! Its amazing what you can do 
with GCJ.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /