| Summary: | SDL thread join frees first some data and later a thread tries to read same data | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Pauli Nieminen <paniemin> |
| Component: | thread | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | renesd, sezeroz |
| Version: | 1.2.13 | Keywords: | target-1.2.14 |
| Hardware: | x86 | ||
| OS: | Linux | ||
| URL: | http://www.wesnoth.org | ||
|
Description
Pauli Nieminen
2008-07-01 15:21:37 UTC
Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14. Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla). --ryan. Ryan, can you look at this for 1.2 and 1.3? Thanks! hello, I think a fix might be for SDL_ThreadsQuit to use the thread_lock like the rest of the functions. Here's what I think is the problem... It's possible for a SDL_DelThread to put the threads in a state where SDL_ThreadsQuit is called(after SDL_DelThread has released thread_lock). However SDL_ThreadsQuit does not use thread_lock, which means another thread being created would have weird issues happening. Imagine this sequence: SDL_DelThread (acquires lock and gets to work) SDL_AddThread (waits for lock) SDL_DelThread (almost finishes work, and releases lock) SDL_AddThread (acquires lock and gets to work) SDL_DelThread (calls SDL_ThreadsQuit whilst AddThread is going) SDL_ThreadsQuit (sets thread_lock to NULL) ... weirdness, where multiple threads can mess with the data structures. cheers, This might be fixed by the latest checkin: http://www.libsdl.org/tmp/SDL-1.2.zip Can you try it out and let me know if that takes care of the issue? Thanks! Tossing to Ryan for verification. I couldn't trigger this with the wesnoth unit tests, even testing with a revision before the fix. It would be useful if Pauli could retest and let us know if the issue is resolved. --ryan. E-mail to the author of this bug is bouncing. I believe this is fixed so I'm going to close this bug. Please re-open it if it's still active in SDL 1.3! |