[Mono-bugs] [Bug 63169][Cri] New - Networkstream async read write segfault on connection loss

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 16 Aug 2004 14:46:48 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jeroen@asselman.com.

http://bugzilla.ximian.com/show_bug.cgi?id=63169

--- shadow/63169	2004-08-16 14:46:48.000000000 -0400
+++ shadow/63169.tmp.22189	2004-08-16 14:46:48.000000000 -0400
@@ -0,0 +1,160 @@
+Bug#: 63169
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: Gentoo,  Clean Kernel 2.6.7
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Critical
+Component: packaging
+AssignedTo: duncan@ximian.com                            
+ReportedBy: jeroen@asselman.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Networkstream async read write segfault on connection loss
+
+Description of Problem:
+When using NetworkStream.BeginRead and NetworkStream.EndRead mono segfaults
+when the remote end disconnected.
+
+Steps to reproduce the problem:
+1. Create a simple tcp client which connects to a server. 
+2. With the TCPClient initiate a beginRead. And associate a callback handler
+3. Without sending additional data have the server close the connection.
+
+Actual Results:
+Segfault
+
+Expected Results:
+SocketException (is what I get with MS .net v 1.1)
+
+How often does this happen? 
+Always
+
+Additional Information:
+I rebuild mono with debugging information and produced the following
+backtrace with
+thread apply all
+
+
+(gdb) bt
+#0  0x40c5dcc9 in __sigsetjmp () from /lib/libc.so.6
+Cannot access memory at address 0x42154fe8
+(gdb) bt full
+#0  0x40c5dcc9 in __sigsetjmp () from /lib/libc.so.6
+No symbol table info available.
+Cannot access memory at address 0x42154fe8
+(gdb) thread apply all bt
+
+Thread 5 (process 12085):
+#0  0xffffe410 in ?? ()
+#1  0xbffff0d8 in ?? ()
+#2  0x0000003f in ?? ()
+#3  0x00000000 in ?? ()
+#4  0x40c00f05 in pthread_cond_timedwait@@GLIBC_2.3.2 () from
+/lib/libpthread.so.0
+#5  0x4012e014 in _wapi_handle_wait_signal_handle (handle=0xfffffffc) at
+handles.c:1510
+#6  0x4013d4de in WaitForSingleObjectEx (handle=0x8, timeout=4294967295,
+alertable=0) at wait.c:109
+#7  0x4013dc65 in WaitForMultipleObjectsEx (numobjects=1,
+handles=0x8107588, waitall=1, timeout=4294967295, alertable=0) at wait.c:434
+#8  0x400f30a8 in mono_thread_manage () at threads.c:1274
+#9  0x400cf9a2 in mono_runtime_exec_managed_code (domain=0xfffffffc,
+main_func=0xfffffffc, main_args=0xfffffffc) at object.c:1456
+#10 0x400886df in mono_main (argc=1, argv=0xbffff424) at driver.c:800
+#11 0x08048f2b in main (argc=-4, argv=0xfffffffc) at main.c:6
+
+Thread 4 (process 12087):
+#0  0xffffe410 in ?? ()
+#1  0x418b28c8 in ?? ()
+#2  0x00000041 in ?? ()
+#3  0x00000000 in ?? ()
+#4  0x40c00f05 in pthread_cond_timedwait@@GLIBC_2.3.2 () from
+/lib/libpthread.so.0
+#5  0x4012e014 in _wapi_handle_wait_signal_handle (handle=0xfffffffc) at
+handles.c:1510
+#6  0x4013d4de in WaitForSingleObjectEx (handle=0x3, timeout=4294967295,
+alertable=1) at wait.c:109
+---Type <return> to continue, or q <return> to quit---
+#7  0x400e263d in finalizer_thread (unused=0x0) at gc.c:575
+#8  0x400f3d9a in start_wrapper (data=0x80e3420) at threads.c:253
+#9  0x4013d128 in timed_thread_start_routine (args=0x80e3438) at
+timed-thread.c:135
+#10 0x401575d3 in GC_start_routine (arg=0x8090d60) at pthread_support.c:1184
+#11 0x40bfe1bc in start_thread () from /lib/libpthread.so.0
+#12 0x40ce81ba in clone () from /lib/libc.so.6
+
+Thread 3 (process 12088):
+#0  0xffffe410 in ?? ()
+#1  0x41f3d6c4 in ?? ()
+#2  0x401b45f8 in __JCR_LIST__ () from /usr/lib/libmono.so.0
+#3  0x41f3d68c in ?? ()
+#4  0x40c038e8 in connect () from /lib/libpthread.so.0
+#5  0x40138b7e in _wapi_connect (handle=16, serv_addr=0x8204cb0,
+addrlen=16) at sockets.c:352
+#6  0x400f6656 in ves_icall_System_Net_Sockets_Socket_Connect_internal
+(sock=4294966784, sockaddr=0xfffffe00, error=0x41f3d73c) at socket-io.c:1096
+#7  0x41f500a1 in ?? ()
+#8  0x00000018 in ?? ()
+#9  0x0809e0f0 in ?? ()
+#10 0x41f3d73c in ?? ()
+#11 0x08107210 in ?? ()
+#12 0x081071f8 in ?? ()
+#13 0x081fa7e0 in ?? ()
+#14 0x0809e0f0 in ?? ()
+---Type <return> to continue, or q <return> to quit---
+#15 0x0809e120 in ?? ()
+#16 0x0809e0f0 in ?? ()
+#17 0x41f3d728 in ?? ()
+#18 0x41f5007c in ?? ()
+#19 0x41f3d74c in ?? ()
+#20 0x41f4ffea in ?? ()
+#21 0x00000018 in ?? ()
+#22 0x0809e0f0 in ?? ()
+#23 0x41f3d73c in ?? ()
+#24 0x00000000 in ?? ()
+#25 0x080f69f0 in ?? ()
+#26 0x080f62b8 in ?? ()
+#27 0x401b45f8 in __JCR_LIST__ () from /usr/lib/libmono.so.0
+#28 0x41f3d770 in ?? ()
+#29 0x41f4fed0 in ?? ()
+#30 0x080f47a8 in ?? ()
+#31 0x0809e120 in ?? ()
+#32 0x41f3d774 in ?? ()
+#33 0x416af1b4 in ?? ()
+#34 0x080f47a8 in ?? ()
+#35 0x0809e110 in ?? ()
+#36 0x080f47a8 in ?? ()
+#37 0x41f3d7bc in ?? ()
+---Type <return> to continue, or q <return> to quit---
+#38 0x41f4fe0a in ?? ()
+#39 0x080f62b8 in ?? ()
+#40 0x0809e120 in ?? ()
+#41 0x41f3d928 in ?? ()
+#42 0x401b45f8 in __JCR_LIST__ () from /usr/lib/libmono.so.0
+#43 0x416aee99 in ?? ()
+#44 0x08148968 in ?? ()
+#45 0x08107210 in ?? ()
+#46 0x081071f8 in ?? ()
+#47 0x08148968 in ?? ()
+#48 0x401b45f8 in __JCR_LIST__ () from /usr/lib/libmono.so.0
+#49 0x41f3d928 in ?? ()
+#50 0x080f69f0 in ?? ()
+#51 0x41f3d87c in ?? ()
+#52 0x416aee99 in ?? ()
+#53 0x00000000 in ?? ()
+#54 0x080f62b8 in ?? ()
+#55 0x41f3d928 in ?? ()
+#56 0x41f3d87c in ?? ()
+#57 0x416aee99 in ?? ()
+#58 0x0809fc80 in ?? ()
+#59 0x0809e120 in ?? ()
+#60 0x40127f92 in LeaveCriticalSection (section=0x18) at
+critical-sections.c:171
+Previous frame inner to this frame (corrupt stack?)
+---Type <return> to continue, or q <return> to quit---
+#0  0x40c5dcc9 in __sigsetjmp () from /lib/libc.so.6