Opened 3 weeks ago

Last modified 3 days ago

#23690 merge_ready defect

Assertion *buf_flushlen <= buf->datalen failed

Reported by: Felixix Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.1.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: 028-backport 029-backport 030-backport 031-backport
Cc: ahf Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description (last modified by arma)

Up with Tor 321a since 4 days 19 hours ( before Tor 315a ) like 2 sister relays. On FreeBSD. Lost all circuits and files on error:

Sep 26 18:59:37.000 [err]
tor_assertion_failed_: Bug: src/common/buffers.c:651:
buf_flush_to_socket: Assertion *buf_flushlen <= buf->datalen failed; aborting.
Sep 26 18:59:37.000 [err] Bug:
Assertion *buf_flushlen <= buf->datalen failed in
buf_flush_to_socket at src/common/buffers.c:651. Stack trace:
0x11a2bf8 <log_backtrace+0x48> at /usr/local/bin/tor
0x11bd6f7 <tor_assertion_failed_+0x97> at /usr/local/bin/tor
0x11a421a <buf_flush_to_socket+0x22a> at /usr/local/bin/tor
0x10774eb <tor_main+0x24bb> at /usr/local/bin/tor
0x801b37d3e <event_base_assert_ok_nolock_+0xbce> at /usr/local/lib/
0x801b33cfe <event_base_loop+0x50e> at /usr/local/lib/
0x1072d15 <do_main_loop+0x575> at /usr/local/bin/tor
0x1075119 <tor_main+0xe9> at /usr/local/bin/tor
0x1070b69 <main+0x19> at /usr/local/bin/tor
0x1070a61 <_start+0x1a1> at /usr/local/bin/tor
2017-09-26_18-59-00, time of error:
  load averages:  1.03,  0.94,  0.78    ... 4 cores
  NMBC: 2959/42587/45546/2035262 mbuf clusters in use (current/cache/total/max)
  Mem: 2236M Active, 1269M Inact, 7162M Wired, 61M Cache, 21G Free
  Swap: 4096M Total, 4096M Free

[1] Attachment buf_flush_to_socket_Assertion_failed.tar.gz

[2] and following.


Child Tickets

Attachments (1)

buf_flush_to_socket_Assertion_failed.tar.gz (12.3 KB) - added by Felixix 3 weeks ago.

Download all attachments as: .zip

Change History (13)

Changed 3 weeks ago by Felixix

comment:1 Changed 3 weeks ago by ahf

Cc: ahf added
Keywords: added

comment:2 Changed 3 weeks ago by arma

Component: - Select a componentCore Tor/Tor
Milestone: Tor: 0.3.2.x-final

comment:3 Changed 3 weeks ago by arma

Description: modified (diff)

comment:4 Changed 3 weeks ago by arma

I suspect #23149.

comment:5 in reply to:  4 Changed 3 weeks ago by nickm

Replying to arma:

I suspect #23149.

I'm not 100% sure there. Looking at a diff between buffers.c in 0.3.1 and 0.3.2, I see no changes to flush_chunk() (except changing the name of a function that it calls), and no changes to flush_buf() (except renaming it). I've looked for any changes in the call-sites, and I don't see any (except the rename as mentioned above).

Oh, wait! I think I see it! Single_conn_free_bytes!

One sec; writing a patch.

comment:6 Changed 3 weeks ago by nickm

Owner: set to nickm
Status: newaccepted

Fix in branch bug23690_028.

Additional prevention in bug23690_additional_032.

comment:7 Changed 3 weeks ago by nickm

Status: acceptedneeds_review

comment:8 Changed 3 weeks ago by ahf

Status: needs_reviewmerge_ready

Both patches looks good to me. Would be nice to get these merged to master.

comment:9 Changed 3 weeks ago by nickm

Keywords: 028-backport 029-backport 030-backport 031-backport added; removed
Milestone: Tor: 0.3.2.x-finalTor: 0.3.1.x-final

Merged them in master. Marking bug23690_028 for possible backport to earlier versions if we don't find any breakage.

comment:10 Changed 4 days ago by arma

Looks like #23885 might be an instance of this bug on

comment:11 Changed 4 days ago by arma

Summary: [err] buffers.c:651: buf_flush_to_socketAssertion *buf_flushlen <= buf->datalen failed

comment:12 Changed 3 days ago by nickm

Yes, I think it probably is.

Note: See TracTickets for help on using tickets.