Closed Bug 374332 Opened 18 years ago Closed 18 years ago

many callers don't do PR_UnloadLibrary

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha4

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

(Whiteboard: [patch])

Attachments

(1 file)

I did a code audit of callers that should be calling PR_UnloadLibrary. In particular, PR_LoadLibrary, PR_LoadLibraryWithFlags, PR_LoadStaticLibrary, PR_FindSymbolAndLibrary, PR_FindFunctionSymbolAndLibrary, and nsILocalFile::Load must be matched by PR_UnloadLibrary. I skipped two things: 1) unloading of XPCOM components 2) nsPluginsDir* I was hoping that this would contribute to fixing the leaks that show up in trace-malloc shutdown leak logs (and presumably valgrind "full" leak output) that are related to PR_LoadLibrary. It didn't seem to help much; I'm guessing the XPCOM component loading is a bigger issue. But this also might be useful for things like XPCOM restartability within process.
Attached patch patchSplinter Review
I've built and tested this on Linux; I should probably do some tests on other platforms as well, although most of the platform-specific changes are in GTK code.
Comment on attachment 258912 [details] [diff] [review] patch I've built this on Windows as well as Linux.
Attachment #258912 - Flags: review?(benjamin)
I'm not going to be able to get to this until late next week.
Attachment #258912 - Flags: review?(benjamin) → review+
Checked in to trunk earlier today.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Unloading libraries in nsNativeComponentLoader is bug 60709 / bug 345430. Fixing the plugins code is bug 377605.
dbaron, We intent to NOT unload atk-bridge, libgail, libatk. As comments in mozilla/accessible/src/atk/nsAppRootAccessible.cpp. I'm sorry I didn't make it obvious enough. It's now causing crashes at exit with desktop accessibility on on linux/Solaris. Would you mind back out your changes to this file?
OK, I'll comment them out. I thought the comments said not to call the shutdown method.
Flags: in-testsuite-
The chunk affecting extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp should be backed out. GConf should not be unloaded once it is loaded. The comments in the Init function say: // Don't unload past this point, since GConf's initialization of ORBit // causes atexit handlers to be registered. It causes crashes when libgconf-2 is found but libgnome-2 is not. This is because having libgnome-2 installed also pins libgconf-2 and conceals the problem. This problem has been crashing my build.
(In reply to comment #8) > The chunk affecting > extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp should be backed > out. Please file a new bug for this issue, if you haven't already?
Depends on: 379666
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: