Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable backtrace on mac #1258

Merged
merged 3 commits into from
Mar 26, 2018

Conversation

conanoc
Copy link
Contributor

@conanoc conanoc commented Mar 22, 2018

fix #840

backtrace module does not support mac. So, disable crash log if BACKTRACE_SUPPORTED is 0.

The reason why this patch fix #840 is not fully identified. On mac, SIGSEGV and SIGBUS signal happens after jsonrpc only when signal handlers are registered with sigaction().

@isghe
Copy link
Contributor

isghe commented Mar 22, 2018

@lvaccaro @gabridome @Sjors
ACK 56ef036

@Sjors
Copy link
Contributor

Sjors commented Mar 22, 2018

Awesome, this works for me on macOS. I'm now able to connect to peers and fund channels (master crashes on launch once I have some channels open).

@arowser
Copy link
Contributor

arowser commented Mar 23, 2018

Running ok on 10.12.4, but if run with lldb, show
`
2018-03-23T11:19:17.428Z lightningd(22701): Trying to guess public addresses...
2018-03-23T11:19:17.459Z lightningd(22701): Address 192.168.2.211:9735 is not routable
2018-03-23T11:19:17.467Z lightningd(22701): Failed to connect 30 socket: No route to host
2018-03-23T11:19:17.469Z lightningd(22701): testing /Users/danielaof/project/lightning/lightningd/lightning_channeld
2018-03-23T11:19:17.477Z lightningd(22701): testing /Users/danielaof/project/lightning/lightningd/lightning_closingd
2018-03-23T11:19:17.485Z lightningd(22701): testing /Users/danielaof/project/lightning/lightningd/lightning_gossipd
2018-03-23T11:19:17.492Z lightningd(22701): testing /Users/danielaof/project/lightning/lightningd/lightning_hsmd
2018-03-23T11:19:17.499Z lightningd(22701): testing /Users/danielaof/project/lightning/lightningd/lightning_onchaind
2018-03-23T11:19:17.508Z lightningd(22701): testing /Users/danielaof/project/lightning/lightningd/lightning_openingd
2018-03-23T11:19:17.569Z lightningd(22701): Client: Received message 11 from client
2018-03-23T11:19:17.594Z lightningd(22701): Client: Received message 9 from client
2018-03-23T11:19:17.595Z lightning_gossipd(22715): pid 22715, msgfd 13
2018-03-23T11:19:17.595Z lightningd(22701): Loaded 0 channels from DB
Waiting for /Users/danielaof/project/corebin/bitcoin-cli: Interrupted system call
Process 22701 stopped

  • thread Just want to say 'Thank You'. #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00007fffc80e7d42 libsystem_kernel.dylib__pthread_kill + 10 libsystem_kernel.dylib__pthread_kill:
    -> 0x7fffc80e7d42 <+10>: jae 0x7fffc80e7d4c ; <+20>
    0x7fffc80e7d44 <+12>: movq %rax, %rdi
    0x7fffc80e7d47 <+15>: jmp 0x7fffc80e0caf ; cerror_nocancel
    0x7fffc80e7d4c <+20>: retq
    (lldb) bt
  • thread Just want to say 'Thank You'. #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    • frame #0: 0x00007fffc80e7d42 libsystem_kernel.dylib__pthread_kill + 10 frame #1: 0x00007fffc81d55bf libsystem_pthread.dylibpthread_kill + 90
      frame fixed typos in pdf #2: 0x00007fffc804d420 libsystem_c.dylibabort + 129 frame #3: 0x0000000100015b97 lightningdfatal(fmt="Waiting for %s: %s") at log.c:593
      frame Missing OP_CSV in Figure 4 of the pdf #4: 0x0000000100001f1f lightningdwait_for_bitcoind(bitcoind=0x0000000100302000) at bitcoind.c:760 frame #5: 0x0000000100004340 lightningdsetup_topology(topo=0x00000001003027f0, timers=0x0000000100302270, poll_time=timerel @ 0x00007fff5fbff680, first_blocknum=101) at chaintopology.c:730
      frame Don't use u32 locktime internally. #6: 0x0000000100012f91 lightningdmain(argc=5, argv=0x00007fff5fbff778) at lightningd.c:372 frame #7: 0x00007fffc7fb9235 libdyld.dylibstart + 1
      frame Python implementation of onion routing spitball #8: 0x00007fffc7fb9235 libdyld.dylibstart + 1 (lldb)

`

@conanoc
Copy link
Contributor Author

conanoc commented Mar 24, 2018

yeah. I saw the same issue with lldb. But, it's not related with this patch. You could file a new issue for that.

@arowser
Copy link
Contributor

arowser commented Mar 25, 2018

Yes, it seems not related, and the issue have been addressed in #1093

@rustyrussell rustyrussell self-requested a review March 26, 2018 00:29
Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack a599399

ignoring dirty files in libwally-core is ugly, probably need a bug report there to improve their .gitignore?

@rustyrussell rustyrussell merged commit e7c8b95 into ElementsProject:master Mar 26, 2018
@laanwj
Copy link
Contributor

laanwj commented Mar 26, 2018

The reason why this patch fix #840 is not fully identified. On mac, SIGSEGV and SIGBUS signal happens after jsonrpc only when signal handlers are registered with sigaction().

What happens (see #840 (comment)) is that autodata (the library used for constructing RPC and other tables) uses SIGSEGV/SIGBUS on MacOSX and other BSDs to probe memory maps (in a subprocess). It registers its own handler for this, but apparently backtrace's handler also still triggers. This results in a logged error.

So this fix, removing backtrace, is overkill but it works. Another option would have been to disable backtrace handling just for autodata's subprocesses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal signal 11 received on Mac OS
6 participants