[Mono-bugs] [Bug 31177][Maj] Changed - Accept in Socket code has a race condition.

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
25 Sep 2002 02:53:09 -0000


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 miguel@ximian.com.

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

--- shadow/31177	Tue Sep 24 22:47:18 2002
+++ shadow/31177.tmp.13111	Tue Sep 24 22:53:09 2002
@@ -2,13 +2,13 @@
 Product: Mono/Runtime
 Version: unspecified
 OS: other
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Major
 Component: misc
 AssignedTo: dick@ximian.com                            
 ReportedBy: miguel@ximian.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -54,6 +54,38 @@
 in <0x00055> 00 System.Net.Sockets.Socket:Bind (System.Net.EndPoint)
 in <0x00028> 00 System.Net.Sockets.TcpListener:.ctor (System.Net.IPEndPoint)
 in <0x0008d> 00 Mono.ASP.Server:Start ()
 in <0x00487> 00 Mono.ASP.Server:Main (string[])
 
 Now, the issue
+
+------- Additional Comments From miguel@ximian.com  2002-09-24 22:53 -------
+Further information, this is from an strace that failed:
+
+[pid  8829] socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 10
+[pid  8827] <... rt_sigprocmask resumed> [RTMIN], 8) = 0
+[pid  8829] sendmsg(4, {msg_name(0)=NULL,
+msg_iov(1)=[{"\1\0\0\0\7\0\0\0\0\0\0\0\260\243#@*\217\f@
+\370\177\277"..., 40}], msg_controll\en=0, msg_flags=0}, 0x4000
+<unfinished ...>
+[pid  8827] gettimeofday( <unfinished ...>
+[pid  8829] <... sendmsg resumed> )     = 40
+[pid  8827] <... gettimeofday resumed> {1032922244, 820722}, NULL) = 0
+[pid  8829] recv(4,  <unfinished ...>
+[pid  8827] rt_sigprocmask(SIG_SETMASK, [RTMIN],  <unfinished ...>
+[pid  8829] <... recv resumed>
+"\1\0\0\0\7\0\0\0\216\7\0\0\1\0\0\0\220\361\377\277", 20, 0x4000) = 20
+[pid  8827] <... rt_sigprocmask resumed> NULL, 8) = 0
+[pid  8829] setsockopt(10, SOL_SOCKET, SO_REUSEADDR, [1], 4
+<unfinished ...>
+[pid  8827] gettimeofday( <unfinished ...>
+[pid  8829] <... setsockopt resumed> )  = 0
+[pid  8827] <... gettimeofday resumed> {1032922244, 820989}, NULL) = 0
+[pid  8829] bind(10, {sin_family=AF_INET, sin_port=htons(0),
+sin_addr=inet_addr("0.0.0.0")}}, 16 <unfinished ...>
+[pid  8827] rt_sigprocmask(SIG_BLOCK, NULL,  <unfinished ...>
+[pid  8829] <... bind resumed> )        = 0
+[pid  8827] <... rt_sigprocmask resumed> [RTMIN], 8) = 0
+[pid  8829] accept(10,  <unfinished ...>
+[pid  8827] rt_sigprocmask(SIG_UNBLOCK, [RTMIN],  <unfinished ...>
+[pid  8829] <... accept resumed> 0, NULL) = -1 EINVAL (Invalid argument)
+