Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#4946 closed defect (fixed)

Tor master (nearly 0.2.3.11-alpha) fails to build on Windows

Reported by: arma Owned by:
Priority: High Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-client
Cc: nickm Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

https://buildbot.torproject.org/tor-master/builders/master-win32/builds/416/steps/shell_3/logs/stdio
says

cc1.exe: warnings being treated as errors
dns.c: In function 'purge_expired_resolves':
dns.c:457:9: error: comparison between signed and unsigned integer expressions
dns.c: In function 'dns_resolve_impl':
dns.c:684:3: error: comparison between signed and unsigned integer expressions
dns.c: In function 'assert_all_pending_dns_resolves_ok':
dns.c:852:7: error: comparison between signed and unsigned integer expressions
dns.c: In function 'dns_cancel_pending_resolve':
dns.c:958:5: error: comparison between signed and unsigned integer expressions

These are lines like

        tor_assert(pend->conn->_base.s == TOR_INVALID_SOCKET);

Looks related to commit 6e8c2a3e, from work on #4533.

Child Tickets

Change History (6)

comment:1 Changed 9 years ago by arma

Sebastian suggests

diff --git a/src/or/dns.c b/src/or/dns.c
index b74b056..ddf9841 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -454,7 +454,7 @@ purge_expired_resolves(time_t now)
         pend = resolve->pending_connections;
         resolve->pending_connections = pend->next;
         /* Connections should only be pending if they have no socket. */
-        tor_assert(pend->conn->_base.s == TOR_INVALID_SOCKET);
+        tor_assert(!SOCKET_OK(pend->conn->_base.s));
         pendconn = pend->conn;
         connection_edge_end(pendconn, END_STREAM_REASON_TIMEOUT);
         circuit_detach_stream(circuit_get_by_edge_conn(pendconn), pendconn);
@@ -681,7 +681,7 @@ dns_resolve_impl(edge_connection_t *exitconn, int is_resolve,
   uint8_t is_reverse = 0;
   int r;
   assert_connection_ok(TO_CONN(exitconn), 0);
-  tor_assert(exitconn->_base.s == TOR_INVALID_SOCKET);
+  tor_assert(!SOCKET_OK(exitconn->_base.s));
   assert_cache_ok();
   tor_assert(oncirc);
 
@@ -849,7 +849,7 @@ assert_all_pending_dns_resolves_ok(void)
          pend;
          pend = pend->next) {
       assert_connection_ok(TO_CONN(pend->conn), 0);
-      tor_assert(pend->conn->_base.s == TOR_INVALID_SOCKET);
+      tor_assert(!SOCKET_OK(pend->conn->_base.s));
       tor_assert(!connection_in_array(TO_CONN(pend->conn)));
     }
   }
@@ -955,7 +955,7 @@ dns_cancel_pending_resolve(const char *address)
     pend->conn->_base.state = EXIT_CONN_STATE_RESOLVEFAILED;
     pendconn = pend->conn;
     assert_connection_ok(TO_CONN(pendconn), 0);
-    tor_assert(pendconn->_base.s == TOR_INVALID_SOCKET);
+    tor_assert(!SOCKET_OK(pendconn->_base.s));
     if (!pendconn->_base.marked_for_close) {
       connection_edge_end(pendconn, END_STREAM_REASON_RESOLVEFAILED);
     }

comment:2 Changed 9 years ago by arma

Status: newneeds_review

comment:3 Changed 9 years ago by Sebastian

branch bug4946 has a proper commit

comment:4 Changed 9 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Merged it. Does windows build for you with this fix?

comment:5 Changed 8 years ago by nickm

Keywords: tor-client added

comment:6 Changed 8 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.