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
'Segmentation fault 11' on high sierra #105
Comments
interesting. I cant load cl-sdl2 from emacs under ccl, but the example working when launched from the terminal. |
made a test which uses
|
made executable with save and die, ran lldb on it. Got a stack trace
|
That log might be spurious ^^^ we dont get any output so possible that it's lldb and sbcl fighting |
in sdl2 |
changing |
Ok progress. If I revert all my tweaks to the event code and instead modify
This means no dock icon, no menus etc. but it works.... so now we need to find out why. What is it about sbcl and this that means this helps? |
worth noting that if I pumped events but didnt dequeue them I could still get a crash by right clicking the dock icon and clicking the app/window name this did something (focused it maybe?) and it segfaulted just like before. |
Im beaten for tonight, will get back into this another day |
been having this kind of problems (trying to use cepl) for quite some time, seems to me like it started after the latest MacOS update few weeks ago, new xcode etc... |
@gavocanov thanks, that's good to know, I saw the same and am glad Im not going crazy :p |
Im slow to learn here in mac-land. The logs from the crash are actually pretty good
|
I had hoped to see something weird in |
Hey..address sanitizer is actually pretty cool:
so we have a It's possible that some string mac apps always have set, isnt set under sbcl and we get this gnarly crash |
Could this be relevant? https://boringssl.googlesource.com/boringssl/+/63a0797ff247f13870b649c3f6239d80be202752 more info envoyproxy/envoy#1789 (comment) probably not, only sunos config of sbcl using posix_c_source |
https://answers.unrealengine.com/questions/754410/why-is-ue-crashing-when-i-attempt-to-launch.html includes call via |
So current theory is there is an image that mac's ui is trying to use and it's not set, so the path in null, and strstr causes crash... hmm not sure about this. The thread crashes with strstr being called on NULL pointer so that is correct, but where is that ptr from? it mentions |
https://answers.unrealengine.com/questions/715502/every-version-of-ue4-crashes-on-startup-after-upgr.html jesus, what if this is actually xcode related :| |
compiled SDL2 head with XCode 8.3.3 and seems to me it's the same crash log:
|
@gavocanov That's great info, thankyou. I really didn't want to downgrade to XCode8 so this is a relief |
For the record, as it's visible from the crash log, SBCL was compiled using gcc-7, just to rule-out compiler problems, SDL2 won't compile using it so I tried with XCode 8 (btw u can have 2 XCode version, no need to downgrade). I also tried with 3 different SBCL versions, since there was an SBCL release/update in the last few weeks also, but without any change in behaviour. I tried all the steps u mentioned here in this issue and I'm having exactly same results (dequeue:NO/YES, setActivationPolicy:NSApplicationActivationPolicyAccessory, CCL from terminal etc.). I think it's reasonable to rule out compiler probs, but it's very weird that ccl is working ok from the terminal. I started seeing those problems in any opengl example/app before I started wondering around SDL2, ie. I can't run any of the cl-glut-examples (some work in CCL from cmdline), trial, cepl, not only SDL2 based stuff. Maybe it's just a MacOS OpenGL threading problem after all ? Hope this helps... |
That's great work. I dont expect GL threading as we are on the main thread and GL doesn't mind what thread it is on (you just need to be consistent) the issue with mac is that any interaction with the window manager have to be done on the main thread. However if you do that wrong you get warnings or errors from mac itself (usually it terminates you program) |
FWIW I ran into the same exception* today using https://github.com/borodust/trivial-gamekit, trying to run the minimal example, so I'm not sure it's sdl2 specific. Annoying timing with the lisp game jam coming up! *:
|
If this is occurring with UE, GLFW, etc, and not specific to SDL2, or especially cl-sdl2, can we close this issue? |
@mfiano As you arent doing anything about this anyway I'd much rather you left this open. Wherever the source of the issue is it effects cl-sdl2 on the most popular lisp implementation. It sounds like it might be happening on other libraries so hopefully we can help them too. |
Just a quick drop for future investigations: https://gist.github.com/cbaggers/47b4467b57ea8ca4eca74cf621415b51 That's a smaller case that reproduces the error. This is not ready to be reported to any implementation or library, this is just a wip. We need to understand this and find out what the above is doing to the impls and whether the above code is even legal in macOS. The code was made by commenting out sdl2 code until I could find the minimal set of things that they do that cause the crash. |
Slightly modified from before to see what happened if we provided more setup code https://gist.github.com/cbaggers/f288572411e77d102d1527f96b7f298e |
I have a workaround that's not suitable for production but works, as long as the magic numbers do not change:
|
I put that workaround into SBCL. |
Thanks @stassats and all that looked into this. Feel free to re-open this issue if the problem persists. |
Assuming that this is related the the upgrade as I was using cl-sdl2 on mac regularly before this.
The text was updated successfully, but these errors were encountered: