macOS Catalina testgui segfault libdyld.dylib stack_not_16_byte_aligned_error #138
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi#138
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I built the hidapi and testgui on macOS Catalina, when I launch the TestGUI app, it halts with the following debug info
Process: hidapi-testgui [99735]
Path: /Users/USER/Downloads/*/TestGUI.app/Contents/MacOS/hidapi-testgui
Identifier: us.signal11.hidtestgui
Version: 1.0
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: hidapi-testgui [99735]
User ID: 501
Date/Time: 2020-01-21 16:29:47.519 -0800
OS Version: Mac OS X 10.15.2 (19C57)
Report Version: 12
Bridge OS Version: 3.0 (14Y906)
Anonymous UUID: F53BEB53-80E0-55AC-99A8-F1D3BFFB00E4
Sleep/Wake UUID: CDAFBF1B-7E33-46E1-962F-31426BDCCAC8
Time Awake Since Boot: 2800000 seconds
Time Since Wake: 190000 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [99735]
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libdyld.dylib 0x00007fff691872be stack_not_16_byte_aligned_error + 0
1 ??? 0x0000600003598a50 0 + 105553172466256
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000001438 rbx: 0x000000000000008c rcx: 0x0000000000000070 rdx: 0x0000000000000001
rdi: 0x0000600003598a50 rsi: 0x000000000000000c rbp: 0x0000600003598a50 rsp: 0x00007ffee5da11a8
r8: 0x0000000000000195 r9: 0x0000000000000070 r10: 0x00007fbd948026e8 r11: 0x000000010a044030
r12: 0x0000000000000006 r13: 0x0000000000000070 r14: 0x0000000000000018 r15: 0x0000000000000400
rip: 0x00007fff691872be rfl: 0x0000000000010202 cr2: 0x000000010b28b908
Logical CPU: 4
Error Code: 0x00000000
Trap Number: 13
I found some other folks having the similar issue in other projects and they suggest that adding -fno-stack-check to CFLAGS is a workaround, but I dont know where to add it.
Try here: https://github.com/libusb/hidapi/blob/master/testgui/Makefile.mac#L17
Yep, I had actually tried that. The line now looks like
CFLAGS=-I../hidapi -Wall -g -c
fox-config --cflags-fno-stack-checkAnd I did make clean make make install in that directory. It still fails with the same error. Am I applying it correctly? How to verify what CLFAGs are used by the compiler?
have you been explicitly specifying the makefile, i.e.:
make -f Makefile.mac?Ah I was not, now I have done it and I see the g++ cflags are correct. Unfortunately it still hangs up in the same way.
It likely means that you need to rebuild Fox Toolkit with a specified flag, which is out of this conversation scope
instead, I'd suggest try using
hidtestconsole app, or https://github.com/todbot/hidapitesterI built with Xcode 10 under Mojave and all is fine with the result under Catalina.
Hi @hstriepe, would you mind sharing your Xcode project? (and the process by which you're aquiring/compiling fox-toolkit) Perhaps we could add it to the
macdirectory to help Mac folk out.@todbot I built from command line per instructions:
Copy the testgui app back to Catalina, which also has xquartzx installed. Launch quartz before testgui
Ah okay so you are compiling in Mojave, not Catalina. I didn't notice that. Apologies.
one day I'll find time and replace FOX-based UI with Qt-based one, it will make it so much easier
We’re using qt, not always a panacea.
Cheers,
-- Harald
I am trying out the test gui with Mac Mini M1 (Apple Silicon, Big Sur) and the app seems to run fine. I built using Homebrew (x86-64,not native M1). Install fox under Homebrew before the build, and then install xquartz before running the test-gui app.
However, sending invalid requests will cause the system to hang (macOS crash and automatically reboot).
Build log under my Mac Mini M1.
It runs fine. I will close the issue for now. Please reopen if you can reproduce the issue with latest homebrew version of fox and hidapi.
x86_64 build is also fine.
https://github.com/mcuee/hidapi/releases
x64 build binary, tested under my Mac Mini M1.
The above method will build a working hidapi-testgui under ARM64 but the TestGUI.app will not work under ARM64.
x86_64 version of TestGUI.app will work fine.
More discussions here:
https://github.com/libusb/hidapi/issues/151