-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
srvEnableNotification causes ctrulib to hang on exit #410
Comments
Worker functions can now be cancelled. Starting SRV has been commented out (for now) due to a libctru bug causing insane shutdown times when using it (see devkitPro/libctru#410) Also added a tab to some code in config. Just a style change, no code edits here.
I don't see how this could possibly be a libctru bug. To me it looks like some conflict between SRV notifications and APT (quite unsurprisingly). I'm not sure SRV notifications are meant to be used by anything other than sysmodules. It might help to look at the source code of the sm sysmodule for clues. |
Not a bug, it's how PM works. Look at this code: https://github.com/LumaTeam/Luma3DS/blob/master/sysmodules/pm/source/termination.c#L102 If you don't have notifications enabled, PM will kill your process ASAP, otherwise it'll wait until timeout. If you do have notifications enabled, you're supposed to handle notification 0x100 (termination notification which you don't have to subscribe to). It looks like APT is using a 20s timeout. |
Consider the following code:
This simple program takes, from a rough "Mississippi" timer, about 18.5 seconds to exit. Commenting out
srvEnableNotification
allows an exit as fast as you would expect. In a practical application it varies. I haven't seen it go any further than a whole minute, but some testers have complained that it takes several minutes to exit (???)Doing some debugging, I found the following information about this hang, as provided through the following GDB info:
These are the only two threads still alive, everything else has closed out. After talking with profi200 and yellows8 on IRC we couldn't figure anything out, which leads me to conclude that this is a bug in libctru. Here are the logs: https://pastebin.com/GxAaPvSq
The text was updated successfully, but these errors were encountered: