-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stack trace is incorrectly parsed, concatenates identifier with file path [Firefox] #4138
Comments
On the first glance it looks like some regex matches the |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
I mean, it's still a legit issue, and keeps popping up from time to time in our project ("profile" is a part of our domain terminology, so we cannot simply rename all occurrences in the code to make Sentry SDK happy) |
I confirm there are other inputs that produce unexpected results when run through
Examples: > const gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
> gecko.exec('handleProfileResult@https://www.crunchbase.com/main.4a4119c3cdfd10266d84.js:146:1018410')
(6) ['handleProfileResult@https://www.crunchbase.com/main.4a4119c3cdfd10266d84.js:146:1018410', 'handlePro', undefined, 'fileResult@https://www.crunchbase.com/main.4a4119c3cdfd10266d84.js', '146', '1018410', index: 0, input: 'handleProfileResult@https://www.crunchbase.com/main.4a4119c3cdfd10266d84.js:146:1018410', groups: undefined]
> gecko.exec('helloHTTPMethod@https://www.crunchbase.com/main.4a4119c3cdfd10266d84.js:146:1018410')
(6) ['helloHTTPMethod@https://www.crunchbase.com/main.4a4119c3cdfd10266d84.js:146:1018410', 'hello', undefined, 'HTTPMethod@https://www.crunchbase.com/main.4a4119c3cdfd10266d84.js', '146', '1018410', index: 0, input: 'helloHTTPMethod@https://www.crunchbase.com/main.4a4119c3cdfd10266d84.js:146:1018410', groups: undefined] Touching that regexp is going to require the due diligence (and possibly regular expressions are not the best tool for the job). |
@kamilogorek could you help us here? Is this something that the Stacktrace team can pick up? |
@vladanpaunovic the original issue has been already addressed here - #4153 |
Fixes: #4138 The original issue about `file` keyword also happens for everything in that group, such as `http`, `blob` and so on. And the problem originates from : `.*` between that group and `:`. It seems that `:` follows those keywords without anything in between, as far as I have seen from the tests. Removing that from the regex solved the issue without breaking any tests other than `safari-extension` and `safari-web-extension`, which are special-cased in https://github.com/getsentry/sentry-javascript/blob/d2e0cc4d683364dc500a681631b5be7df40ffec6/packages/browser/src/stack-parsers.ts#L160, and adding those two to the matching group also solved the issue of an extra `:` coming from https://github.com/getsentry/sentry-javascript/blob/d2e0cc4d683364dc500a681631b5be7df40ffec6/packages/browser/src/stack-parsers.ts#L165.
Package + Version
@sentry/browser
@sentry/node
raven-js
raven-node
(raven for node)Version:
Description
Raw stack trace is:
Note this frame:
In Sentry it's displayed as
It's the only frame in the whole stack trace that is messed up.
The text was updated successfully, but these errors were encountered: