[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs