Closed Bug 120451 Opened 18 years ago Closed 18 years ago

Crashes when waking from sleep after running Mozilla

Categories

(Core :: JavaScript Engine, defect, P2)

PowerPC
Mac System 9.x
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.8

People

(Reporter: sfraser_bugs, Assigned: sfraser_bugs)

References

Details

Attachments

(2 files)

I've been seeing occasional crashes when waking from sleep after running Mozilla 
on a machine (OS 9), in SleepQRemove.

I note that code was added to prmjtime.c to add a SleepQ entry to sync the clock 
after sleep. However, contrary to the docs, we never call SleepQRemove to remove 
this sleep Q entry. I strongly suspect that this is the cause of the crashes.
Serious bug, can cause data loss in other applications. Need to fox for 0.9.8.
Priority: -- → P2
Target Milestone: --- → mozilla0.9.8
For reference, the changes to prmjtime.c were for bug 115545,
"JS Date() no longer accurate after system wakes from sleep"
This should fix the crashes for CFM. What to do for Mach-O?
cc pink for mach-o suggestions.
Simon: applied your changes, booted into Mac OS 9, ran Mozilla, quit it, and put
my poor Pismo to sleep (and then woke it up) several times, no crashes.  So, I'd
say your fix "WORKSFORME".    r=rjc
As an FYI, I went back and looked at the 4.x code to see where we removed the 
SleepQ entry and it was in the patch to ExitToShell so I'd agree with putting it 
in the CFM terminate routine.  No suggestions for mach-o but it'd sure be nice if 
the OS would realize your process has gone away and not try to call into is 
(maybe OS X is that smart?)
Comment on attachment 65367 [details] [diff] [review]
Fix to call SleepQRemove from the CFM terminate routine

r=sdagley
Attachment #65367 - Flags: review+
Comment on attachment 65367 [details] [diff] [review]
Fix to call SleepQRemove from the CFM terminate routine

sr=beard
Attachment #65367 - Flags: superreview+
I have a TiBook running 9.2. When using some of the latest nightlies, if I run
Mozilla, quit, then shut the lid, the computer beeps and does not sleep. When I
open the lid, there is a message that says the finder quit yada yada. The
computer will nolonger go to sleep and I have to reboot. Is this the same
problem or different?
asked apple re: mach-o, will post when i get the info.
since pink is busy trying to track down a regression I'll post Apple's response:

For MachO:

[BEGIN]
#pragma CALL_ON_LOAD my_mod_init_func
static void my_mod_init_func(void)
{
    /* do my init stuff */
}

#pragma CALL_ON_UNLOAD my_mod_term_func
static void my_mod_term_func(void)
{
    /* do my termination stuff */
}
[END]


That was followed up with this comment however:

Just FYI: some of the cleanup that you do on 9 (sleep Q entries, for 
example) isn't necessary on X. Also, if your app is summarily terminated 
via Force Quit from the Processes window or from the app's Dock menu, 
your termination proc isn't going to be called either.

-eric

So the answer looks to be we don't need to do anything for the mach-o
Taking.
Assignee: beard → sfraser
I'll #ifdef !XP_MACOSX around the __JSInitialize and __JSTerminate so that this 
builds for Mach-O.
Status: NEW → ASSIGNED
a=blizzard on behalf of drivers for 0.9.8
Keywords: mozilla0.9.8+
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
*** Bug 121486 has been marked as a duplicate of this bug. ***
Verified Fixed with trunk binary 20020125xx on Mac9.1.
Mozilla does not crash when my Mac wakes up from sleep. 

Furthermore, the fix to bug 115545 is still intact;
i.e. JS Dates are still accurate after Mac sleep...
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.