[tor-bugs] #6225 [Tor Relay]: "get_string_from_pipe: Assertion len>0 failed; aborting." in log_from_pipe() for tor-fw-helper

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Sat Jun 23 14:21:41 UTC 2012


#6225: "get_string_from_pipe: Assertion len>0 failed; aborting." in
log_from_pipe() for tor-fw-helper
-----------------------+----------------------------------------------------
 Reporter:  asn        |          Owner:                    
     Type:  defect     |         Status:  new               
 Priority:  normal     |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Relay  |        Version:                    
 Keywords:             |         Parent:  #5557             
   Points:             |   Actualpoints:                    
-----------------------+----------------------------------------------------
 The changes of #5557 introduced this assertion failure when reading the
 tor-fw-helper exit status in `tor_check_port_forwarding()`.

 I think the problem was introduced because the new
 `format_helper_exit_status()` appends a newline and a NUL to the message.
 When `fgets()` in `get_string_from_pipe()` loops and reads that message,
 it first stops reading at the newline, and then on the second iteration it
 reads the NUL which is a zero-length string.

 Maybe `format_helper_exit_status()` should return the length of useful
 data it wrote, and then only `write()` that many bytes to stdout in
 `tor_spawn_background()`?

 (You can reproduce this by using `PortForwarding` with a wrong
 `PortForwardingHelper` path.)

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6225>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list