- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 267
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
build with -O generate "Bus error: 10" #2888
Comments
This is almost certainly a duplicate of your other issue, just depending on what random garbage address you get. Quoting from https://forums.developer.apple.com/thread/70950:
Or wait, is that your code crashing instead of LDC itself? |
This is my code crashing from macOSX x86-64, random and not always repeat. |
Sounds like optimization is screwing something up, if it's really not hitting at all on unoptimized builds. These sporadic issues are really hard to track down, best we can offer is that you will have to use lldb to try to get a feel for where in your code it's happening and see if you can produce a minimized testcase. |
Yes, I only see this error with -O, I will paste here if I get minimized test case. Right now I use it without -O, the bad side is the binary tree search not near half the performance compare with -O. |
When build with -O, the code can random run into "Bus error: 10"
remove -O, all work fine.
this is the lldb report:
thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x100711e88)
frame #0: 0x0000000100711e88
-> 0x100711e88: fildll (%rax,%rax)
0x100711e8c: addl %eax, (%rax)
0x100711e8e: addb %al, (%rax)
0x100711e90: sbbb %bl, (%rdi)
LDC - the LLVM D compiler (1.12.0):
based on DMD v2.082.1 and LLVM 7.0.0
built with LDC - the LLVM D compiler (1.12.0)
Default target: x86_64-apple-darwin17.6.0
Host CPU: skylake
The text was updated successfully, but these errors were encountered: