| Summary: | SDl used in a firefox plugin causes firefox to crash after plugin is unloaded | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Kees Blom <Kees.Blom> |
| Component: | audio | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 2.0.0 | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
This is fixed in the current SDL snapshot: http://www.libsdl.org/tmp/SDL-1.3.zip |
We are developing a plgin for firefox, in which we are using SDL 1.3 When this plugin has been used succesfully and subsequently was unloaded by firefox, the browser crashed. Investigations led to the conclusion that this was caused by SDL adding the environment variable "ESD_NO_SPAWN=1" using putenv() with a string stored in the plugin's data section during SDL_Init(). When firefox wants to unload the plugin (for example because the user clicks on the Firefox Back button) our plugin calls SDL_QUIT() but this does not cause the environment variable "ESD_NO_SPAWN" to be removed from the environment. As a result, thereafter a pointer is present in Firefox' environment that points to non-existing memory. When firefox subsequently calls getenv() for another reason and it hits this pointer thus crashes. This was observed using firefox 3.0.11 on FC 9 and 3.5.4 on FC11. We made a work-around in our plugin to call unsetenv("ESD_NO_SPAWN") just prior to unloading. Our project is hosted at: www.ambulantplayer.org