-
Notifications
You must be signed in to change notification settings - Fork 11
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
Game sometimes hangs forever after loading audio when loading a case #31
Comments
A more complete callstack is as follows: #0 0xffffffff gray_raster_render () It seems as though it gets stuck for some in TTF_RenderUTF8_Blended trying to render a new glyph. |
I'm not sure if it fix that particular bug, but try to comment out |
Hmm, possible, I suppose (I'll try it and see), but that seems unlikely; the only time that that has any effect is when we're reloading sprites, which I don't think we actually even do anymore (we previously needed to do that in response to a fullscreen change). The callstack here seems pretty unrelated to that. |
I've spent some time with debugger and finally got some results. First, I got a corrupted text few times, similar to described in this message, Here is screenshots: screenshot 1, screenshot 2. I had not been able to fully reproduce these bugs, but after code revision I found that one MLIFont ptr can be used from different threads, and MLIFont and MRUCache classes is not thread safe. Аfter I wrap necessary functions in MLIFont in SDL_SemWait/SDL_SemPost, it looks like crashes and text corruptions are gone. Or I'm just unlucky enough. |
Seems like here is several different bugs.
UPD: sorry, didn't see fresh commits when writing this message. There is no crashes for the latest sources, at least on my computer. |
Yeah, sorry, I should've posted here when I checked in but neglected to do so. I think the root cause of all this business was the fact that MLIFont was being accessed off of the UI thread, which basically always induces unpredictable behavior if you don't know exactly how something works or that it's only being accessed on that one thread (and given that TTF_Font is a black box, one can't exactly know that in that case). Adding semaphores seemed to help a little, but never fixed the problem completely. I just moved everything that needed MLIFont onto the UI thread, and that seemed to fix all of these issues. Glad to hear that seems to be the case on your end, too. Let me know if you do see anything else, though. |
I've had difficulty reproducing this or getting meaningful information as it seems to happen only sporadically, but after the implementation of the MRU cache for character display, I've noticed the game sometimes crash inside TTF_RenderUTF8Blended after "Loading audio..." completes when loading a case.
The text was updated successfully, but these errors were encountered: