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]

Strange crash when linking static.


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\10CC02EISS\0\0010\0\22MIT-MAGIC-COOKI"..., 131072) = 102
[pid 6555] close(6) = 0
[pid 6555] munmap(0xb7bf0000, 131072) = 0
[pid 6555] writev(5, [{"l\0\v\0\0\0\22\0\20\0\0\0", 12}, {"MIT-MAGIC-COOKIE-1", 18}, {"\0\0", 2}, {"@\216\271zQ\27$\2570}\243\227y}\332a", 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\v\0\0\0\303\0", 8) = 8
[pid 6555] read(5, "`5\236\3\0\0\200\3\377\377\37\0\0\1\0\0\24\0\377\377\1"..., 780) = 780
[pid 6555] write(5, "7\0\5\0\0\0\200\3\216\0\0\0\10\0\0\0\377\377\377\0b\0\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\0h\r\320"..., 32) = 32
[pid 6555] read(5, "\1\10\3\0\322\r\0\0\37\0\0\0\0\0\0\0H7\0\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\0h\r"..., 32) = 32
[pid 6555] writev(5, [{"b\0\5\0\t\0\200\3", 8}, {"XKEYBOARD", 9}, {"\0\0\0", 3}], 3) = 20
[pid 6555] read(5, "\1\0\5\0\0\0\0\0\1\227o\261\0\0\0\0\1\0\0\0\3\0\0\0h\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\0h\r\320"..., 32) = 32
[pid 6555] write(5, "\20\0\5\0\v\0\0\0Custom Init\0", 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\0h\r\320"..., 32) = 32
[pid 6555] write(5, "\20\0\5\0\v\0\0\0Custom Data\0", 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\0h\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.


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