Opened 4 years ago

Closed 4 years ago

#21045 closed defect (wontfix)

Silent crash at 80% Bootstrap Tor OSX10.4

Reported by: downie Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version: Tor:
Severity: Normal Keywords: OSX Tiger 10.4
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


Since upgrading to Tor, Tor crashes on my OSX10.4 machine at 80% bootstrap.
Some debug-level lines:

Dec 20 23:58:45.000 [notice] Bootstrapped 80%: Connecting to the Tor network
Dec 20 23:58:46.000 [info] connection_ap_make_link(): Making internal direct tunnel to [scrubbed]:443 ...
Dec 20 23:58:46.000 [debug] connection_add_impl(): new conn type Socks, socket -1, address (Tor_internal), n_conns 5.
Dec 20 23:58:46.000 [info] connection_ap_make_link(): ... application connection created and linked.
Dec 20 23:58:46.000 [debug] connection_add_impl(): new conn type Directory, socket -1, address, n_conns 6.

Those are the last four entries in the log.

This is a bridge/client, with some exit node restrictions: torrc

ControlPort 9051
ExcludeNodes Qwerty,freeMe69,JustANode,AIVD,MIVD,afe5ab469c027cf3deec72ae6873ba62ae735414,dc914d754b27e1a0f196330bec599bc9d640f30c
ExitPolicy reject *:*
HashedControlPassword 16:xxxxxxx
Nickname xxxxxxxxxxx
ORPort auto
ExtORPort auto
BridgeRelay 1
ServerTransportPlugin obfs3 exec /usr/bin/obfsproxy managed
StrictNodes 1
ExcludeExitNodes {gb}

It was compiled thusly:

$ unset LDFLAGS
$ CFLAGS="-O -g -mmacosx-version-min=10.4 -arch ppc"
$ ./configure --prefix=/Library/Tor --with-libevent-dir=/opt/local --with-openssl-dir=/opt/local --disable-dependency-tracking CC="gcc-4.0"
$ make

I noticed lots of warnings about shadow declarations and implicit truncation from 64 bit to 32 bit.

Console.log says (and this looks more like the time I started Tor rather than when it crashed):

Dec 20 23:42:25 Power-Mac-G4 crashdump[2083]: tor crashed
Dec 20 23:42:25 Power-Mac-G4 crashdump[2083]: crash report written to: /Users/tor/Library/Logs/CrashReporter/tor.crash.log
Host Name:      xxxxxxxxxx
Date/Time:      2016-12-20 23:42:13.859 +0000
OS Version:     10.4.11 (Build 8S165)
Report Version: 4

Command: tor
Path:    /usr/bin/tor
Parent:  bash [2081]

Version: ??? (???)

PID:    2082
Thread: 0

Exception:  EXC_BAD_INSTRUCTION (0x0002)
Code[0]:    0x00000002
Code[1]:    0x0120a4e0

Thread 0 Crashed:
0   libcrypto.1.0.0.dylib       0x0120a4e0 OPENSSL_ppc64_probe + 0
1   libcrypto.1.0.0.dylib       0x0120a744 OPENSSL_cpuid_setup + 196
2   libcrypto.1.0.0.dylib       0x012a6724 OPENSSL_add_all_algorithms_noconf + 20
3   tor                         0x00121360 crypto_early_init + 64 (crypto.c:3355)
4   tor                         0x0000493c tor_init + 188 (main.c:2782)
5   tor                         0x00005e30 tor_main + 80 (main.c:3461)
6   tor                         0x00002250 main + 16 (tor_main.c:35)
7   tor                         0x00001e4c _start + 760
8   tor                         0x00001b50 start + 48

