Open Bug 1919594 Opened 17 days ago Updated 4 days ago

Network panel has crashed

Categories

(DevTools :: Netmonitor, defect, P3)

defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: info, Unassigned)

References

(Blocks 1 open bug)

Details

Please note that I cannot help in any way to resolve this bug, and can't answer question related to it, and I won't monitor it.

I just came here because the network panel in the Firefox inspector had crashed, and Firefox asked me whether to report it. I said yes because it's always a good idea to submit bug report, and then it took me here and auto-filled this form.

Auto-generated bug report follows:

Error:
InternalError: too much recursion

React Component Stack:
in Connect(Component)
in div
in DropHarHandler
in AppErrorBoundary
in div
in App
in VisibilityHandler
in Unknown
in Connect(Component)
in Provider

Stacktrace:
parseFilters@resource://devtools/client/netmonitor/src/utils/filter-text-utils.js:59:23
isFreetextMatch@resource://devtools/client/netmonitor/src/utils/filter-text-utils.js:275:31
getFilterWithCloneFn</<@resource://devtools/client/netmonitor/src/selectors/requests.js:64:27
getDisplayedRequests<@resource://devtools/client/netmonitor/src/selectors/requests.js:101:48
createSelectorCreator/createSelector/memoizedResultFunc<@resource://devtools/client/shared/vendor/reselect.js:218:27
memoized@resource://devtools/client/shared/vendor/reselect.js:129:22
createSelectorCreator/createSelector/selector<@resource://devtools/client/shared/vendor/reselect.js:232:42
memoized@resource://devtools/client/shared/vendor/reselect.js:129:22
createSelectorCreator/createSelector/selector<@resource://devtools/client/shared/vendor/reselect.js:228:39
memoized@resource://devtools/client/shared/vendor/reselect.js:129:22
module.exports<@resource://devtools/client/netmonitor/src/components/MonitorPanel.js:262:29
mapToPropsProxy@resource://devtools/client/shared/vendor/react-redux.js:1776:92
handleNewState@resource://devtools/client/shared/vendor/react-redux.js:1937:41
handleSubsequentCalls@resource://devtools/client/shared/vendor/react-redux.js:1954:30
pureFinalPropsSelector@resource://devtools/client/shared/vendor/react-redux.js:1959:32
runComponentSelector@resource://devtools/client/shared/vendor/react-redux.js:1233:39
onStateChange@resource://devtools/client/shared/vendor/react-redux.js:1406:23
notify@resource://devtools/client/shared/vendor/react-redux.js:1159:21
notifyNestedSubs@resource://devtools/client/shared/vendor/react-redux.js:1198:20
onStateChange@resource://devtools/client/shared/vendor/react-redux.js:1409:16
dispatch@resource://devtools/client/shared/vendor/redux.js:265:7
waitUntilService/</<@resource://devtools/client/shared/redux/middleware/wait-service.js:59:24
eventTelemetryMiddleware/</</<@resource://devtools/client/netmonitor/src/middleware/event-telemetry.js:29:21
throttlingMiddleware/</</<@resource://devtools/client/netmonitor/src/middleware/throttling.js:18:21
flushActions@resource://devtools/client/netmonitor/src/middleware/batching.js:88:11
DelayedTask/this._promise</this.runTask@resource://devtools/client/netmonitor/src/middleware/batching.js:107:9
notify@resource://gre/modules/Timer.sys.mjs:49:17

Thanks for filing, did you have any text entered in the Network panel filter input?

Flags: needinfo?(info)

At this line we only call String split https://searchfox.org/mozilla-central/rev/af3eccb4999427e42fdcea558297f1cec70dc4db/devtools/client/netmonitor/src/utils/filter-text-utils.js#59

const parts = query.split(/\s+/);

Which is using the builtin split function
https://searchfox.org/mozilla-central/rev/af3eccb4999427e42fdcea558297f1cec70dc4db/js/src/builtin/String.js#484-504

Bryan, do you know if it's possible for split to fail with too much recursion?

Flags: needinfo?(bthrall)

I had the inspector / the panel open for a long time (during the night, because forgot to close it before I left), and I had a filter entered. Nothing complicated and no regex, just a short string like "ABC". I guess it crashed due to memory pressure. Before it crashed, I had observed that the browser was not responsive any more, and became responsive immediately again when I close the inspector.

Flags: needinfo?(info)

(In reply to Binarus from comment #3)

I had the inspector / the panel open for a long time (during the night, because forgot to close it before I left), and I had a filter entered. Nothing complicated and no regex, just a short string like "ABC". I guess it crashed due to memory pressure. Before it crashed, I had observed that the browser was not responsive any more, and became responsive immediately again when I close the inspector.

Thanks for the details Binarus.

That makes sense.
Its filtering over the growing list as more requests come in, as the list increases more memory is consumed until it blows up.

This relates to the performance issues around long running netmonitor sessions, which is known.

See Also: → 1880744, 1594378

It doesn't sound like you still need this info, but...

I analyzed the code for split, and it doesn't look like it is recursive at all, so I would not expect a "too much recursion error". It would be possible if the JS script redefined String.prototype.split or something like that, though.

Let me know if you need more details.

Flags: needinfo?(bthrall)
Severity: -- → S3
Priority: -- → P3

Actually, we are using RegExp on that line:
https://searchfox.org/mozilla-central/rev/3966e5534ddf922b186af4777051d579fd052bad/devtools/client/netmonitor/src/utils/filter-text-utils.js#59
and RegExp are also throwing this too much recursion error:
https://searchfox.org/mozilla-central/search?q=JSMSG_OVER_RECURSED&path=&case=false&regexp=false

I tried some extreme test case, which makes Firefox freeze, but it does not throw:
new Array(100000000).join(" ,\n ").split(/\s+/)

I'm wondering if some very specific string could make the /\s+/ throw too much recursion.

You need to log in before you can comment on or make changes to this bug.