Skip to content

Unexpected error when computing Gecko stack traces #89

@BenoitZugmeyer

Description

@BenoitZugmeyer

By reviewing TraceKit code, I found an issue where the stack trace computation fails in certain condition. Keep in mind that I didn't observe an actual error matching this condition.

See the code in question:

                } else if (i === 0 && !parts[5] && !_isUndefined(ex.columnNumber)) {
                    // ...
                    stack[0].column = ex.columnNumber + 1;
                }

The issue is, if i === 0, then the stack array is always empty, so accessing its first element returns undefined, and stack[0].column throws TypeError: Cannot set properties of undefined.

This piece of code is only used in Gecko if the first line doesn't contain any column number. You can see the tests failing if you remove the column number here for example.

Now, because this has been an issue for a long time and nobody reported it, I'm not sure if this should be fixed or if this particular condition could be removed altogether. It seems that Sentry chose the latter.

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