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

Re: [tor-bugs] #21312 [Obfuscation/Snowflake]: snowflake-client is pegged at 100% cpu



#21312: snowflake-client is pegged at 100% cpu
-----------------------------------+--------------------------------
 Reporter:  arlolra                |          Owner:  arlolra
     Type:  defect                 |         Status:  needs_revision
 Priority:  High                   |      Milestone:
Component:  Obfuscation/Snowflake  |        Version:
 Severity:  Major                  |     Resolution:
 Keywords:                         |  Actual Points:
Parent ID:                         |         Points:
 Reviewer:                         |        Sponsor:
-----------------------------------+--------------------------------

Comment (by arlolra):

 > Here's a server-webrtc segfault from gdb.

 From the timeline in comment:29, maybe it's a race between the datachannel
 close on the server and reading from the OR (I'm assuming the logs never
 make it because they're async and the segfaults prevents them from being
 written).

 You can try something like,

 {{{
 --- a/server-webrtc/snowflake.go
 +++ b/server-webrtc/snowflake.go
 @@ -52,7 +52,9 @@ func (c *webRTCConn) Read(b []byte) (int, error) {
  func (c *webRTCConn) Write(b []byte) (int, error) {
         // log.Printf("webrtc Write %d %+q", len(b), string(b))
         log.Printf("Write %d bytes --> WebRTC", len(b))
 -       c.dc.Send(b)
 +       if c.dc != nil } {
 +               c.dc.Send(b)
 +       }
         return len(b), nil
  }

 @@ -127,6 +129,7 @@ func makePeerConnectionFromOffer(sdp
 *webrtc.SessionDescription, config *webrtc.
                 dc.OnClose = func() {
                         log.Println("OnClose channel")
                         pw.Close()
 +                       conn.dc = nil
                         pc.DeleteDataChannel(dc)
                 }
                 dc.OnMessage = func(msg []byte) {
 }}}

 The client has something similar where if the transport isn't available to
 be written to, it buffers the data.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/21312#comment:32>
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