Thread 0 crashed with PPC Thread State 64:
  srr0: 0x000000000120a4e0 srr1: 0x000000000208f030                        vrsave: 0x0000000000000000
    cr: 0x24000222          xer: 0x0000000000000004   lr: 0x000000000120a744  ctr: 0x00000000900019c0
    r0: 0x0000000000000000   r1: 0x00000000bffff1b0   r2: 0x000000000000001a   r3: 0x0000000000000000
    r4: 0x0000000000000000   r5: 0x000000000120a738   r6: 0x0000000001365d98   r7: 0x00000000000000ff
    r8: 0x0000000001365d84   r9: 0x00000000fffff927  r10: 0x000000000000000e  r11: 0x0000000022000222
   r12: 0x00000000900019c0  r13: 0x0000000000000000  r14: 0x0000000000000000  r15: 0x0000000000000000
   r16: 0x0000000000000000  r17: 0x0000000000000000  r18: 0x0000000000000000  r19: 0x0000000000000000
   r20: 0x00000000bffff884  r21: 0x000000000000000c  r22: 0x0000000000000000  r23: 0x0000000000000000
   r24: 0x0000000000000000  r25: 0x000000000000000c  r26: 0x0000000000201330  r27: 0x00000000bffff8b8
   r28: 0x00000000bffff884  r29: 0x00000000bffff320  r30: 0x000000000136a688  r31: 0x000000000120a688

Binary Images Description:
    0x1000 -   0x1f5fff tor     /usr/bin/tor
  0x607000 -   0x618fff libz.1.dylib    /opt/local/lib/libz.1.dylib
  0x61c000 -   0x64efff libevent-2.0.5.dylib    /opt/local/lib/libevent-2.0.5.dylib
  0x65b000 -   0x6abfff libssl.1.0.0.dylib      /opt/local/lib/libssl.1.0.0.dylib
 0x1205000 -  0x1351fff libcrypto.1.0.0.dylib   /opt/local/lib/libcrypto.1.0.0.dylib
0x8fe00000 - 0x8fe52fff dyld 46.16      /usr/lib/dyld
0x90000000 - 0x901bcfff libSystem.B.dylib       /usr/lib/libSystem.B.dylib
0x90214000 - 0x90219fff libmathCommon.A.dylib   /usr/lib/system/libmathCommon.A.dylib
0x91434000 - 0x9143ffff libgcc_s.1.dylib        /usr/lib/libgcc_s.1.dylib

Not too much detail in the body of the ticket I hope.

Child Tickets

Change History (6)

comment:1 Changed 4 years ago by nickm

OSX 10.4 on PPC, huh? Wow!

These two together make me think that your openssl might be doing something weird:

Exception:  EXC_BAD_INSTRUCTION (0x0002)
Thread 0 Crashed:
0   libcrypto.1.0.0.dylib       0x0120a4e0 OPENSSL_ppc64_probe + 0
1   libcrypto.1.0.0.dylib       0x0120a744 OPENSSL_cpuid_setup + 196

comment:2 Changed 4 years ago by downie

Openssl is MacPorts 1.0.2j_0 - the latest. Do you suggest going back a version? Will I need to recompile Tor?

comment:3 Changed 4 years ago by nickm

I am afraid I don't know! Honestly, this is something that I don't personally have the hardware to test. It looks like OPENSSL is doing something questionable in OPENSSL_ppc64_probe that triggers an exception from your CPU, but I don't know enough about PPC assembly and compatibility to figure out what it might be.

Maybe try compiling your own openssl to see if that helps?

Oh. And when you build Tor with "make V=1", do the compiler flags look right for PPC?

comment:4 Changed 4 years ago by downie

I don't know what would be the 'right' flags - the CFLAGS above were given to me by someone on the mailing list, and have worked for every previous version.

My previous Tor was; it worked with and was compiled with this openssl 1.0.2j_0.

comment:5 Changed 4 years ago by downie

Compiling with gcc-4.2 worked (I was prompted to disable 'stack protection' whatever that is (What does it protect it from? Bears?) so hope that's ok). Something in the new Tor is incompatible with gcc-4.0. Something to do with those 'redundant declarations'?

comment:6 Changed 4 years ago by nickm

Milestone: Tor: unspecified
Resolution: wontfix
Status: newclosed

Probably not the redundant declarations business -- more likely, openssl has started relying on some GCC feature that gcc-4.0 got wrong.

Note: See TracTickets for help on using tickets.