Crashed when spinning the cursor

VERIFIED FIXED in mozilla0.6

Status

()

Core
XUL
P2
critical
VERIFIED FIXED
18 years ago
17 years ago

People

(Reporter: Simon Fraser, Assigned: Mike Pinkerton (not reading bugmail))

Tracking

({crash})

Trunk
mozilla0.6
PowerPC
Mac System 8.5
crash
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

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

Attachments

(1 attachment)

(Reporter)

Description

18 years ago
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).
(Reporter)

Comment 1

18 years ago
Created attachment 14644 [details]
MacsBug stdlog
(Assignee)

Comment 2

18 years ago
*shrug*

Comment 3

18 years ago
need info: was this a one-time crash?  Are there any steps to reproduce?
Whiteboard: [need info]
(Reporter)

Comment 4

18 years ago
Yes, and no. It crashed while I was starting mozilla.

Comment 5

18 years ago
Can't find any related crashes on http://cyclone/ talkback.

Comment 6

18 years ago
I saw this crash this morning (debug mozilla build) while trying to open the 
3pane message window
(Reporter)

Comment 7

18 years ago
If anyone sees this crash, please determine:
1. if the heap is corrupted (hc all)
2. if memory is low (ht)

Comment 8

18 years ago
Debug only, or has anyone seen using comm bits?  adding crash keyword.
severity->critical
Severity: normal → critical
Keywords: crash

Comment 9

18 years ago
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.
(Reporter)

Comment 10

18 years ago
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).

Comment 11

18 years ago
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
(Assignee)

Updated

17 years ago
Status: NEW → ASSIGNED

Comment 12

17 years ago
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
(Reporter)

Comment 13

17 years ago
FWIW, I've seen this once when starting up a branch opt (installed) Netscape 
build.
(Assignee)

Comment 14

17 years ago
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
(Assignee)

Comment 15

17 years ago
trudelle said i can fix this, marking need info. ;)
Whiteboard: [rtm needinfo]
(Reporter)

Comment 16

17 years ago
*spank*

Comment 17

17 years ago
fix looks fine to me, r=pchen

Comment 18

17 years ago
just reviewed updated fix, still looks fine by me, r=pchen
(Assignee)

Updated

17 years ago
Keywords: patch
Whiteboard: [rtm needinfo] → [rtm needinfo] needs a=
(Assignee)

Comment 19

17 years ago
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
(Reporter)

Comment 20

17 years ago
sr=sfraser on revised patch
(Assignee)

Comment 21

17 years ago
ready to go. on the radar!
Whiteboard: [rtm needinfo] needs a= → [rtm+] r/sr/patch in bug
(Reporter)

Comment 22

17 years ago
*** Bug 54023 has been marked as a duplicate of this bug. ***

Comment 23

17 years ago
rtm++
Whiteboard: [rtm+] r/sr/patch in bug → [rtm++] r/sr/patch in bug
(Assignee)

Comment 24

17 years ago
landed on branch and trunk. All hail the boring watch cursor that doesn't trash
your machine!
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 25

17 years ago
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.