-
Notifications
You must be signed in to change notification settings - Fork 32
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
Mac Issues #10
Comments
Without having looked into it further, I'm as stumped as you. I didn't add the initial Mac support, but I assume it worked at some point. I do have a Mac now, so I'll be able to test it, but until I do, I'm totally in the dark! |
I got the same error in Clozure CL on Os X (el Capitan) but on sbcl everything seems to be OK. At least |
I'm using sbcl 1.2.16 installed from homebrew: This is SBCL 1.2.16, an implementation of ANSI Common Lisp. SBCL is free software, provided as is, with absolutely no warranty. Is that the same as you @alexzlov? Also, it does work for me up until I close the window and then I see that particular error. |
@codescrawl Here's a screenshot of mine: http://joxi.ru/krDlRV5Spdn3rp |
I just tried it out with SBCL 1.2.14 on Yosemite and curiously I ended up with the same error you got on CCL, @codescrawl, before the window even opens. The errors do suggest that both SBCL and CCL are trying to do something overly clever with threads. I haven't run into anything like this with GLFW in a single-threaded environment. Unfortunately, I don't have much time to look into this at the moment. Any fixes for this would be appreciated! |
Thanks for the information. I'm running Yosemite right now so it sounds like there is some mileage in upgrading to El Capitan. I'll be honest though my lisp skills are not good enough yet to help with a fix although I'd love to help. I'll tinker for a bit and see if I can find a way around though and report back if I discover anything useful. |
Ok, finally I've got some information. *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.' @codescrawl : you can use a hack like this: and the window example should run and work correctly |
Looks like there are two issues at we're seeing. The floating point error, and an error when glfw is initialized outside of the main thread. I'm running SBCL with threading support, and can reproduce both issues easily. When I run an example with Slime (which starts it a non-main thread) I get the latter error before any window is initialized. This is clearly an issue others have run into ( lispgames/cl-sdl2#29 ) and it seems difficult to work around in an elegant way, at least at the level of this library, as it would require implementation specific support like @alexzlov's example. Any suggestions in this direction are most welcome. I see the floating point error when running the |
@AlexCharlton May be it's possible to add a library such as https://github.com/Shinmera/trivial-main-thread as a dependency? I've tried it with the following code:
and everything worked fine. |
@alexzlov That's a good library to know about! Unfortunately, I don't feel like adding it straight to cl-glfw3 is the right move, as it's the kind of thing that needs to be applied to all graphics calls. Because of this, setting the thread is something that I feel should be done at a higher level, or things will just be confusing. I did just update the examples to take advantage of trivial-main-threads so that they can now run easily. @alexzlov @codescrawl I just pushed a branch https://github.com/AlexCharlton/cl-glfw3/tree/no-float-trap-restore that fixes the floating point issues that I've seen. Do you mind testing it and letting me know if it makes anything better or worse for you? Thanks! |
Hi Alex, I've tried this version from local projects and for some reason it now appears to be looking for libglfw.so rather than .dylib
I've compiled glfw3 from scratch as a dylib and it's now loading (with a change to glfw-bindings.lisp). I'll try and give it a test in a short while. |
OK, that definitely works for me in clozure 1.10 - thanks very much for that. The only change I had to make is show below in glfw-bindings.lisp (define-foreign-library (glfw) |
@codescrawl OK, that's great! Have you tried glfw3 installation with homebrew? I don't remember exactly, but it seems that I've made homebrew glfw installation and everything was ok. |
@codescrawl One small PS. If you don't consider using sbcl or other implementations, maybe you'll find more useful to make direct calls to libglfw3.dylib via native clozure's ffi generator? Although building ffigen4 is a little tricky I've had a success with it. |
OSX Sierra, SBCL, working fine with glfw from homebrew.
|
Hi - I came to cl-glfw3 by recommendation. Running sbcl 1.4.6 on macOS High Sierra 10.13.4. I don't see any window appearing when running the examples, just: TIA for any hints. |
Hi, I'm having a problem getting up and running on the mac with your library and I'd love to get to the bottom of this if possible as I'm keen to port the superbible 7 examples over as a learning exercise. I'm not a l33t lisper as I'm coming back to the language after a 20 year hiatus.
In sbcl I see the following floating-point-overflow error which looks pretty much the same as I've encountered running some glut examples.
To load "cl-glfw3-examples":
Load 1 ASDF system:
cl-glfw3-examples
; Loading "cl-glfw3-examples"
............
("cl-glfw3-examples")
debugger invoked on a FLOATING-POINT-OVERFLOW in thread
<THREAD "main thread" RUNNING {1002C74733}>:
arithmetic error FLOATING-POINT-OVERFLOW signalled
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
("bogus stack frame")
0]
At this point I have to exit sbcl to close the exec icon that appears in the dock. I can we the window rendered correctly however.
In ccl64 I get a different issue:
? (ql:quickload "cl-glfw3-examples")
To load "cl-glfw3-examples":
Load 1 ASDF system:
cl-glfw3-examples
; Loading "cl-glfw3-examples"
("cl-glfw3-examples")
? (cl-glfw3-examples:basic-window-example)
2015-10-08 13:14:05.733 dx86cl64[15465:315830] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /SourceCache/Foundation/Foundation-1154/Misc.subproj/NSUndoManager.m:340
2015-10-08 13:14:05.734 dx86cl64[15465:315830] +[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.
2015-10-08 13:14:05.735 dx86cl64[15465:315830](0 CoreFoundation 0x00007fff916dd03c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff9726076e objc_exception_throw + 43
2 CoreFoundation 0x00007fff916dce1a +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff9759299b -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 Foundation 0x00007fff9751464f +[NSUndoManager%28NSPrivate%29 _endTopLevelGroupings] + 156
5 AppKit 0x00007fff8ba6cb95 -[NSApplication run] + 756
6 libglfw3.dylib 0x00000000000dc85c _glfwPlatformCreateWindow + 1410
7 libglfw3.dylib 0x00000000000d920f glfwCreateWindow + 582
8 dx86cl64 0x000000000001b693 ffcall_return + 0)
2015-10-08 13:14:05.735 dx86cl64[15465:315830] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /SourceCache/Foundation/Foundation-1154/Misc.subproj/NSUndoManager.m:340
Unhandled exception 10 at 0x0, context->regs at #xb0299bd0
Exception occurred while executing foreign code
received signal 10; faulting address: 0x0
? for help
[15465] Clozure CL kernel debugger:
I'm stumped as to what I need to do to progress - do you have any ideas? I see that you have some darwin conditional statements in the code so assume you've managed to get something up and running in the past, is that correct?
Thanks in advance for help,
Colin
The text was updated successfully, but these errors were encountered: