Closed Bug 52565 Opened 24 years ago Closed 24 years ago

Crashed when spinning the cursor

Categories

(Core :: XUL, defect, P2)

PowerPC
Mac System 8.5
defect

Tracking

()

VERIFIED FIXED
mozilla0.6

People

(Reporter: sfraser_bugs, Assigned: mikepinkerton)

References

Details

(Keywords: crash, Whiteboard: [rtm++] r/sr/patch in bug)

Attachments

(1 file)

I just had a crash while starting up, and the stack shows that I'm in spinning 
cursor code:

 (CurStackBase does not seem to apply...dumping 4K.)
  Calling chain using A6/R1 links
  Back chain  ISA  Caller
  0F6E9985    PPC  0051409C  EmToNatEndMoveParams+00014
  0F6E9900    PPC  0002C248  
  0F6E980D    PPC  0051409C  EmToNatEndMoveParams+00014
  0F6E97C0    PPC  1C1914BC  WatchTask::DoWatchTask(WatchTask*)+00070
  0F6E9780    PPC  1FEC3358  SetAnimatedThemeCursor+00064
  0F6E9730    PPC  1FEC375C  SetThemeCursorWithOptions+003DC
  0F6E96E0    PPC  1FEC3888  SetThemeCursorWithOptions+00508
  0F6E96A0    PPC  FFD21868  GetCursor+0001C
  0F6E9660    68K  FFC35C44  _GetPattern+00014
  0F6E9591    PPC  0051409C  EmToNatEndMoveParams+00014
  0F6E9540    PPC  1FE7E528  __GetResource+00148
  0F6E94D0    PPC  1FE7B6D0  __IsThisASystemResourceMap+00998
 Closing log

The heap was also trashed (cause unknown).
Attached file MacsBug stdlog
*shrug*
need info: was this a one-time crash?  Are there any steps to reproduce?
Whiteboard: [need info]
Yes, and no. It crashed while I was starting mozilla.
Can't find any related crashes on http://cyclone/ talkback.
I saw this crash this morning (debug mozilla build) while trying to open the 
3pane message window
If anyone sees this crash, please determine:
1. if the heap is corrupted (hc all)
2. if memory is low (ht)
Debug only, or has anyone seen using comm bits?  adding crash keyword.
severity->critical
Severity: normal → critical
Keywords: crash
Ah, so I wasn't imagining it. This happened to me occasinally when I was finding 
cases of bug 53121.

This could be fixed by backing out the fix to bug 52108.
I don' think so. This crash is caused by heap corruption, which just happened to 
show up in the spinning cursor code. There are other instances of heap corruption 
problems (see bug 54023).
rtm need info/p2: nasty random crash, don't know how often it is happening, 
keep on the radar in case anyone can find a reproducible case.
Keywords: rtm
Priority: P3 → P2
Whiteboard: [need info] → [rtm need info]
Target Milestone: --- → M19
Status: NEW → ASSIGNED
rtm-/future, since we aren't getting any info, and don't even know if this
occurs in branch opt builds.Please reopen if we learn more.
Whiteboard: [rtm need info] → [rtm-]
Target Milestone: M19 → Future
FWIW, I've seen this once when starting up a branch opt (installed) Netscape 
build.
I see this a lot when my powerbook goes to sleep, and (finally) I looked
SetAnimatedThemeCursor() up in the apple docs and it says

SPECIAL CONSIDERATIONS

Do not call SetAnimatedThemeCursor at interrupt time.

...which is exactly what i'm doing. bad programmer, no donut. The fix for this
is pretty easy, just load the standard watch cursor at startup and lock it down
before we call SetCursor(). No more spinning, but no more crashes.

We should fix this for RTM, putting back on the radar. The code is well
understood, I'm just an idiot.

Whiteboard: [rtm-]
Target Milestone: Future → mozilla0.6
trudelle said i can fix this, marking need info. ;)
Whiteboard: [rtm needinfo]
*spank*
fix looks fine to me, r=pchen
just reviewed updated fix, still looks fine by me, r=pchen
Keywords: patch
Whiteboard: [rtm needinfo] → [rtm needinfo] needs a=
Here's the patch. It's very safe, and well understood. PDT, this could easily be
the cause of our unknown heap corruption bugs, as well as fixing other known
problems with waking from sleep (a common thing on all macs).

Index: mozilla/gfx/src/mac/nsWatchTask.cpp
===================================================================
RCS file: /m/pub/mozilla/gfx/src/mac/nsWatchTask.cpp,v
retrieving revision 1.1.2.1
diff -u -2 -r1.1.2.1 nsWatchTask.cpp
--- nsWatchTask.cpp	2000/10/06 00:48:32	1.1.2.1
+++ nsWatchTask.cpp	2000/10/24 23:12:40
@@ -69,4 +69,10 @@
 nsWatchTask :: Start ( )
 {
+  // get the watch cursor and lock it high
+  CursHandle watch = ::GetCursor ( watchCursor );
+  if ( !watch )
+    return;
+  mWatchCursor = **watch;
+
   // setup the task
   mTask.qType = vType;
@@ -99,10 +105,10 @@
       if ( !inSelf->mBusy && !LMGetCrsrBusy() ) {
         if ( ::TickCount() - inSelf->mTicks > kTicksToShowWatch ) {
-          ::SetAnimatedThemeCursor(kThemeWatchCursor, inSelf->mAnimation);
+          ::SetCursor ( &(inSelf->mWatchCursor) );
           inSelf->mBusy = PR_TRUE;
         }
       }
       else
-        ::SetAnimatedThemeCursor(kThemeWatchCursor, inSelf->mAnimation);
+        ::SetCursor ( &(inSelf->mWatchCursor) );

       // next frame in cursor animation

Index: mozilla/gfx/src/mac/nsWatchTask.h
===================================================================
RCS file: /m/pub/mozilla/gfx/src/mac/nsWatchTask.h,v
retrieving revision 1.1.2.1
diff -u -2 -r1.1.2.1 nsWatchTask.h
--- nsWatchTask.h	2000/10/06 00:48:34	1.1.2.1
+++ nsWatchTask.h	2000/10/24 23:13:28
@@ -27,4 +27,5 @@

 #include <Retrace.h>
+#include <Quickdraw.h>
 #include "PRTypes.h"
 #include "nscore.h"
@@ -75,4 +76,5 @@
   void* mSelf;              // so we can get back to |this| from the static routine
   long mTicks;              // last time the event loop was hit
+  Cursor mWatchCursor;      // the watch cursor
   PRPackedBool mBusy;       // are we currently spinning the cursor?
   PRPackedBool mSuspended;  // set if we've temporarily suspended operation
sr=sfraser on revised patch
ready to go. on the radar!
Whiteboard: [rtm needinfo] needs a= → [rtm+] r/sr/patch in bug
*** Bug 54023 has been marked as a duplicate of this bug. ***
rtm++
Whiteboard: [rtm+] r/sr/patch in bug → [rtm++] r/sr/patch in bug
landed on branch and trunk. All hail the boring watch cursor that doesn't trash
your machine!
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
I have seen with mine own eyes, the stoic but redoubtable, non-spinning 
watch cursor, mac 2000102609.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: