Open Bug 1611280 Opened 4 years ago Updated 2 years ago

Try to require that JSErrorBase::filename is non-null

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

People

(Reporter: mccr8, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Some places in the code base null check JSErrorBase::filename, implying that it can be null, but JS::CreateError will crash if you pass in null for the filename (see bug 1608760). In general, JSErrorBase looks like code from the C era of SpiderMonkey, without a constructor that does much of anything. Maybe we can change it to use a real constructor, and try to enforce that filename (and other fields?) are non-null.

Bug 1610606 is one place I found that can result in a null filename. That just looks like a bug in error handling code that should be fixed. I wasn't really sure how the error handling is supposed to work in that method.

ErrorReport::populateUncaughtExceptionReportUTF8VA() looks like it is another place that can result in a null filename. If I'm reading this correctly, it looks like this could happen if we end up in some kind of fallback exception creating code in ErrorReport::init(), when the top of the JS stack is self-hosted code. Maybe we could put a generic value as a file name in that case, or maybe we could just fail and hope something okay happens.

Depends on: 1611459
Priority: -- → P3
Blocks: 1620583
Assignee: continuation → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.