Closed Bug 546366 Opened 14 years ago Closed 11 years ago

Audit Activities in DLLMain

Categories

(Core :: Widget: Win32, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: khuey, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: meta)

I filed this against Core::Widget::Win32 because the code I'm talking about lives in nsToolkit.cpp.

Currently we do a lot of scary things in libxul's DLLMain.  We execute a lot of code, call a lot of APIs, and even call LoadLibrary/FreeLibrary in it.  Some of these calls are probably harmless (LoadLibrary on user32.dll isn't going to cause any problems) but most of them aren't so obvious.  I think there's a good chance that the cause of "zombie" processes has something to do with what we do in libxul's DllMain at shutdown with FreeLibrary.  Raymond Chen has a number of good blog posts on things that can go wrong, and most of them lead to deadlocks (especially at shutdown).  I really think we should go through and audit what we're doing during DLLMain.

I'm tentatively taking this, but because of other bugs I'm working on and limited time I won't get to substantively dig in to it for several weeks at the earliest.

Reading on why what we do is probably very very bad
[0] http://msdn.microsoft.com/en-us/library/ms682583%28VS.85%29.aspx
[1] http://blogs.msdn.com/oldnewthing/archive/2004/01/27/63401.aspx
[2] http://blogs.msdn.com/oldnewthing/archive/2004/01/28/63880.aspx
[3] http://blogs.msdn.com/oldnewthing/archive/2007/09/04/4731478.aspx
[4] http://blogs.msdn.com/oldnewthing/archive/2010/01/15/9948740.aspx
[5] http://blogs.msdn.com/oleglv/archive/2003/10/24/56141.aspx
Blocks: 561144
Assignee: khuey → nobody
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.