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

Crash on opening the ledger-backed wallet #6097

Closed
vorot93 opened this issue Apr 17, 2020 · 5 comments
Closed

Crash on opening the ledger-backed wallet #6097

vorot93 opened this issue Apr 17, 2020 · 5 comments
Labels
bug 🐞 hw-generic related to hardware wallets, irrespective of manufacturer

Comments

@vorot93
Copy link

vorot93 commented Apr 17, 2020

  • macOS Catalina 10.15.4
  • Latest git master
  • mainnet
  • Ledger Nano S, unlocked.
Crashed Thread:        36

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [5135]

Application Specific Information:
*** Unable to insert wake up port into port set. (15) ***

Thread 36 Crashed:
0   com.apple.CoreFoundation      	0x00007fff31ce7958 __CFRunLoopFindMode + 1029
1   com.apple.CoreFoundation      	0x00007fff31cfc3d8 CFRunLoopAddSource + 289
2   com.apple.framework.IOKit     	0x00007fff34ac83e3 IOHIDDeviceScheduleWithRunLoop + 74
3   com.apple.framework.IOKit     	0x00007fff34acc584 __IOHIDManagerDeviceApplier + 527
4   com.apple.framework.IOKit     	0x00007fff34a94fee __IOHIDManagerDeviceAdded + 769
5   com.apple.framework.IOKit     	0x00007fff34a94bf1 __IOHIDManagerSetDeviceMatching + 347
6   hid.cpython-37m-darwin.so     	0x00000001183032d3 hid_enumerate + 371
7   hid.cpython-37m-darwin.so     	0x00000001183029f0 __pyx_pw_3hid_1enumerate + 656
8   Python                        	0x000000010ca6c802 _PyMethodDef_RawFastCallKeywords + 722
9   Python                        	0x000000010ca6bad9 _PyCFunction_FastCallKeywords + 41
10  Python                        	0x000000010cb41b20 call_function + 656
11  Python                        	0x000000010cb3e5fe _PyEval_EvalFrameDefault + 27262
12  Python                        	0x000000010ca6bfbd function_code_fastcall + 237
13  Python                        	0x000000010cb3e820 _PyEval_EvalFrameDefault + 27808
14  Python                        	0x000000010cb4292d _PyEval_EvalCodeWithName + 3021
15  Python                        	0x000000010ca6ba99 _PyFunction_FastCallKeywords + 217
16  Python                        	0x000000010cb41b9c call_function + 780
17  Python                        	0x000000010cb3e5de _PyEval_EvalFrameDefault + 27230
18  Python                        	0x000000010ca6bfbd function_code_fastcall + 237
19  Python                        	0x000000010cb3e820 _PyEval_EvalFrameDefault + 27808
20  Python                        	0x000000010cb4292d _PyEval_EvalCodeWithName + 3021
21  Python                        	0x000000010ca6ba99 _PyFunction_FastCallKeywords + 217
22  Python                        	0x000000010cb41b9c call_function + 780
23  Python                        	0x000000010cb3e5de _PyEval_EvalFrameDefault + 27230
24  Python                        	0x000000010cb4292d _PyEval_EvalCodeWithName + 3021
25  Python                        	0x000000010ca6b597 _PyFunction_FastCallDict + 455
26  Python                        	0x000000010ca6cb03 _PyObject_Call_Prepend + 131
27  Python                        	0x000000010ca6bbf8 PyObject_Call + 136
28  Python                        	0x000000010cbbd8e2 partial_call + 194
29  Python                        	0x000000010ca6b8ff _PyObject_FastCallKeywords + 575
30  Python                        	0x000000010cb41b95 call_function + 773
31  Python                        	0x000000010cb3e698 _PyEval_EvalFrameDefault + 27416
32  Python                        	0x000000010cb4292d _PyEval_EvalCodeWithName + 3021
33  Python                        	0x000000010ca6b597 _PyFunction_FastCallDict + 455
34  Python                        	0x000000010cb3e820 _PyEval_EvalFrameDefault + 27808
35  Python                        	0x000000010ca6bfbd function_code_fastcall + 237
36  Python                        	0x000000010ca6cb03 _PyObject_Call_Prepend + 131
37  Python                        	0x000000010ca6bbf8 PyObject_Call + 136
38  Python                        	0x000000010cb3e820 _PyEval_EvalFrameDefault + 27808
39  Python                        	0x000000010cb4292d _PyEval_EvalCodeWithName + 3021
40  Python                        	0x000000010ca6ba99 _PyFunction_FastCallKeywords + 217
41  Python                        	0x000000010cb41b9c call_function + 780
42  Python                        	0x000000010cb3e5fe _PyEval_EvalFrameDefault + 27262
43  Python                        	0x000000010ca6bfbd function_code_fastcall + 237
44  Python                        	0x000000010cb41b9c call_function + 780
45  Python                        	0x000000010cb3e5de _PyEval_EvalFrameDefault + 27230
46  Python                        	0x000000010ca6bfbd function_code_fastcall + 237
47  Python                        	0x000000010ca6cb03 _PyObject_Call_Prepend + 131
48  Python                        	0x000000010ca6bbf8 PyObject_Call + 136
49  Python                        	0x000000010cbd2827 t_bootstrap + 71
50  Python                        	0x000000010cb85cf9 pythread_wrapper + 25
51  libsystem_pthread.dylib       	0x00007fff6bcd6109 _pthread_start + 148
52  libsystem_pthread.dylib       	0x00007fff6bcd1b8b thread_start + 15

Thread 36 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000039  rbx: 0x0000700014b70d60  rcx: 0x9a0a9bc1391600a5  rdx: 0x0000000000000000
  rdi: 0x0000000000000000  rsi: 0x00007fff3203a195  rbp: 0x0000700014b70fa0  rsp: 0x0000700014b70d00
   r8: 0x0000700014b70a50   r9: 0x0000700014b70cd0  r10: 0x00007fff3203a161  r11: 0xfffff000e2b36bff
  r12: 0x00007fa04cab18b0  r13: 0x000000000000e713  r14: 0x00007fa04ed3fe70  r15: 0x00007fff9278c2dc
  rip: 0x00007fff31ce7958  rfl: 0x0000000000010206  cr2: 0x0000700014b6ec98
  
Logical CPU:     6
Error Code:      0x00000000
Trap Number:     6
@SomberNight
Copy link
Member

Thanks for the report. In terms of user interaction, when does the crash happen exactly?

@vorot93
Copy link
Author

vorot93 commented Apr 17, 2020

After selecting hardware wallet and clicking 'next'.

@SomberNight SomberNight added bug 🐞 hw-generic related to hardware wallets, irrespective of manufacturer labels Apr 17, 2020
@SomberNight
Copy link
Member

I believe this is due to hidapi not being thread-safe, and us using it from multiple threads.

See e.g.
signal11/hidapi#205 (comment)
libusb/hidapi#45
signal11/hidapi#45 (comment)
signal11/hidapi#414 (comment)

This seems to be a fundamental issue that's been there for a long time.
It surfaced now as I was moving some code between threads recently in e.g. 4b1d835, which I guess made it more likely to trigger a crash.

@SomberNight
Copy link
Member

Please try latest HEAD (b1d2389) or newer.

sidhujag pushed a commit to syscoin/electrumsys that referenced this issue Apr 18, 2020
@vorot93
Copy link
Author

vorot93 commented Apr 18, 2020

Works now.

@vorot93 vorot93 closed this as completed Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 hw-generic related to hardware wallets, irrespective of manufacturer
Projects
None yet
Development

No branches or pull requests

2 participants