Closed Bug 450371 Opened 16 years ago Closed 16 years ago

CPU goes 100% busy for a long time on shutdown

Categories

(SeaMonkey :: General, defect)

x86
All
defect
Not set
major

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: nelson, Unassigned)

Details

Running SM trunk nightly build Gecko/2008080600 Every time I shut down SM, the CPU goes 100% busy for minutes. Usually stays that way until I kill it. I attached to the process while it was in this state with a debugger. I did a little stepping, and found that it is in a tight loop, calling NS_ProcessNextEvent_P from nsThread::Shutdown See that code at http://mxr.mozilla.org/comm-central/source/mozilla/xpcom/threads/nsThread.cpp#463 The stack is: xpcom_core.dll!nsThread::Shutdown() Line 469 C++ necko.dll!nsSocketTransportService::Shutdown() Line 447 C++ necko.dll!nsIOService::SetOffline(int offline=0x00000001) Line 622 C++ necko.dll!nsIOService::Observe() Line 775 C++ xpcom_core.dll!nsObserverList::NotifyObservers() Line 128 + 0x12 bytes xpcom_core.dll!nsObserverService::NotifyObservers() Line 184 C++ xul.dll!nsXREDirProvider::DoShutdown() Line 838 C++ xul.dll!ScopedXPCOMStartup::~ScopedXPCOMStartup() Line 916 C++ xul.dll!XRE_main( If I force it to exit that loop and fall through to PR_JoinThread, the program exits very quickly after that.
> OS: Windows XP FYI. Process Monitor can trace file related activity(open/close/read/write etc.) of Seamonkey, and trace of file related activity provides valuable information about "what program is doing" in many cases, not any case though. > Sysinternals Utilities Index > http://technet.microsoft.com/en-us/sysinternals/bb545027.aspx > Process Monitor v1.37 > http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
Confirming. On Linux, I often, but not every time, see seamonkey-bin using between 75% and 95% of the CPU time (with all other processes sharing the rest) after I hit Ctrl-Q and confirm that I want to close all tabs. I don't know what causes it but when it happens, the Sm process doesn't end, even after 10 minutes of inaction on my part. In the ksysguard "System Load" graph (one of the Linux equivalents of the Windows Task Manager) I see an unusually high amount of "system" time being consumed. The only solution I've found so far is to kill it manually with kill -15 Today I'm using Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/20080813004850 SeaMonkey/2.0a1pre but I haven't yet tried to close it since install.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
I've been seeing this problem on Windows XP A LOT lately. I've been breaking into the hung process with the debugger and looking around, and I've noticed a number of things. These observations have led to a workaround or two, one of which seems satisfactory. There's always one thread trying to close a socket. The stack of Windows system shared libraries on that thread is VERY deep, as if Windows code called by NSPR to close the socket has called itself recursively a lot. On another thread, there's some kind of timer event firing over and over. Since I don't have sources to match my browser, I cannot tell exactly what code is doing that. I think that one thread is starving the other, and the starved thread needs to finish for the shut down to complete. While it is using 100% of the CPU, setting the process priority down from 8 (normal) to 4 (idle) with Windows Process Explorer usually causes it to stop hanging and terminate normally within a second after doing so. Going "offline" before exiting the process seems to avoid the hang. The process shuts down very quickly when I do that. I am now doing that frequently, and have never seen a shutdown hang since I started doing that.
I originally reported this using a nightly build from 2008-08-06. I continued to see it in nightly builds from 2008-08-16 2008-08-31 2008-09-09 2008-09-17 2008-09-18 2008-09-22 2008-09-30 But since switching to 2008-10-16, this problem seems greatly reduced. Now, when I shut down the browser, the CPU goes 100% busy for 1-3 seconds, but no more. Then the process terminates successfully. I have not seen it stay 100% busy for minutes (until it is killed) since switching to that version.
This problem is too different from the symptoms of bug 416745 to be a duplicate.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Nelson, what TCP ports are still open when it's in the hung state using CPU? Is this a regression?
I haven't seen this symptom for a long time. If Tony Mechelynck is also not seeing it any more, then I think this can be resolved WORKSFORME.
Might the cause of this bug be related to the cause of bug 490948?
(In reply to comment #9) > Might the cause of this bug be related to the cause of bug 490948? no connection as far as I can see.
Assignee: general → nobody
Status: REOPENED → NEW
Status: NEW → RESOLVED
Closed: 16 years ago16 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.