Don't let backtrace_cleanup_callback affect abs_path and separate filename handling#2474
Don't let backtrace_cleanup_callback affect abs_path and separate filename handling#2474sl0thentr0py wants to merge 1 commit into
backtrace_cleanup_callback affect abs_path and separate filename handling#2474Conversation
backtrace_cleanup_callback affect abs_path and separate filename handling
|
NOTE: since this affects the payload and grouping, I explicitly tested that the old and new payloads end up in the same issue group and it seems fine since we are only changing the underlying |
acca59c to
7027718
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2474 +/- ##
=======================================
Coverage 98.17% 98.17%
=======================================
Files 128 128
Lines 4825 4833 +8
=======================================
+ Hits 4737 4745 +8
Misses 88 88
|
e513e20 to
d5ffd07
Compare
| _, file, number, _, method = ruby_match.to_a | ||
| file.sub!(/\.class$/, RB_EXTENSION) | ||
| _, abs_path, number, _, method = ruby_match.to_a | ||
| abs_path.sub!(/\.class$/, RB_EXTENSION) |
There was a problem hiding this comment.
the original file is now the abs_path and the file is computed if necessary later properly
d5ffd07 to
4a00256
Compare
| _, module_name, method, abs_path, number = java_match.to_a | ||
|
|
||
|
|
||
| cleaned_match = cleaned_line.match(JAVA_INPUT_FORMAT) if cleaned_line |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data
At some point, rails added a [default gem filter to their `BacktraceCleaner`](https://github.com/rails/rails/blob/a8709e6ea26eca73a652af4fdd0a9f7db5352af4/activesupport/lib/active_support/backtrace_cleaner.rb#L118-L125) which messed up our linecache/context lines parsing logic since we get paths like ``` activesupport (7.1.2) lib/active_support/callbacks.rb ``` instead of raw paths. This PR cleans up handling this case by making a clear distinction between `abs_path` and `filename` as was intended in the original relay protocol and we were never populating these properly.
4a00256 to
2309e5b
Compare
|
Please hold off merging this, I think the cause may be at other places and thus require a different change. |
|
closed in favor of #2475 |



At some point, rails added a default gem filter to their
BacktraceCleanerwhich messed up our linecache/context lines parsing logic since we get paths likeinstead of raw paths.
This PR cleans up handling this case by making a clear distinction between
abs_pathandfilenameas was intended in the original relay protocol and we were never populating these properly.Fixes #2472