#1195 Crash in AutoSuppressGC (cx is null)

Closed
opened 1 year ago by wolfbeast · 2 comments
wolfbeast commented 1 year ago (Migrated from github.com)

As reported on the forum: https://forum.palemoon.org/viewtopic.php?f=46&t=16081&p=171491#p171488

Fallout from #1192

This crashes in jsgc.cpp line 6310

AutoSuppressGC::AutoSuppressGC(ExclusiveContext* cx)
  : suppressGC_(cx->perThreadData->suppressGC) <== crash point
{
    suppressGC_++;
}

cx=<NULL>
Looks like it’s trying to report an error in code, but the JS context for it has been GCed out from under it before the GC suppressor had a chance to prevent it. Possibly because you go from ExclusiveContext (addNoteASCII) to JSContext (CreateErrorNoteVA) and back (subsequent calls)?

Pretty long call stack:

>	xul.dll!js::gc::AutoSuppressGC::AutoSuppressGC(js::ExclusiveContext * cx) Line 6311	C++
 	xul.dll!ExpandErrorArgumentsHelper<JSErrorNotes::Note>(js::ExclusiveContext * cx, const JSErrorFormatString *(*)(void *, const unsigned int) callback, void * userRef, const unsigned int errorNumber, const char16_t * * messageArgs, js::ErrorArgumentsType argumentsType, JSErrorNotes::Note * reportp, char * ap) Line 651	C++
 	xul.dll!CreateErrorNoteVA(JSContext * cx, const char * filename, unsigned int lineno, unsigned int column, const JSErrorFormatString *(*)(void *, const unsigned int) errorCallback, void * userRef, const unsigned int errorNumber, js::ErrorArgumentsType argumentsType, char * ap) Line 6344	C++
 	xul.dll!JSErrorNotes::addNoteASCII(js::ExclusiveContext * cx, const char * filename, unsigned int lineno, unsigned int column, const JSErrorFormatString *(*)(void *, const unsigned int) errorCallback, void * userRef, const unsigned int errorNumber, ...) Line 6364	C++
 	xul.dll!js::frontend::Parser<js::frontend::SyntaxParseHandler>::reportMissingClosing(unsigned int errorNumber, unsigned int noteNumber, unsigned int openedPos) Line 1049	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::arrayInitializer(js::frontend::YieldHandling yieldHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError) Line 9467	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::primaryExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::TokenKind tt, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 10190	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::memberExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::TokenKind tt, bool allowCallSyntax, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8933	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::unaryExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8464	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::assignExpr(js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8139	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::initializerInNameDeclaration(js::frontend::ParseNode * decl, js::frontend::ParseNode * binding, JS::Handle<js::PropertyName *> name, js::frontend::DeclarationKind declKind, bool initialDeclaration, js::frontend::YieldHandling yieldHandling, js::frontend::ParseNodeKind * forHeadKind, js::frontend::ParseNode * * forInOrOfExpression) Line 4716	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::declarationName(js::frontend::ParseNode * decl, js::frontend::DeclarationKind declKind, js::frontend::TokenKind tt, bool initialDeclaration, js::frontend::YieldHandling yieldHandling, js::frontend::ParseNodeKind * forHeadKind, js::frontend::ParseNode * * forInOrOfExpression) Line 4822	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::declarationList(js::frontend::YieldHandling yieldHandling, js::frontend::ParseNodeKind kind, js::frontend::ParseNodeKind * forHeadKind, js::frontend::ParseNode * * forInOrOfExpression) Line 4912	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::statementListItem(js::frontend::YieldHandling yieldHandling, bool canHaveDirectives) Line 7654	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::statementList(js::frontend::YieldHandling yieldHandling) Line 4074	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::functionBody(js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, js::frontend::FunctionSyntaxKind kind, js::frontend::Parser<js::frontend::FullParseHandler>::FunctionBodyType type) Line 2657	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::functionFormalParametersAndBody(js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, js::frontend::ParseNode * pn, js::frontend::FunctionSyntaxKind kind, mozilla::Maybe<unsigned int> parameterListEnd, bool isStandaloneFunction) Line 3702	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::innerFunction(js::frontend::ParseNode * pn, js::frontend::ParseContext * outerpc, js::frontend::FunctionBox * funbox, unsigned int toStringStart, js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, js::frontend::FunctionSyntaxKind kind, js::frontend::Directives inheritedDirectives, js::frontend::Directives * newDirectives) Line 3503	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::trySyntaxParseInnerFunction(js::frontend::ParseNode * pn, JS::Handle<JSFunction *> fun, unsigned int toStringStart, js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, js::frontend::FunctionSyntaxKind kind, js::GeneratorKind generatorKind, js::FunctionAsyncKind asyncKind, bool tryAnnexB, js::frontend::Directives inheritedDirectives, js::frontend::Directives * newDirectives) Line 3463	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::functionDefinition(unsigned int toStringStart, js::frontend::ParseNode * pn, js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, JS::Handle<JSAtom *> funName, js::frontend::FunctionSyntaxKind kind, js::GeneratorKind generatorKind, js::FunctionAsyncKind asyncKind, bool tryAnnexB) Line 3366	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::functionExpr(unsigned int toStringStart, js::frontend::ParserBase::InvokedPrediction invoked, js::FunctionAsyncKind asyncKind) Line 3890	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::primaryExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::TokenKind tt, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 10190	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::memberExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::TokenKind tt, bool allowCallSyntax, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8933	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::unaryExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8464	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::assignExpr(js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8139	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::objectLiteral(js::frontend::YieldHandling yieldHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError) Line 9750	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::primaryExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::TokenKind tt, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 10190	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::memberExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::TokenKind tt, bool allowCallSyntax, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8933	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::unaryExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8464	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::assignExpr(js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8139	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::initializerInNameDeclaration(js::frontend::ParseNode * decl, js::frontend::ParseNode * binding, JS::Handle<js::PropertyName *> name, js::frontend::DeclarationKind declKind, bool initialDeclaration, js::frontend::YieldHandling yieldHandling, js::frontend::ParseNodeKind * forHeadKind, js::frontend::ParseNode * * forInOrOfExpression) Line 4716	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::declarationName(js::frontend::ParseNode * decl, js::frontend::DeclarationKind declKind, js::frontend::TokenKind tt, bool initialDeclaration, js::frontend::YieldHandling yieldHandling, js::frontend::ParseNodeKind * forHeadKind, js::frontend::ParseNode * * forInOrOfExpression) Line 4822	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::declarationList(js::frontend::YieldHandling yieldHandling, js::frontend::ParseNodeKind kind, js::frontend::ParseNodeKind * forHeadKind, js::frontend::ParseNode * * forInOrOfExpression) Line 4912	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::variableStatement(js::frontend::YieldHandling yieldHandling) Line 7377	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::statementListItem(js::frontend::YieldHandling yieldHandling, bool canHaveDirectives) Line 7603	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::statementList(js::frontend::YieldHandling yieldHandling) Line 4074	C++
 	xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::globalBody(js::frontend::GlobalSharedContext * globalsc) Line 2180	C++
 	xul.dll!BytecodeCompiler::compileScript(JS::Handle<JSObject *> environment, js::frontend::SharedContext * sc) Line 341	C++
 	xul.dll!js::frontend::CompileGlobalScript(js::ExclusiveContext * cx, js::LifoAlloc & alloc, js::ScopeKind scopeKind, const JS::ReadOnlyCompileOptions & options, JS::SourceBufferHolder & srcBuf, js::SourceCompressionTask * extraSct, js::ScriptSourceObject * * sourceObjectOut) Line 577	C++
 	xul.dll!js::ScriptParseTask::parse() Line 370	C++
 	xul.dll!js::HelperThread::handleParseWorkload(js::AutoLockHelperThreadState & locked, unsigned int stackLimit) Line 1629	C++
 	xul.dll!js::HelperThread::threadLoop() Line 1883	C++
 	xul.dll!js::detail::ThreadTrampoline<void (__cdecl&)(void *),js::HelperThread *>::Start(void * aPack) Line 228	C++
 	ucrtbase.dll!__crt_at_quick_exit()	Unknown
 	kernel32.dll!@BaseThreadInitThunk@12()	Unknown
 	ntdll.dll!___RtlUserThreadStart@8()	Unknown
 	ntdll.dll!__RtlUserThreadStart@8()	Unknown

@g4jc can you have a look at this please? Seems we lost the exclusive context in the parser chain somewhere in this call stack.

As reported on the forum: https://forum.palemoon.org/viewtopic.php?f=46&t=16081&p=171491#p171488 Fallout from #1192 This crashes in `jsgc.cpp` line 6310 ```C++ AutoSuppressGC::AutoSuppressGC(ExclusiveContext* cx) : suppressGC_(cx->perThreadData->suppressGC) <== crash point { suppressGC_++; } ``` `cx=<NULL>` Looks like it's trying to report an error in code, but the JS context for it has been GCed out from under it before the GC suppressor had a chance to prevent it. Possibly because you go from `ExclusiveContext` (`addNoteASCII`) to `JSContext` (`CreateErrorNoteVA`) and back (subsequent calls)? Pretty long call stack: ``` > xul.dll!js::gc::AutoSuppressGC::AutoSuppressGC(js::ExclusiveContext * cx) Line 6311 C++ xul.dll!ExpandErrorArgumentsHelper<JSErrorNotes::Note>(js::ExclusiveContext * cx, const JSErrorFormatString *(*)(void *, const unsigned int) callback, void * userRef, const unsigned int errorNumber, const char16_t * * messageArgs, js::ErrorArgumentsType argumentsType, JSErrorNotes::Note * reportp, char * ap) Line 651 C++ xul.dll!CreateErrorNoteVA(JSContext * cx, const char * filename, unsigned int lineno, unsigned int column, const JSErrorFormatString *(*)(void *, const unsigned int) errorCallback, void * userRef, const unsigned int errorNumber, js::ErrorArgumentsType argumentsType, char * ap) Line 6344 C++ xul.dll!JSErrorNotes::addNoteASCII(js::ExclusiveContext * cx, const char * filename, unsigned int lineno, unsigned int column, const JSErrorFormatString *(*)(void *, const unsigned int) errorCallback, void * userRef, const unsigned int errorNumber, ...) Line 6364 C++ xul.dll!js::frontend::Parser<js::frontend::SyntaxParseHandler>::reportMissingClosing(unsigned int errorNumber, unsigned int noteNumber, unsigned int openedPos) Line 1049 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::arrayInitializer(js::frontend::YieldHandling yieldHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError) Line 9467 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::primaryExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::TokenKind tt, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 10190 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::memberExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::TokenKind tt, bool allowCallSyntax, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8933 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::unaryExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8464 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::assignExpr(js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8139 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::initializerInNameDeclaration(js::frontend::ParseNode * decl, js::frontend::ParseNode * binding, JS::Handle<js::PropertyName *> name, js::frontend::DeclarationKind declKind, bool initialDeclaration, js::frontend::YieldHandling yieldHandling, js::frontend::ParseNodeKind * forHeadKind, js::frontend::ParseNode * * forInOrOfExpression) Line 4716 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::declarationName(js::frontend::ParseNode * decl, js::frontend::DeclarationKind declKind, js::frontend::TokenKind tt, bool initialDeclaration, js::frontend::YieldHandling yieldHandling, js::frontend::ParseNodeKind * forHeadKind, js::frontend::ParseNode * * forInOrOfExpression) Line 4822 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::declarationList(js::frontend::YieldHandling yieldHandling, js::frontend::ParseNodeKind kind, js::frontend::ParseNodeKind * forHeadKind, js::frontend::ParseNode * * forInOrOfExpression) Line 4912 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::statementListItem(js::frontend::YieldHandling yieldHandling, bool canHaveDirectives) Line 7654 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::statementList(js::frontend::YieldHandling yieldHandling) Line 4074 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::functionBody(js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, js::frontend::FunctionSyntaxKind kind, js::frontend::Parser<js::frontend::FullParseHandler>::FunctionBodyType type) Line 2657 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::functionFormalParametersAndBody(js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, js::frontend::ParseNode * pn, js::frontend::FunctionSyntaxKind kind, mozilla::Maybe<unsigned int> parameterListEnd, bool isStandaloneFunction) Line 3702 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::innerFunction(js::frontend::ParseNode * pn, js::frontend::ParseContext * outerpc, js::frontend::FunctionBox * funbox, unsigned int toStringStart, js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, js::frontend::FunctionSyntaxKind kind, js::frontend::Directives inheritedDirectives, js::frontend::Directives * newDirectives) Line 3503 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::trySyntaxParseInnerFunction(js::frontend::ParseNode * pn, JS::Handle<JSFunction *> fun, unsigned int toStringStart, js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, js::frontend::FunctionSyntaxKind kind, js::GeneratorKind generatorKind, js::FunctionAsyncKind asyncKind, bool tryAnnexB, js::frontend::Directives inheritedDirectives, js::frontend::Directives * newDirectives) Line 3463 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::functionDefinition(unsigned int toStringStart, js::frontend::ParseNode * pn, js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, JS::Handle<JSAtom *> funName, js::frontend::FunctionSyntaxKind kind, js::GeneratorKind generatorKind, js::FunctionAsyncKind asyncKind, bool tryAnnexB) Line 3366 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::functionExpr(unsigned int toStringStart, js::frontend::ParserBase::InvokedPrediction invoked, js::FunctionAsyncKind asyncKind) Line 3890 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::primaryExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::TokenKind tt, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 10190 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::memberExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::TokenKind tt, bool allowCallSyntax, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8933 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::unaryExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8464 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::assignExpr(js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8139 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::objectLiteral(js::frontend::YieldHandling yieldHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError) Line 9750 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::primaryExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::TokenKind tt, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 10190 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::memberExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::TokenKind tt, bool allowCallSyntax, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8933 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::unaryExpr(js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8464 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::assignExpr(js::frontend::InHandling inHandling, js::frontend::YieldHandling yieldHandling, js::frontend::TripledotHandling tripledotHandling, js::frontend::Parser<js::frontend::FullParseHandler>::PossibleError * possibleError, js::frontend::ParserBase::InvokedPrediction invoked) Line 8139 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::initializerInNameDeclaration(js::frontend::ParseNode * decl, js::frontend::ParseNode * binding, JS::Handle<js::PropertyName *> name, js::frontend::DeclarationKind declKind, bool initialDeclaration, js::frontend::YieldHandling yieldHandling, js::frontend::ParseNodeKind * forHeadKind, js::frontend::ParseNode * * forInOrOfExpression) Line 4716 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::declarationName(js::frontend::ParseNode * decl, js::frontend::DeclarationKind declKind, js::frontend::TokenKind tt, bool initialDeclaration, js::frontend::YieldHandling yieldHandling, js::frontend::ParseNodeKind * forHeadKind, js::frontend::ParseNode * * forInOrOfExpression) Line 4822 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::declarationList(js::frontend::YieldHandling yieldHandling, js::frontend::ParseNodeKind kind, js::frontend::ParseNodeKind * forHeadKind, js::frontend::ParseNode * * forInOrOfExpression) Line 4912 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::variableStatement(js::frontend::YieldHandling yieldHandling) Line 7377 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::statementListItem(js::frontend::YieldHandling yieldHandling, bool canHaveDirectives) Line 7603 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::statementList(js::frontend::YieldHandling yieldHandling) Line 4074 C++ xul.dll!js::frontend::Parser<js::frontend::FullParseHandler>::globalBody(js::frontend::GlobalSharedContext * globalsc) Line 2180 C++ xul.dll!BytecodeCompiler::compileScript(JS::Handle<JSObject *> environment, js::frontend::SharedContext * sc) Line 341 C++ xul.dll!js::frontend::CompileGlobalScript(js::ExclusiveContext * cx, js::LifoAlloc & alloc, js::ScopeKind scopeKind, const JS::ReadOnlyCompileOptions & options, JS::SourceBufferHolder & srcBuf, js::SourceCompressionTask * extraSct, js::ScriptSourceObject * * sourceObjectOut) Line 577 C++ xul.dll!js::ScriptParseTask::parse() Line 370 C++ xul.dll!js::HelperThread::handleParseWorkload(js::AutoLockHelperThreadState & locked, unsigned int stackLimit) Line 1629 C++ xul.dll!js::HelperThread::threadLoop() Line 1883 C++ xul.dll!js::detail::ThreadTrampoline<void (__cdecl&)(void *),js::HelperThread *>::Start(void * aPack) Line 228 C++ ucrtbase.dll!__crt_at_quick_exit() Unknown kernel32.dll!@BaseThreadInitThunk@12() Unknown ntdll.dll!___RtlUserThreadStart@8() Unknown ntdll.dll!__RtlUserThreadStart@8() Unknown ``` @g4jc can you have a look at this please? Seems we lost the exclusive context in the parser chain somewhere in this call stack.
g4jc commented 1 year ago (Migrated from github.com)
Owner

Yes, I see the issue. Falling off main thread due to errant use of JSContext in CreateErrorNoteVA during the backport of 1283712. Failed to catch it during Make JSErrorNotes Single Threaded.

Patch incoming.

Yes, I see the issue. Falling off main thread due to errant use of `JSContext` in `CreateErrorNoteVA` during the backport of [1283712](https://github.com/MoonchildProductions/UXP/commit/9a7113f7c8d89d27558942f42603c4edee779d20#diff-84ee602d6f00e281ca8bf8febc7671c0R6329). Failed to catch it during [Make JSErrorNotes Single Threaded](https://github.com/MoonchildProductions/UXP/commit/3765f057896718bfca3056728a485448bfb411cb). Patch incoming.
g4jc commented 1 year ago (Migrated from github.com)
Owner

Had to trace down the contexts a little deeper than expected, but ErrorNotes are functioning properly now. One of the few times a typo in an Add-On is great to have for debugging purposes!

Note to self: Most of the time a context->asJSContext() conversion is a bad idea and masks the larger problem of one of the functions being off-thread.

Had to trace down the contexts a little deeper than expected, but `ErrorNotes` are functioning properly now. One of the few times a typo in an Add-On is great to have for debugging purposes! Note to self: Most of the time a `context->asJSContext()` conversion is a bad idea and masks the larger problem of one of the functions being off-thread.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.