Closed Bug 1742168 Opened 3 years ago Closed 2 years ago

"NS_ERROR_ILLEGAL_VALUE" error when searching on npmjs.com for certain packages

Categories

(Core :: DOM: Navigation, defect, P3)

Firefox 94
defect

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox-esr91 --- wontfix
firefox94 --- wontfix
firefox95 --- wontfix
firefox96 --- fixed

People

(Reporter: ksenia, Assigned: smaug)

References

()

Details

Attachments

(1 file)

This was initially reported in https://github.com/webcompat/web-bugs/issues/93773

To reproduce:

  1. Visit https://www.npmjs.com/
  2. Enter "firebase" in the search box (don't push enter as it will redirect to a different page)
  3. Click on the first result in the dropdown list

Expected
Redirect to https://www.npmjs.com/package/firebase
Actual:
"error loading page" error

A similar issue was addressed in https://bugzilla.mozilla.org/show_bug.cgi?id=1542673, but seems that the problem still persists.

P.S. This error also results in "Weekly Downloads" graph not rendered on https://www.npmjs.com/package/firebase page

Probably worth mentioning that if I increase browser.history.maxStateObjectSize , the search starts working.

Hi Olli, wonder if you could take a look at this?

Flags: needinfo?(bugs)

Not sure what could be done here other than increasing the max state object size.

Could you check what is the maximum size in other browsers?

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

Chrome allows up to around 0.5GB states. That is a lot.

var s = new Array(530000000).join("a"); history.pushState(s, ""); seem to work in Chrome
var s = new Array(540000000).join("a"); history.pushState(s, ""); fails.

It is easy to hang Chrome when pushing lots of data to session history and trying to close the browser. It is the whole browser which hangs, not only a renderer process.

farre, what would happen in our session store code if we allowed very large states?
Right now we have https://searchfox.org/mozilla-central/rev/55a826a9ef74e92988e56cd9615d4fc6a470695e/modules/libpref/init/all.js#3769

Flags: needinfo?(afarre)

Olli says Firefox's current session store limit is 2 MB. Should we increase it? Nika says the IPC message size limit is 256 MB, but she wouldn't want to increase the limit above 64 MB.

Chrome allows up to around 0.5GB states. That is a lot.

Thanks for checking it Olli. I've tried the test case from the original issue and increased the object up to 50MB, but couldn't make it fail in Chrome. Didn't realize it's that much.

Flags: needinfo?(kberezina)

We have similar limits for storage and form fields in session store prefs.

Form field collection and storage collection are both bound by IPC message sice since forms are collected in the content child process, and storage on the PBackground actor. With SHIP I guess we actually do history collection without involving IPC.

I think that it'd be good if we could add a browser.sessionstore.dom_history_state_limit that's separate from browser.history.maxStateObjectSize. We should probably make them have the same value initially, but it would be good to be able to allow pushState to push more state than we actually would save in the session store.

Flags: needinfo?(afarre)

Wouldn't that be a bit odd. Then when restoring the data would be broken

(browser.sessionstore.dom_storage_limit is surprisingly low)

I can't now get the error from the STR, but https://www.npmjs.com/package/firebase has the issue.
in Chrome I can see that history.state has a massive object in it. If it is JSON.stringified, it is over 3.1MB. It seems to contain all the version numbers, and very long links to tarballs and some avatars and what not.

Ksenia, do you think you could contact the site and hint that they are using history.state in an unusual way?

I think I'll try increase out limit to 16MB. That is already high, but not crazy high.

Flags: needinfo?(kberezina)

Keeping the pref as signed, since the existing code explicitly handles that case, so someone may have -1 as the pref value.

Assignee: nobody → bugs
Status: NEW → ASSIGNED

Following up on comment 11, I've reached out to them on GitHub.

Flags: needinfo?(kberezina)
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0de3705203a4
increase maxStateObjectSize to 16MB and make the pref a StaticPref, r=peterv
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cc462c61e604
increase maxStateObjectSize to 16MB and make the pref a StaticPref, r=peterv
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
Flags: needinfo?(bugs) → in-testsuite+
See Also: → 1782109
See Also: → 1522706
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: