Assertion *buf_flushlen <= buf->datalen failed after circuit_handle_oom() has been called
Oct 16 05:15:23.000 [notice] We're low on memory. Killing circuits with over-long queues. (This behavior is controlled by MaxMemInQueues.)
Oct 16 05:15:23.000 [notice] Removed 16912 bytes by killing 102 circuits; 0 circuits remain alive. Also killed 2 non-linked directory connections.
Oct 16 05:19:23.000 [notice] We're low on memory. Killing circuits with over-long queues. (This behavior is controlled by MaxMemInQueues.)
Oct 16 05:19:23.000 [notice] Removed 37392 bytes by killing 28 circuits; 0 circuits remain alive. Also killed 2 non-linked directory connections.
Oct 16 05:19:23.000 [err] tor_assertion_failed_(): Bug: ../src/or/buffers.c:801: flush_buf: Assertion *buf_flushlen <= buf->datalen failed; aborting. (on Tor 0.3.1.7 )
Oct 16 05:19:23.000 [err] Bug: Assertion *buf_flushlen <= buf->datalen failed in flush_buf at ../src/or/buffers.c:801. Stack trace: (on Tor 0.3.1.7 )
Oct 16 05:19:23.000 [err] Bug: /usr/bin/tor(log_backtrace+0x42) [0x55e352e8bd92] (on Tor 0.3.1.7 )
Oct 16 05:19:23.000 [err] Bug: /usr/bin/tor(tor_assertion_failed_+0x8c) [0x55e352ea4a0c] (on Tor 0.3.1.7 )
Oct 16 05:19:23.000 [err] Bug: /usr/bin/tor(flush_buf+0x2a7) [0x55e352dddb07] (on Tor 0.3.1.7 )
Oct 16 05:19:23.000 [err] Bug: /usr/bin/tor(+0x108b5b) [0x55e352e28b5b] (on Tor 0.3.1.7 )
Oct 16 05:19:23.000 [err] Bug: /usr/bin/tor(connection_handle_write+0x2e) [0x55e352e2975e] (on Tor 0.3.1.7 )
Oct 16 05:19:23.000 [err] Bug: /usr/bin/tor(+0x4e18e) [0x55e352d6e18e] (on Tor 0.3.1.7 )
Oct 16 05:19:23.000 [err] Bug: /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5(event_base_loop+0x7fc) [0x7fcce52ba3dc] (on Tor 0.3.1.7 )
Oct 16 05:19:23.000 [err] Bug: /usr/bin/tor(do_main_loop+0x2a4) [0x55e352d6f4d4] (on Tor 0.3.1.7 )
Oct 16 05:19:23.000 [err] Bug: /usr/bin/tor(tor_main+0x1c35) [0x55e352d72e55] (on Tor 0.3.1.7 )
Oct 16 05:19:23.000 [err] Bug: /usr/bin/tor(main+0x19) [0x55e352d6abd9] (on Tor 0.3.1.7 )
Oct 16 05:19:23.000 [err] Bug: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fcce3e44b45] (on Tor 0.3.1.7 )
Oct 16 05:19:23.000 [err] Bug: /usr/bin/tor(+0x4ac29) [0x55e352d6ac29] (on Tor 0.3.1.7 )
It happened over a new exit relay (low consensus) with 2GB memory.