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 923 - SDl used in a firefox plugin causes firefox to crash after plugin is unloaded
Summary: SDl used in a firefox plugin causes firefox to crash after plugin is unloaded
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: audio (show other bugs)
Version: 2.0.0
Hardware: x86 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-04 13:52 UTC by Kees Blom
Modified: 2010-01-05 21:29 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 Kees Blom 2010-01-04 13:52:40 UTC
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
Comment 1 Sam Lantinga 2010-01-05 21:29:42 UTC
This is fixed in the current SDL snapshot:
http://www.libsdl.org/tmp/SDL-1.3.zip