Opened 3 years ago

Last modified 5 weeks ago

#17808 needs_information defect

Tor doesn't produce a backtrace on gcc x86_64 on macOS

Reported by: teor Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version: Tor: 0.2.7.6
Severity: Normal Keywords: tor-client tor-relay backtrace needs-analysis
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

$ 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 )

Child Tickets

TicketStatusOwnerSummaryComponent
#23250closeddgoulettor-0.3.0.10: test failure on NetBSDCore Tor/Tor
#27948closedteorBacktrace does not work on NetBSDCore Tor/Tor

Change History (17)

comment:1 Changed 3 years ago by teor

This issue also affects FreeBSD 10.1-p19 with clang version 3.4.1.

comment:2 Changed 3 years ago by nickm

Is this a regression from a previous Tor version?

comment:3 Changed 3 years ago by cypherpunks

Only way to produce a backtrace reliably is to use platform with glibc-based backtrace function and to build code by GCC.

In case of OS X, syslib's backtrace unwinds stack "manually", while GCC (with used -O2) guarantees to omit FP and to fail test.

In case of FreeBSD, libexecinfo using similar technique to obtain backtrace, and shouldn't work too, at least for GCC with used -O2? But seems like working for assert test and broken for crash test for lib's reasons only. (It really need to test and publish what output for GCC case and what output for clang case to sort stuff)

comment:4 Changed 3 years ago by cypherpunks

The FreeBSD builds on Jenkins are failing because the backtrace tests are failing on this.

comment:5 Changed 3 years ago by cypherpunks

I have opened #17892 to add more information to the test logs to make it easier to debug the Jenkins logs.

comment:6 Changed 3 years ago by nickm

This seems to be compiler-dependent and library-dependent, and not have much to do with Tor's actual behavior or use of backtrace. I'm putting this in needs_information to get this information:

  • Which compiler and version? Which OS and version?
  • Is this or is this not a regression?
  • What is the output in each case?

The best solution for the meantime I can find is to treat this failure as a "SKIP" on FreeBSD.

comment:7 Changed 3 years ago by nickm

Status: newneeds_information

The best solution for the meantime I can find is to treat this failure as a "SKIP" on FreeBSD.

Created #18204 for this.

comment:8 Changed 3 years ago by nickm

Milestone: Tor: 0.2.8.x-finalTor: 0.2.9.x-final

These seem like features, or like other stuff unlikely to be possible this month. Bumping them to 0.2.9

comment:9 Changed 3 years ago by nickm

Points: ?large?

comment:10 Changed 3 years ago by isabela

Milestone: Tor: 0.2.9.x-finalTor: 0.2.???

tickets market to be removed from milestone 029

comment:11 Changed 2 years ago by teor

Milestone: Tor: 0.2.???Tor: 0.3.???

Milestone renamed

comment:12 Changed 2 years ago by nickm

Keywords: tor-03-unspecified-201612 added
Milestone: Tor: 0.3.???Tor: unspecified

Finally admitting that 0.3.??? was a euphemism for Tor: unspecified all along.

comment:13 in reply to:  6 Changed 21 months ago by teor

Replying to nickm:

This seems to be compiler-dependent and library-dependent, and not have much to do with Tor's actual behavior or use of backtrace. I'm putting this in needs_information to get this information:

  • Which compiler and version? Which OS and version?

gcc 4.9, 5, 6 on macOS 10.11 - 10.12 on x86_64
(clang and gcc i386 are not affected)

  • Is this or is this not a regression?

Unlikely, because the default compiler on macOS has been clang for ages.

  • What is the output in each case?
BAD
Feb 24 13:20:34.917 [err] tor_assertion_failed_(): Bug: src/test/test_bt_cl.c:43: crash: Assertion 1 == 0 failed; aborting. (on Tor 0.3.1.0-alpha-dev efa5bbaba07d20d1)
Feb 24 13:20:34.917 [err] Bug: Assertion 1 == 0 failed in crash at src/test/test_bt_cl.c:43. Stack trace: (on Tor 0.3.1.0-alpha-dev efa5bbaba07d20d1)
Feb 24 13:20:34.917 [err] Bug:     0   test-bt-cl                          0x00000001038d63c4 log_backtrace + 68 (on Tor 0.3.1.0-alpha-dev efa5bbaba07d20d1)
BAD

============================================================ T= 1487902834
Tor died: Caught signal 11
0   test-bt-cl                          0x000000010e4b42aa crash_handler + 58
1   ???                                 0x0000000000000130 0x0 + 304
-158318
Exit 1

The best solution for the meantime I can find is to treat this failure as a "SKIP" on FreeBSD.

macOS still suffers from this, but we can't skip the entire platform, because clang and i386 both work fine.

comment:14 Changed 18 months ago by nickm

Keywords: tor-03-unspecified-201612 removed

Remove an old triaging keyword.

comment:15 Changed 17 months ago by nickm

Keywords: tor-client tor-relay backtrace needs-analysis old-system added
Points: ?large?

comment:16 Changed 17 months ago by teor

Keywords: old-system removed
Summary: Tor 0.2.7.6 doesn't produce a backtrace on gcc 4.9.3 on OS X 10.11.2Tor doesn't produce a backtrace on gcc x86_64 on macOS

Tor Browser is now using clang to build for macOS, so maybe we could document this for other packagers, and then leave this as a nice-to-do.

And this is a current issue, not just an old thing.

comment:17 Changed 5 weeks ago by teor

This issue also affects NetBSD-8.99.25/amd64, see #27948.

Note: See TracTickets for help on using tickets.