We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4007 - SDL_init after SDL_quit triggers weird message
Summary: SDL_init after SDL_quit triggers weird message
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.1
Hardware: x86 macOS 10.12
: P2 minor
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-21 22:12 UTC by skaller
Modified: 2019-06-09 01:47 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description skaller 2017-12-21 22:12:58 UTC
I have a function which does some basic line drawing, which calls SDL_init to start and SDL_quit to finish. It creates a window to draw in. After the drawing is done, it waits for either a timeout of 15 seconds, or the user to quit by clicking the WM's close button. An event loop reads messages and terminates on seeing SDL_QUIT

This all works fine for a single call to the function. However if I call it twice I get these messages:

2017-12-22 08:42:01.772 flx_arun[7419:700714] IMKClient Stall detected, *please Report* your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_attributesForCharacterIndex:reply:) block performed very slowly (6.65 secs).

2017-12-22 08:42:01.772 flx_arun[7419:700714] IMKClient Stall detected, *please Report* your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_windowLevelWithReply:) block performed very slowly (4.64 secs).

The times mentioned here roughly agree with the 15 second delays. The delays are implemented by a spin loop implemented in C++ using a timed lock combined with a separate thread that monitors events using kqueue, that is, all done outside SDL.

Note, the SDL code actually works correctly. The program actually running is called "flx_arun". This program loads a dylib containing the application code, which loads a library providing SDL services as a dylib, which in turn loads SDL2 as a dylib.

Note: SDL_main() is never called. Nor is SDL_SetMainReady().

This is definitely a Mac OSX 10.12 issue. See also:

https://discussions.apple.com/thread/7367367
https://stackoverflow.com/questions/40997541/r-warnings-imkclient-stall-detected

So this is not a bug as such, rather the documentation is a bit weak explaining how SDL_init/SDL_quit/SDL_SetMainReady, etc interact. Any help on this appreciated.
Comment 1 Ryan C. Gordon 2019-05-18 18:48:55 UTC
Tagging a bunch of bugs with "target-2.0.10" so we have a clear list of things to address before a 2.0.10 release.

Please note that "addressing" one of these bugs might mean deciding to defer on it until after 2.0.10, or resolving it as WONTFIX, etc. This is just here to tell us we should look at it carefully, and soon.

If you have new information or feedback on this issue, this is a good time to add it to the conversation, as we're likely to be paying attention to this specific report in the next few days/weeks.

Thanks!

--ryan.