Trac issueshttps://gitlab.torproject.org/legacy/trac/-/issues2020-06-13T14:34:23Zhttps://gitlab.torproject.org/legacy/trac/-/issues/11046Implement/Improve backtrace logging support2020-06-13T14:34:23ZNick MathewsonImplement/Improve backtrace logging supportThis is a parent ticket for issues about logging backtraces on crash, assertion, and so forth.This is a parent ticket for issues about logging backtraces on crash, assertion, and so forth.Tor: 0.2.5.x-finalhttps://gitlab.torproject.org/legacy/trac/-/issues/11047Use -fno-omit-frame-pointer or -fasynchronous-unwind-tables options to make b...2020-06-13T14:34:24ZNick MathewsonUse -fno-omit-frame-pointer or -fasynchronous-unwind-tables options to make backtraces work betterWith GCC, the implicit or explicit use of the "omit-frame-pointer" optimization can interfere with generating backtraces on some architectures. According to cypherpunks on #9299:
> Stack trace unreadable if FPO enabled in general or us...With GCC, the implicit or explicit use of the "omit-frame-pointer" optimization can interfere with generating backtraces on some architectures. According to cypherpunks on #9299:
> Stack trace unreadable if FPO enabled in general or used optimization options (then FPO applied selectively by compiler depends function's code) for x86 platform. It's not problem for x86_64 because GCC generates unwind tables there by default.
> If to enable unwind tables by "-fasynchronous-unwind-tables" then stack trace readable with any optimizations.
cypherpunks also notes that starting with GCC 4.6, -fomit-frame-pointer is on by default on several optimization levels.Tor: 0.2.5.x-finalhttps://gitlab.torproject.org/legacy/trac/-/issues/17808Tor doesn't produce a backtrace on gcc x86_64 on macOS2020-06-13T14:53:55ZteorTor doesn't produce a backtrace on gcc x86_64 on macOS```
$ gcc-mp-4.9 -v
Using built-in specs.
COLLECT_GCC=gcc-mp-4.9
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin15/4.9.3/lto-wrapper
Target: x86_64-apple-darwin15
Configured with: /opt/local/var/macports/build/_opt_local_v...```
$ gcc-mp-4.9 -v
Using built-in specs.
COLLECT_GCC=gcc-mp-4.9
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin15/4.9.3/lto-wrapper
Target: x86_64-apple-darwin15
Configured with: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc49/gcc49/work/gcc-4.9.3/configure --prefix=/opt/local --build=x86_64-apple-darwin15 --enable-languages=c,c++,objc,obj-c++,lto,fortran,java --libdir=/opt/local/lib/gcc49 --includedir=/opt/local/include/gcc49 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.9 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.9 --with-gxx-include-dir=/opt/local/include/gcc49/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --disable-isl-version-check --with-cloog=/opt/local --disable-cloog-version-check --enable-stage1-checking --enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --with-pkgversion='MacPorts gcc49 4.9.3_0+universal' --with-build-config=bootstrap-debug
Thread model: posix
gcc version 4.9.3 (MacPorts gcc49 4.9.3_0+universal)
Jacks-Mac:~ twilsonb$ clang-mp-3.7 -v
clang version 3.7.0 (tags/RELEASE_370/final)
Target: x86_64-apple-darwin15.2.0
Thread model: posix
```
```
$ src/test/test-bt-cl crash
============================================================ T= 1449767124
Tor died: Caught signal 11
0 test-bt-cl 0x0000000108b72178 crash_handler + 56
1 test-bt-cl 0x0000000108b780de attr_detached + 1374
```
```
$ src/test/test-bt-cl assert
Dec 11 04:05:41.826 [err] tor_assertion_failed_(): Bug: src/test/test_bt_cl.c:42: crash: Assertion 1 == 0 failed; aborting. (on Tor 0.2.7.6 )
Dec 11 04:05:41.826 [err] Bug: Assertion 1 == 0 failed in crash at src/test/test_bt_cl.c:42. Stack trace: (on Tor 0.2.7.6 )
Dec 11 04:05:41.826 [err] Bug: 0 test-bt-cl 0x0000000109fb7264 log_backtrace + 68 (on Tor 0.2.7.6 )
```Tor: unspecifiedhttps://gitlab.torproject.org/legacy/trac/-/issues/19535A can't-happen case for one-hop circuits actually can happen2020-06-13T15:29:47ZAndrea ShepardA can't-happen case for one-hop circuits actually can happenOn commit 4dc7b3ca2825741311b6b849ed109053c643ee23, using the controller EXTENDCIRCUIT command to create a new circuit like this:
`EXTENDCIRCUIT 0 0744F2AE098BAD9F1A0FEF109C01E621FB6A4600`
causes this log message:
```
Jun 30 12:50:44....On commit 4dc7b3ca2825741311b6b849ed109053c643ee23, using the controller EXTENDCIRCUIT command to create a new circuit like this:
`EXTENDCIRCUIT 0 0744F2AE098BAD9F1A0FEF109C01E621FB6A4600`
causes this log message:
```
Jun 30 12:50:44.000 [info] pathbias_should_count(): Bug: One-hop circuit has length 1. Path state is new. Circuit is a General-purpose client currently doing handshakes. (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] tor_bug_occurred_(): Bug: src/or/circpathbias.c:362: pathbias_should_count: This line should not have been reached. (Future instances of this warning will be silenced.) (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: Line unexpectedly reached at pathbias_should_count at src/or/circpathbias.c:362. Stack trace: (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post(log_backtrace+0x2f) [0x55f6e9] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post(tor_bug_occurred_+0x18e) [0x578780] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post() [0x4bcc40] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post(pathbias_count_build_attempt+0x23) [0x4bcd8d] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post(circuit_finish_handshake+0x1c) [0x4c2ea6] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post() [0x4dc1af] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post(command_process_cell+0xa2) [0x4db6ab] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post(channel_queue_cell+0x207) [0x4b1b32] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post(channel_tls_handle_cell+0x2b0) [0x4b79ea] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post() [0x50c28d] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post(connection_or_process_inbuf+0x141) [0x509038] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post() [0x4fd4c7] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post() [0x4fac08] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post(connection_handle_read+0x1d) [0x4fad32] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post() [0x43045c] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5(event_base_loop+0x7fc) [0x7ffff76883dc] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post() [0x4335ed] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post() [0x433753] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post(do_main_loop+0x41b) [0x43352e] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post(tor_main+0xfd) [0x43772b] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post(main+0x20) [0x42efd6] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7ffff6870b45] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
Jun 30 12:50:44.000 [warn] Bug: /home/andrea/tor/test/ticket18640/tor-1182ecb3127a6e67f8ff0c5fc0d28e0a3c25ba4b-post() [0x42eee9] (on Tor 0.2.9.0-alpha-dev 1182ecb3127a6e67)
```Tor: unspecified