Firebug hangs Firefox if you try to debug page with JS error and missing image

RESOLVED INVALID

Status

Other Applications
Venkman JS Debugger
--
critical
RESOLVED INVALID
10 years ago
9 years ago

People

(Reporter: Will Moffat, Assigned: Robert Ginda)

Tracking

({testcase})

Trunk
x86
Mac OS X
testcase

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: , URL)

Attachments

(4 attachments, 1 obsolete attachment)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b4pre) Gecko/2008020604 Minefield/3.0b4pre
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b4pre) Gecko/2008020604 Minefield/3.0b4pre

This page causes Firefox to hang completely if Firebug is set to break on errors. FF3 on Windows does not exhibit this problem.

The offending page is just 2 lines:
  <body onload="n">
  <img src=""> 

Reproducible: Always

Steps to Reproduce:
1. In Firebug, set Script / Options / Break on All Errors 
2. Load this page http://mqlx.com/~willmoffat/learn_feature/firebug/firebug_hangs.html

Actual Results:  
Firefox hangs. UI completely unresponsive. Force-quit necessary to restart FF.
CPU usage is very low.



Setup:
* Mac OS 10.5.1
* FF3 (beta 3 or latest nightly)
* Completely clean FF profile, except for:
* Latest release of firebug: http://fireclipse.xucia.com/files/fireclipse/firebug-1.1.0b10.xpi

I first reported this on the Firebug mailing list
http://groups.google.com/group/firebug/browse_thread/thread/a13c8a123b449037

Updated

10 years ago
Hardware: Macintosh → PC
Version: unspecified → Trunk
(Reporter)

Comment 1

10 years ago
Created attachment 301742 [details]
Sample of FF while page loads and then hangs.

I've no idea if this sample (created using Shark) is useful since the documentation here http://developer.mozilla.org/en/docs/Debugging_a_hang_on_OS_X seems to be out of date. Sampler.app is now DTrace-based and doesn't have a menuitem Tools > Generate Report.
Does OS X have "pstack"?  I forgot, but if so that would be more useful than the shark.  If you're not building your own Firefox, though, then you won't have symbols, and since you said that sending SIGSEGV to the process doesn't get you breakpad (just Apple's crash reporter), I'm not sure what else to suggest. :/

Ted: any idea how to get breakpad to trigger, rather than the Apple crash reporter?
(Reporter)

Comment 3

10 years ago
Created attachment 301773 [details]
GDB Stacktrace of debug build

I finally bit the bullet and compiled my own debug build. I'm impressed how easy it was.

Here's a stacktrace with symbols. If I can provide any other helpful info then please let me know.
Attachment #301742 - Attachment is obsolete: true

Comment 4

10 years ago
stupid question: if you have more than one window, can you use the other windows?

(this bug is probably more core than the debugger, but for now i want the attention)
Assignee: nobody → rginda
Component: Extension Compatibility → JavaScript Debugger
Product: Firefox → Other Applications
QA Contact: extension.compatibility → venkman

Comment 5

10 years ago
anyway, since you have a debug build and a debugger,

#13 0x0914e6a6 in XPCWrappedNative::CallMethod (ccx=@0xbfff93ec, mode=XPCWrappedNative::CALL_METHOD) at /Users/will/mozilla/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp:2339
frame 13
call DumpJSStack()

the onnest callback 
http://mxr.mozilla.org/seamonkey/source/js/jsd/jsd_xpc.cpp#2994
http://www.google.com/codesearch?hl=en&q=+package:http://fbug%5C.googlecode%5C.com+startDebugging+show:GtJ7LeLysic:enniAyMdo3M:tGRjPVp5Z00&sa=N&cd=1&ct=rc&cs_p=http://fbug.googlecode.com/svn&cs_f=trunk/content/firebug/debugger.js#l362
http://www.google.com/codesearch?hl=en&q=+package:http://fbug%5C.googlecode%5C.com+onLock+show:GtJ7LeLysic:enniAyMdo3M:tGRjPVp5Z00&sa=N&cd=1&ct=rc&cs_p=http://fbug.googlecode.com/svn&cs_f=trunk/content/firebug/debugger.js#l492

It seems a bit strange, if only because it doesn't seem to have any way to say Unnest()

I think you're going to want to arrange for remote debugging (basically get a second computer, ssh into the first, use the debugger via ssh), and walk through nsAppShell::ProcessNextNativeEvent

The question is mostly, what's happening to events. I'm assuming your CPU isn't being pegged (solid green/red in activity monitor), certainly there's nothing to indicate that.
(Reporter)

Comment 6

10 years ago
> if you have more than one window, can you use the other windows?

No, everything has hung.


> CPU isn't being pegged

Correct. CPU usage is tiny.


> I think you're going to want to arrange for remote debugging

I don't have the time to get up to speed on debugging FF myself.
However I'd be happy to allow somebody else to SSH in and take a look around.

Has anybody else been able to reproduce this bug on a Mac?

I also tested with the latest version of Firebug from svn (1.2.0a6). This also has the same problem.
(Reporter)

Comment 7

10 years ago
This 2nd testcase uses the "debugger" command rather than an error to invoke Firebug: http://mqlx.com/~willmoffat/learn_feature/firebug/firebug_hangs2.html

This is even nastier than the first testcase, by dropping the need to have Firebug set to "Break on All Errors" all you need to experience this bug is:
* a Mac
* FF3
* Firebug enabled

Comment 8

10 years ago
visit irc.mozilla.org ask someone for help finding me.
(Reporter)

Comment 9

10 years ago
Created attachment 304367 [details]
GDB session of timeless

timeless: you could say that it's functionally equivalent to call DumpJSStack() :_)

Comment 10

10 years ago
Will, can you capture the the OS console with Firebug-1.2->FBTrace->Options set to FBS_BP and FBS_STEP? We might be able to guess what section of code is running.
(Reporter)

Comment 11

10 years ago
(In reply to comment #10)
Hi John, here's the output you requested:

fbs.onBreak type=debugger_keyword
stopStepping
firebug.createSourceBox done appendScriptLines...debugger.setLineBreakpoints building lineTable for sourceFile.href:http://mqlx.com/~willmoffat/learn_feature/firebug/firebug_hangs2.html/event/7b5pFSE2rtNaEzSBEw0OyQ==
firebug.createSourceBox done sourceBoxDecorator

P.S. If anybody wants SSH access to my machine for debugging then just ask.

Comment 12

10 years ago
Ok thanks. Although firebug is on the call stack and jsd is has paused the interpreter, this does not look like a Firebug or JSD problem. Firebug has just built the UI to so the event handler and the stack in comment 9 suggests that FF is now processing events.

If you want to see the body of the event handler, set FBTrace FBS_CREATION true; depending on the version of firebug the body will be printed to the console or to fbug/firebug-service.txt in your TEMP dir.
(Reporter)

Comment 13

10 years ago
Created attachment 305550 [details]
Console log with FBTrace FBS_CREATION true

At John's suggestion, here is the console log with FBTrace FBS_CREATION
set true.

Comment 14

10 years ago
Well that certainly revealed some problems, too bad they don't relate to this bug ;-). (I need to get on to FF3).

Will, FBS_CREATION has to be reset after Firebug comes up (to avoid tracing all of Firefox during start up). I don't see any scripts so I guess it is not set.
Whiteboard: [firebug-p?]
Testcase in comment #7 hangs for me on OS X (FF3 nightly, FB 1.2 tip).
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
Whiteboard: [firebug-p?] → [firebug-p2]

Comment 16

9 years ago
The test case in comment 7 is supposed to breakpoint in the event handler. Maybe this 'hang' is really the debugger breakpointing but the UI not responding.

Comment 17

9 years ago
Created attachment 343358 [details]
win32 result with firebug 1.3b1

Comment 18

9 years ago
Rob can you try on your Mac?

Comment 19

9 years ago
I'm pretty sure this was a Firebug bug that has been fixed.

I tested the original case. It works in Firebug 1.4, but has a small problem I reported to Firebug:
http://code.google.com/p/fbug/issues/detail?id=1276
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → INVALID
Whiteboard: [firebug-p2] →
You need to log in before you can comment on or make changes to this bug.