Closed Bug 312634 Opened 20 years ago Closed 4 years ago

nsJSEnvironment doesn't pass in a valid source line for strict warning

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INACTIVE

People

(Reporter: WeirdAl, Unassigned)

References

()

Details

(Keywords: testcase)

I hit this assertion after applying the patch for bug 312630. In nsJSEnvironment.cpp, it uses fileName.get(), which doesn't work as fileName is a nsAutoString, and fileName.get doesn't exist. 00 ntdll!DbgBreakPoint 01 xpcom_core!nsDebugImpl::Break(char * aFile = 0x00df7350 "m:/mozilla/js/src/xpconnect/src/nsScriptError.cpp", int aLine = 132)+0x7e 02 xpcom_core!nsDebugImpl::Assertion(char * aStr = 0x00df7390 "Need a non-null source code line for the console service!", char * aExpr = 0x00df7384 "sourceLine", char * aFile = 0x00df7350 "m:/mozilla/js/src/xpconnect/src/nsScriptError.cpp", int aLine = 132)+0x29e 03 xpcom_core!NSGlue_Assertion(char * aStr = 0x00df7390 "Need a non-null source code line for the console service!", char * aExpr = 0x00df7384 "sourceLine", char * aFile = 0x00df7350 "m:/mozilla/js/src/xpconnect/src/nsScriptError.cpp", int aLine = 132)+0x4d 04 xpc3250!nsScriptError::Init(unsigned short * message = 0x0012e470, unsigned short * sourceName = 0x0012e3d0, unsigned short * sourceLine = 0x00000000, unsigned int lineNumber = 0x963, unsigned int columnNumber = 0, unsigned int flags = 5, char * category = 0x01a005c0 "content javascript")+0x4a 05 gklayout!NS_ScriptErrorReporter(struct JSContext * cx = 0x02f40028, char * message = 0x03545e20 "assignment to undeclared variable now", struct JSErrorReport * report = 0x0012e5b4)+0x3c7 06 js3250!js_ReportErrorAgain(struct JSContext * cx = 0x02f40028, char * message = 0x03545dc8 "assignment to undeclared variable now", struct JSErrorReport * reportp = 0x0012e5b4)+0xc9 07 js3250!ReportError(struct JSContext * cx = 0x02f40028, char * message = 0x03545dc8 "assignment to undeclared variable now", struct JSErrorReport * reportp = 0x0012e5b4)+0x4e 08 js3250!js_ReportErrorNumberVA(struct JSContext * cx = 0x02f40028, unsigned int flags = 5, <function> * callback = 0x00c01efb, void * userRef = 0x00000000, unsigned int errorNumber = 0x9c, int charArgs = 1, char * ap = 0x0012e624 "0lT???")+0xe3 ...
Whoops. This was on the *second* assertion I added, not the first.
Summary: nsJSEnvironment doesn't pass in a valid URL for strict warning → nsJSEnvironment doesn't pass in a valid source line for strict warning
This is really caused by jscntxt.c, through js_ReportErrorNumberVA and ReportError. This function initializes the JSErrorReport object (report), but didn't set the uclinebuf property.
Assignee: general → general
Component: DOM → JavaScript Engine
QA Contact: ian → general
I'm going to replace the assertion I would've added for bug 312630 with a warning. There's just too many instances to justify crashing the program.
Keywords: assertion
Blocks: 296661
Alex: Is this bug INVALID, now?
Ping me again this weekend, and I'll try to look. This bug is three years old, now, and could probably use re-testing. Although if the patch in the other bug hasn't bitrotted, I'll be astonished.
Assignee: general → nobody

Old, inactive bug.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.