[or-cvs] We got an obscure report of an assert error on a windows To...

arma at seul.org arma at seul.org
Tue Jun 6 00:06:54 UTC 2006


Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	connection_edge.c dns.c cpuworker.c 
Log Message:
We got an obscure report of an assert error on a windows Tor server with
connection_add being called with socket = -1. The only places I can see
where that happen would be if our tor_socketpair succeeds but it hands
back negative values for some of its file descriptors. Perhaps this will
produce more useful assert errors next time.


Index: connection_edge.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/connection_edge.c,v
retrieving revision 1.400
retrieving revision 1.401
diff -u -p -d -r1.400 -r1.401
--- connection_edge.c	3 Jun 2006 21:47:26 -0000	1.400
+++ connection_edge.c	6 Jun 2006 00:06:52 -0000	1.401
@@ -1398,6 +1398,9 @@ connection_ap_make_bridge(char *address,
     return -1;
   }
 
+  tor_assert(fd[0] >= 0);
+  tor_assert(fd[1] >= 0);
+
   set_socket_nonblocking(fd[0]);
   set_socket_nonblocking(fd[1]);
 

Index: dns.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/dns.c,v
retrieving revision 1.189
retrieving revision 1.190
diff -u -p -d -r1.189 -r1.190
--- dns.c	5 Jun 2006 23:01:22 -0000	1.189
+++ dns.c	6 Jun 2006 00:06:52 -0000	1.190
@@ -941,6 +941,9 @@ spawn_dnsworker(void)
     return -1;
   }
 
+  tor_assert(fdarray[0] >= 0);
+  tor_assert(fdarray[1] >= 0);
+
   /* log_fn(LOG_NOTICE,"Before spawn: fdarray @%d has %d:%d",
             (int)fdarray, fdarray[0],fdarray[1]); */
 

Index: cpuworker.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/cpuworker.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -p -d -r1.102 -r1.103
--- cpuworker.c	18 Apr 2006 19:48:06 -0000	1.102
+++ cpuworker.c	6 Jun 2006 00:06:52 -0000	1.103
@@ -329,6 +329,9 @@ spawn_cpuworker(void)
     return -1;
   }
 
+  tor_assert(fdarray[0] >= 0);
+  tor_assert(fdarray[1] >= 0);
+
   fd = fdarray[0];
   spawn_func(cpuworker_main, (void*)fdarray);
   log_debug(LD_OR,"just spawned a cpu worker.");



More information about the tor-commits mailing list