Skip to content

Fix crash when nativeSymbol index is out of bounds in assembly view#5850

Open
fatadel wants to merge 3 commits intofirefox-devtools:mainfrom
fatadel:fix-profiler-crash-5819
Open

Fix crash when nativeSymbol index is out of bounds in assembly view#5850
fatadel wants to merge 3 commits intofirefox-devtools:mainfrom
fatadel:fix-profiler-crash-5819

Conversation

@fatadel
Copy link
Contributor

@fatadel fatadel commented Feb 18, 2026

Closes #5819.

The root cause is at this line.
nativeSymbols[currentNativeSymbol] will yield undefined when nativeSymbols is empty (eg, frame does not have native symbols). And this is exactly the case because we set initialNativeSymbol: 0.

Fixed by returning null instead of undefined, which is handled fine in the downstream code.


Use the same instructions as in the original issue on this profile to see the issue gone.

@fatadel fatadel changed the title Fix profiler crash 5819 fix crash when nativeSymbol index is out of bounds in assembly view Feb 18, 2026
@fatadel fatadel changed the title fix crash when nativeSymbol index is out of bounds in assembly view Fix crash when nativeSymbol index is out of bounds in assembly view Feb 18, 2026
@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.56%. Comparing base (37b31b0) to head (e09282c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5850   +/-   ##
=======================================
  Coverage   85.56%   85.56%           
=======================================
  Files         319      319           
  Lines       31420    31424    +4     
  Branches     8661     8665    +4     
=======================================
+ Hits        26885    26889    +4     
  Misses       4104     4104           
  Partials      431      431           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fatadel fatadel requested review from canova and mstange February 18, 2026 14:20
@mstange
Copy link
Contributor

mstange commented Feb 18, 2026

Could we instead make it so that currentNativeSymbol is always either in-bounds or null? I.e. make it null in the case where the symbol list is empty.

@fatadel
Copy link
Contributor Author

fatadel commented Feb 18, 2026

Done ✅ Good feedback, thank you @mstange!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profiler crash when clicking frame in marker stack

2 participants

Comments