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

sdl2-examples:basic-test kills slime-repl on macOS #89

Closed
ajpaon opened this issue May 29, 2017 · 6 comments
Closed

sdl2-examples:basic-test kills slime-repl on macOS #89

ajpaon opened this issue May 29, 2017 · 6 comments
Labels

Comments

@ajpaon
Copy link

ajpaon commented May 29, 2017

I'm running CCL:

> (sdl2-examples:basic-test)

The example runs and displays properly. I'm able to close the window with ESC. But then the slime repl stops responding. Inferior lisp is still running, though, and I'm able to rerun the example from there.

I also tried something I saw in a different issue:

> (sdl:make-this-thread-main #'sdl2-examples:basic-test)

But now I'm no longer able to close the window. Inferior lisp has the following warning:

WARNING: nextEventMatchingMask should only be called from the Main Thread! This will throw an exception in the future.

@Davidbhodge
Copy link

If its any comfort, its not just you. Running CCL in terminal, not in slime, has a similar result, I see the warning message , a single mouse movement message and then it freezes and I am unable to close the window. Killing the lisp process is the only way out. I think its a slime problem - the sdl issue #23
suggests

(bt:make-thread (lambda () (swank:create-server :port 4005 :dont-close t)))
(sdl2:make-this-thread-main (lambda () (sdl2.kit:start)))

in a terminal and then slime-connect to that. I will try that and see if it works

@zacharycarter
Copy link

I have the same issue that @ajpaon is reporting

@clarkenciel
Copy link

same issue. here's the trace fwiw:

Using SDL Library Version: 2.0.4
Setting up window/gl.
Opening game controllers.
Beginning main loop.
2017-11-09 09:20:07.816 sbcl[75566:1267072] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'nextEventMatchingMask should only be called from the Main Thread!'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fffa2d6e2cb __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x00007fffb7b8648d objc_exception_throw + 48
	2   AppKit                              0x00007fffa0f59e82 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 4480
	3   libSDL2.dylib                       0x000000000079240c Cocoa_PumpEvents + 211
	4   libSDL2.dylib                       0x000000000072fca5 SDL_PumpEvents_REAL + 23
	5   libSDL2.dylib                       0x000000000072fd20 SDL_WaitEventTimeout_REAL + 76
	6   ???                                 0x0000000022ba2d4b 0x0 + 582626635
	7   ???                                 0x0000000022bebb79 0x0 + 582925177
	8   ???                                 0x0000000022beb5fc 0x0 + 582923772
	9   ???                                 0x0000000022bc39d2 0x0 + 582760914
	10  ???                                 0x0000000022bc424a 0x0 + 582763082
	11  ???                                 0x00000000227ab231 0x0 + 578466353
)
libc++abi.dylib: terminating with uncaught exception of type NSException
fatal error encountered in SBCL pid 75566(tid 0xb0006000):
SIGABRT received.

macOS Sierra 10.12.6

@mfiano mfiano added the osx label Nov 21, 2017
@mfiano
Copy link
Contributor

mfiano commented Jun 14, 2018

Is this still an issue?

@mfiano mfiano closed this as completed Jun 20, 2018
@alex-eg
Copy link
Contributor

alex-eg commented Dec 8, 2019

Yes, I have the same issues on Sly on Mac OS 10.15.1

Issuing

(sdl2:make-this-thread-main #'sdl2-examples:basic-test)

results in

SDL Error: NSWindow drag regions should only be invalidated on the Main Thread!

It doesn't happen if I run the loop from the terminal.

Edit: I'm on sbcl.

@andi23rosca
Copy link

@alex-eg and any others who have problems, it's cause slime is creating many threads.
You can fix the issue by forcing swank to run in a single thread.

What I've done is create the file ~/.swank.lisp and put in it

(setf swank:*communication-style* nil)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

7 participants