This is the mail archive of the java-prs@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]

java/4031: Socket code failing with null ptr exception



>Number:         4031
>Category:       java
>Synopsis:       Socket code failing with null ptr exception
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 15 05:46:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Robert Olson
>Release:        gcj 2.96
>Organization:
>Environment:
RedHat Linux 7.1 on i386
>Description:
A simple socket code to read a web browser request crashes with an exception. The code works fine under Sun JDK1.2.2.

gcj  -g -v -o fo --main=fo fo.java
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/libgcj.spec
rename spec lib to liborig
rename spec startfile to startfileorig
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-81)
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/jc1 fo.java -fno-use-divide-subroutine -fasynchronous-exceptions -quiet -dumpbase fo.java -g -version -o /tmp/ccwYvix0.s
GNU Java version 2.96 20000731 (Red Hat Linux 7.1 2.96-81) (i386-redhat-linux) compiled by GNU C version 2.96 20000731 (Red Hat Linux 7.1 2.96-81).
 as -V -Qy -o /tmp/ccBr5Wr6.o /tmp/ccwYvix0.s
GNU assembler version 2.10.91 (i386-redhat-linux) using BFD version 2.10.91.0.2
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/jvgenmain fo /tmp/ccOqLhWimain.i
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/cc1 /tmp/ccOqLhWimain.i -quiet -dumpbase fo.c -g -version -o /tmp/ccfNRl1umain.s
GNU C version 2.96 20000731 (Red Hat Linux 7.1 2.96-81) (i386-redhat-linux) compiled by GNU C version 2.96 20000731 (Red Hat Linux 7.1 2.96-81).
 as -V -Qy -o /tmp/ccaZyNRJmain%O /tmp/ccfNRl1umain.s
GNU assembler version 2.10.91 (i386-redhat-linux) using BFD version 2.10.91.0.2
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o fo /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crti.o /usr/lib/gcc-lib/i386-redhat-linux/2.96/crtbegin.o -u __rethrow -u __frame_state_for -lgcc -L/usr/lib/gcc-lib/i386-redhat-linux/2.96 -L/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../.. /tmp/ccBr5Wr6.o /tmp/ccaZyNRJmain%O -lgcc -lgcj -lm -lgcjgc -lpthread -lzgcj -ldl -lc -lgcc /usr/lib/gcc-lib/i386-redhat-linux/2.96/crtend.o /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crtn.o

$ ./fo
start webiew
webview got GET /asdf HTTP/1.0
have 3 9
start me up
closedown
WebView processreq threw java.lang.NullPointerException: null
java.lang.NullPointerException
   at 0x4010b779: _Jv_ThrowSignal (/usr/lib/libgcj.so.1)
   at 0x4010b7b2: _Jv_ThrowSignal (/usr/lib/libgcj.so.1)
   at 0x40173f5a: java::lang::StringBuffer::ensureCapacity_unsynchronized(int) (/usr/lib/libgcj.so.1)
   at 0x40173953: java::lang::StringBuffer::append(java::lang::String *) (/usr/lib/libgcj.so.1)
   at 0x0804cbe1: __frame_state_for (./fo)
   at 0x0804c2c9: __frame_state_for (./fo)
   at 0x0804c271: __frame_state_for (./fo)
   at 0x401ce21d: gnu::gcj::runtime::FirstThread::run(void) (/usr/lib/libgcj.so.1)
   at 0x401d7d36: java::lang::Thread::run_(java::lang::Object *) (/usr/lib/libgcj.so.1)
   at 0x401e814d: _Jv_ThreadSetPriority(_Jv_Thread_t *, int) (/usr/lib/libgcj.so.1)
   at 0x403094a0: GC_start_routine (/usr/lib/libgcjgc.so.1)
   at 0x40322bfd: pthread_detach (/lib/i686/libpthread.so.0)
   at 0x4042977a: __clone (/lib/i686/libc.so.6)
WebView: close socket error - Bad file descriptor
>How-To-Repeat:
Compile and run, then either point a web browser to port 9999 on that host or telnet to it and type the request of the form "GET /asdf HTTP/1.0":

% telnet host 9999
Trying hostip...
Connected to host.
Escape character is '^]'.
GET /asdf HTTP/1.0
Content-type: text/plain

Got asdfConnection closed by foreign host.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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