Message crash when displaying (wasm) stacktrace
Categories
(DevTools :: Console, defect, P3)
Tracking
(firefox127 fixed, firefox128 verified)
People
(Reporter: bjornbaron, Assigned: nchevobbe)
References
Details
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0
Steps to reproduce:
- Visit https://bevyengine.org/examples-webgpu/2D%20Rendering/2d-gizmos/
- Open dev console
- Click on the arrow to the left of either of the error messages
Actual results:
[DEVTOOLS ERROR] We’re sorry, we couldn’t render the message. This shouldn’t have happened - please file a bug at https://bugzilla.mozilla.org/enter_bug.cgi?product=DevTools&component=Console with the message metadata in the description.
Clicking the "Copy message metadata to clipboard" button doesn't have any effect.
Expected results:
More details about the error message should be shown.
Assignee | ||
Comment 1•2 months ago
|
||
Thanks for the report, I can indeed reproduce the issue.
In the Browser Console, I'm getting the following error:
13:44:15.593 TypeError: can't access property "substring", id is null
getFormattedSourceId resource://devtools/client/debugger/src/utils/source.js:239
frames resource://devtools/client/shared/components/SmartTrace.js:262
render resource://devtools/client/shared/components/SmartTrace.js:238
React 13
UNSAFE_componentWillMount resource://devtools/client/shared/components/SmartTrace.js:127
react-dom.js:12769:13
which comes from https://searchfox.org/mozilla-central/rev/511d9c9e2eb0f2291dc2b2a5462ba054dfc2edfe/devtools/client/debugger/src/utils/source.js#211-213
export function getFormattedSourceId(id) {
return id.substring(id.lastIndexOf("/") + 1);
}
It should be easy to hotfix this, adding a guard when the id is null. We should also check why we're getting a null source id, and see if that's expected
Assignee | ||
Updated•2 months ago
|
Assignee | ||
Comment 2•2 months ago
|
||
Assignee | ||
Updated•2 months ago
|
Assignee | ||
Updated•2 months ago
|
Updated•1 month ago
|
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1fa5794fe422 [devtools] Fix SmartTrace crash with wasm frames. r=devtools-reviewers,bomsy.
Comment 5•26 days ago
|
||
bugherder |
Assignee | ||
Comment 6•26 days ago
|
||
In some cases, we were getting null sourceId, which was causing an exception
to be thrown in getFormattedSourceId
since it expects a string.
We add a simple guard in this function so we don't throw anymore.
But we shouldn't get null sourceId in the first place. It looks like for
some Wasm sources, the SavedFrame sourceId can be 0, which wasn't playing
well with some loose check we were doing in the sources manager.
Finally, the "Copy metadata" button we display when a console message crash
wasn't working. The message now includes the targetFront, which can be serialized
in JSON, so we simply ignore it.
Original Revision: https://phabricator.services.mozilla.com/D206105
Updated•26 days ago
|
Comment 7•26 days ago
|
||
beta Uplift Approval Request
- User impact if declined: in DevTools console, users won't be able to see the stacktrace of error messages emitted from wasm scripts
- Code covered by automated testing: no
- Fix verified in Nightly: no
- Needs manual QE test: yes
- Steps to reproduce for manual QE testing: see https://bugzilla.mozilla.org/show_bug.cgi?id=1888645#c0
- Risk associated with taking this patch: low
- Explanation of risk level: DevTools only, strengthening a couple checks and adding new guards
- String changes made/needed: -
- Is Android affected?: no
Assignee | ||
Comment 8•26 days ago
|
||
Hello bjorn3, I was wondering if you were the developer behind https://bevyengine.org/ ?
The page was very helpful for me to fix the issue, but as I was trying to write a test for it, I couldn't manage to create a simple wasm project that would reproduce the issue and I was wondering if you could assist me for that.
Updated•25 days ago
|
Comment 9•24 days ago
|
||
I was able to reproduce the issue on Firefox 126.0a1 (2024-03-29) on macOS 14.5 by following the informations provided in Comment 0.
The issue is fixed on Firefox 128.0a1 (2024-05-15). Tests were performed on macOS 14.5 and Windows 11. It seems like Ubuntu 22/24 are loading the rendering and would not throw the errors in dev console.
Updated•23 days ago
|
Comment 10•23 days ago
|
||
uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/30892aa942c2
Updated•23 days ago
|
Reporter | ||
Comment 11•23 days ago
|
||
Hello bjorn3, I was wondering if you were the developer behind https://bevyengine.org/ ?
I am not.
The page was very helpful for me to fix the issue, but as I was trying to write a test for it, I couldn't manage to create a simple wasm project that would reproduce the issue and I was wondering if you could assist me for that.
Bevy uses wgpu for rendering. The page in question forces webgpu usage rather than using webgl. I can't test right now, but maybe https://wgpu.rs/examples reproduces the issue when forcing webgpu usage? If so that may be easier to reduce down to a test.
In any case, thanks for fixing this!
Description
•