Skip to content
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

Closed
4 of 9 tasks
amakhrov opened this issue Nov 10, 2021 · 6 comments · Fixed by #4153
Closed
4 of 9 tasks

Comments

@amakhrov
Copy link

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

6.8.0

Description

Raw stack trace is:

$i/<@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:281638
$i@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:281652
Qi/<@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:280865
Qi@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:280932
remove@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:337263
_applyChanges/<@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:214312
forEachOperation@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:322334
_applyChanges@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:214085
ngDoCheck@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:214037
Ce@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:262471
Ee@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:262272
xe@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:261947
Er@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:286182
Sr@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:286076
Qr@https://www.crunchbase.com/main.4a4119c3cdfd10266d84.js:146:1015148
jr@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:289910
Mr@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:288548
Mr/<@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:288975
Mr@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:289000
Mr/<@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:288975
Mr@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:289000
Mr/<@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:288975
Mr@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:289000
us@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:296021
detectChanges@https://www.crunchbase.com/vendor.d1cae9cfc9917df88de7.js:1:333807
handleProfileResult@https://www.crunchbase.com/main.4a4119c3cdfd10266d84.js:146:1018410
next@https://www.crunchbase.com...

Note this frame:

handleProfileResult@https://www.crunchbase.com/main.4a4119c3cdfd10266d84.js:146:1018410

In Sentry it's displayed as

function: "handlePro"
abs_path: "fileResult@https://www.crunchbase.com/main.4a4119c3cdfd10266d84.js"

It's the only frame in the whole stack trace that is messed up.

@amakhrov
Copy link
Author

On the first glance it looks like some regex matches the file substring there as a special delimiter :)

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2021

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 Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@amakhrov
Copy link
Author

amakhrov commented Dec 2, 2021

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)

@rhcarvalho
Copy link
Contributor

I confirm there are other inputs that produce unexpected results when run through

} else if ((parts = gecko.exec(lines[i]))) {

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).

@vladanpaunovic
Copy link
Contributor

@kamilogorek could you help us here? Is this something that the Stacktrace team can pick up?

@kamilogorek
Copy link
Contributor

@vladanpaunovic the original issue has been already addressed here - #4153
It just needs to be rebased on top of v7 changes and merged in.

lobsterkatie pushed a commit that referenced this issue Aug 2, 2022
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants