Skip to content

Incorrect handling of fatal exceptions in ReportException #215

@kewde

Description

@kewde

I ran into a Uncaught RangeError: Maximum call stack size exceeded error with reanimated - interestingly the exception below was not a string:

void V8Runtime::ReportException(v8::Isolate *isolate, v8::TryCatch *tryCatch)
const {
v8::HandleScope scopedHandle(isolate);
std::string exception =
JSIV8ValueConverter::ToSTLString(isolate, tryCatch->Exception());

So it was aborting in ToSTLString for a bit.

Ignoring the exception string and continuing to raise the JSError based on constant string resulted in another crash, which is sensible since the call stack is depleted. It seems that for certain errors, the runtime is basically unrecoverable?

I wonder if checking tryCatch->canContinue will result in false in these cases.

I've resorted to aborting the process completely by throwing std::runtime_error with whatever information we have left.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions