Closed Bug 1304752 Opened 3 years ago Closed 3 years ago

"Handler function threw an exception: TypeError: channel.loadInfo is null" spam

Categories

(DevTools :: Netmonitor, defect, P1)

defect

Tracking

(firefox53 fixed)

RESOLVED FIXED
Firefox 53
Tracking Status
firefox53 --- fixed

People

(Reporter: nmaier, Assigned: jsnajdr)

References

Details

Attachments

(1 file)

The assumption that every channel has a |.loadInfo| is incorrect.
E.g. DownThemAll! created channels do not at the moment.

This causes the netmonitor backend to spam messages like this:
Handler function threw an exception: TypeError: channel.loadInfo is null
Stack: NetworkMonitor.prototype._createNetworkEvent@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/webconsole/network-monitor.js:1003:9
NetworkMonitor.prototype._onRequestHeader@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/webconsole/network-monitor.js:1080:5
NetworkMonitor.prototype.observeActivity<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/webconsole/network-monitor.js:940:7
exports.makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:101:14
Line: 1003, column: 9

STR:
- Install e.g. DownThemAll! and download some stuff with it (or otherwise create channels without a loadInfo)
- See the Browser Console accumulate messages like the above.

This can fill up the Console rather rapidly, making it somewhat unresponsive and less useful.

The culprit:
https://dxr.mozilla.org/mozilla-central/rev/560b2c805bf7bebeb3ceebc495a81b2aa4c0c755/devtools/shared/webconsole/network-monitor.js#1004-1005
It should check for |.loadInfo| being not null before trying to access properties.

Looking at it now, this bug is might cause bug 1304744, as httpActivity.owner would be set up only after the loadInfo property access throws.
Assignee: nobody → jsnajdr
Priority: -- → P1
Added a check for channel.loadInfo to the NetworkMonitor code.

Nils, I can't reproduce the issue with the DownThemAll extension. I'm using version 3.0.8. Have you fixed something since reporting this bug? Can you help me with the exact steps to reproduce?

The fix is obvious even without reproducing the bug, but I'd like to understand better where the channels with null loadInfo come from. All instances I've seen have loadInfo set to something. Even when stepping through the DownThemAll code here:

https://github.com/downthemall/downthemall/blob/master/modules/manager/connection.js#L84

the created channel has a loadInfo, even though it's not specified as the third arg to newProxiedChannel().
Flags: needinfo?(maierman)
QA Contact: jsnajdr
No longer blocks: 1304744
Duplicate of this bug: 1304744
Comment on attachment 8814365 [details]
Bug 1304752 - Check for null channel.loadInfo in NetworkMonitor

https://reviewboard.mozilla.org/r/95630/#review95680

Thanks Jarda.
Attachment #8814365 - Flags: review?(poirot.alex) → review+
Pushed by jsnajdr@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/f05afddd1179
Check for null channel.loadInfo in NetworkMonitor r=ochameau
https://hg.mozilla.org/mozilla-central/rev/f05afddd1179
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 53
Product: Firefox → DevTools
Flags: needinfo?(maierman)
You need to log in before you can comment on or make changes to this bug.