bugDotGNU Portable.NET - Bugs: bug #11980, ilrun crashes using sockets with...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #11980: ilrun crashes using sockets with broken connection (HIGH CRITICAL)

Submitted by:  Heiko Weiss <brubbel>
Submitted on:  Mon 14 Feb 2005 08:17:06 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Mon 21 Feb 2005 12:57:26 PM UTC, comment #17:

Fixed in CVS 02/21/2005

Klaus Treichel <ktreichel>
Project Administrator
Mon 21 Feb 2005 07:15:55 AM UTC, comment #16:

The last patch didn't contain my changes for the sendto function. The change is contained in this patch (kt-050221.patch).
There is no such option to prevent signals for the recv function.

Klaus Treichel <ktreichel>
Project Administrator
Mon 21 Feb 2005 05:44:50 AM UTC, comment #15:

Patch works. Thx Klaus.

but I think the flag should be in the "sento" method too.
And what about recv ? May recv send SIGPIPE too? I guess so.

Heiko Weiss <brubbel>
Project Member
Sun 20 Feb 2005 09:46:18 AM UTC, comment #14:

I've attached a patch (kt-050220.patch) to fix this bug. Please try it to make sure it doesn't break the pnet build on an other system.

Klaus Treichel <ktreichel>
Project Administrator
Sat 19 Feb 2005 04:32:51 PM UTC, comment #13:

i forgot to mention the change is in function ILSysIOSocketSend.

Klaus Treichel <ktreichel>
Project Administrator
Sat 19 Feb 2005 04:13:30 PM UTC, comment #12:

try the following change in support/socket.c:
change
return (ILInt32)(send((int)(ILNativeInt)sockfd, msg, len, flags));
to
return (ILInt32)(send((int)(ILNativeInt)sockfd, msg, len, flags | MSG_NOSIGNAL));

this lets the function not to send a signal on error.
EPIPE will still be returned if an error occures.

Klaus Treichel <ktreichel>
Project Administrator
Sat 19 Feb 2005 03:29:14 PM UTC, comment #11:

tried gdb too.

same result as Klaus.
the program receives SIGPIPE, Broken pipe.

Backtrace shows:

#0 send () from /lib/tls/libthread.so.0
#1 ffi_call_SYSV () at src/x86/sysv.S:59
#2 ffi_raw_call (...) at src/x86/ffi.c:515

...

tried ilrun without-ffi support, but no luck.
now backtrace shows:

#0 send // as above
#1 marshal_ipjpiii
#2 _ILVCMInterpreter at cvm_call.c:784

Heiko Weiss <brubbel>
Project Member
Sat 19 Feb 2005 12:28:14 PM UTC, comment #10:

last comment was from me, Brubbel.
forgot to login.

Heiko Weiss <brubbel>
Project Member
Sat 19 Feb 2005 12:24:20 PM UTC, comment #9:

Klaus,

well -> U got it.
The program must not end. That's the bug I have too.
The program should receive an exception and try sending again. Ilrun must not end!
So I'm lucky that someone else has this bug.
But who can have a look to fix that?

I tried kernel 2.6.10, same result.

Anonymous
Sat 19 Feb 2005 11:17:10 AM UTC, comment #8:

running the client in gdb gives me the following information after shutting down the server on SuSE 9.2:

Program received signal SIGPIPE, Broken pipe.
[Switching to Thread 1075789952 (LWP 9546)]
0x400d5fac in send () from /lib/tls/libpthread.so.0

When running the program normal it just ends.

Klaus Treichel <ktreichel>
Project Administrator
Fri 18 Feb 2005 11:39:14 AM UTC, comment #7:

Unable to duplicate on my box, using pnet 0.6.12,
Mandrake 10.1, Kernel 2.6.8.1-20mdk.
I get the same result like Deryk Robosson.

Erich Kitzmüller <ammoq>
Fri 18 Feb 2005 10:04:47 AM UTC, comment #6:

Broke tzhe problem down:
the last call which is made is in support/socket.c
... ILSysIOSocketSend(...)
{
/* to here all ok */
return (ILInt32)(send((int)(ILNativeInt)sockfd, msg, len flags ));
}

now I'm on my end.
Might that be a kernel problem?

Heiko Weiss <brubbel>
Project Member
Fri 18 Feb 2005 08:33:10 AM UTC, comment #5:

Same test results as advised in comment #3.

Deryk Robosson <drobosson>
Project Member
Fri 18 Feb 2005 08:19:09 AM UTC, comment #4:

Still have problems using the latest pnet (cvs 18.02.05).
Modified my testprogram, see attachements.
Plz retry with this.

Heiko Weiss <brubbel>
Project Member
Wed 16 Feb 2005 02:00:29 PM UTC, comment #3:

Unable to duplicate on my Linux box here (kernel 2-6.10) using the test case and above instructions, latest CVS build. When stopping the server the client bails and a "broken pipe" response is emitted.

Deryk Robosson <drobosson>
Project Member
Wed 16 Feb 2005 05:52:53 AM UTC, comment #2:

Hi Erich,

no, your quickhack did not help me.
But your bug seems to be similar.

Heiko Weiss <brubbel>
Project Member
Wed 16 Feb 2005 12:54:23 AM UTC, comment #1:

Although it looks different, this might be the same bug I reported in
https://savannah.gnu.org/bugs/?func=detailitem&item_id=11627

Can you try if the described workaround (look for "ERICH quickhack") solves this problem too?

Erich Kitzmüller <ammoq>
Mon 14 Feb 2005 08:17:06 AM UTC, original submission:

1. I'm using a client socket connecting to a server.
2. After connecting creating an NetworkStream from the client.
3. Sending data to the server via NetWorkStream.
4. If server shuts down the connection (server ist stopped) I get an exception -> ok.
5. Now I call Socket.Connected -> says still connected (not ok).
6. Next time trying to send data to the socket ilrun crashes.

Codesnips:

sock = new Socket( ... );
sock.Connect( IPEndPoint(...) );
stream = new NetworkStream( sock );
if( sock.Connected )
stream.Write( ... ); // ok

not stop the server

if( sock.Connected ) // returns true
stream.write( ... ); // throws exception -> ok

if( sock.Connected ) // still returns true !!! -> not ok
stream.write( ... ); // ilrun crashes

***********************
ilrun crashes !!!!!

Heiko Weiss <brubbel>
Project Member

 

Attached Files
file #2600:  kt-050221.patch added by ktreichel (2KiB - text/x-patch - complete patch that also changes sendto)
file #2597:  kt-050220.patch added by ktreichel (2KiB - text/x-patch - patch to fix this bug)
file #2584:  Class1.cs added by brubbel (2KiB - text/plain - crash sample)
file #2555:  Class1.cs added by brubbel (2KiB - text/plain - sample wich crashes)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 6 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 21 Feb 2005 12:57:26 PM UTCktreichelStatusNone=>Fixed
  Open/ClosedOpen=>Closed
Mon 21 Feb 2005 07:15:55 AM UTCktreichelAttached File-=>Added kt-050221.patch, #2222
Sun 20 Feb 2005 09:46:18 AM UTCktreichelAttached File-=>Added kt-050220.patch, #2219
Fri 18 Feb 2005 08:19:09 AM UTCbrubbelAttached File-=>Added Class1.cs, #2209
Mon 14 Feb 2005 09:13:35 AM UTCbrubbelAttached File-=>Added Class1.cs, #2193

Back to the top


Powered by Savane 3.1-cleanup1