bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/22797] Classpath (+VM) terminates with "broken pipe"


From: gcc-bugzilla at gcc dot gnu dot org
Subject: [Bug classpath/22797] Classpath (+VM) terminates with "broken pipe"
Date: 16 Oct 2005 01:27:15 -0000

System: Linux 2.6.8.1, Big Endian XScale
Java Env: JamVM 1.2.0 + Classpath 0.11

We're working on some networking applications on the XScale. From time to time
we have the problem that JamVM hangs (terminates) with a "broken pipe" error
message. This happens occasionally when a client disconnects from the server
(implemented in java, running on the XScale). At first we tought that there
might be something wrong with
our java code. But some more testing (along with a code review) with Sun's JRE
showed that our code seems to be stable (no broken pipes or whatever with JRE).

So I started diging a little into Classpath and managed to nail down the
location where the "broken pipe" error occurs. It is the _javanet_sendto
function in native/jni/java-net/javanet.c . There the
TARGET_NATIVE_NETWORK_SOCKET_SEND (or better: the send function) results in a
"broken pipe". I'm now thinking that there is something going wrong with
network data being sent after the socket was taken down or something like that.

What I did as a workaround was adding a signal handler for SIGPIPE. There I
throw an IO exception to inform the java code that something went wrong (see
attached patch).
I'm very well aware that this is just a workaround but no real solution. 
In my opinion it is not ok that Classpath fails the way it does. Even if
someone attempts to send data over a closed socket (what we think we are not
doing - at least not a the java level and the Sun JRE doesn't say anything like
that either) Classpath shouldn't and take down the whole VM with it. What I
would have expected is throwing some kind of
exception to let the java programmer know that there is something going wrong. 

Tom Winkler
address@hidden


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22797





reply via email to

[Prev in Thread] Current Thread [Next in Thread]