Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

[Bug] Pasting extremely-long data URI in the address bar will hang Fenix #1824

Closed
cpeterso opened this issue Apr 19, 2019 · 8 comments · Fixed by #10808
Closed

[Bug] Pasting extremely-long data URI in the address bar will hang Fenix #1824

cpeterso opened this issue Apr 19, 2019 · 8 comments · Fixed by #10808
Labels
🐞 bug Crashes, Something isn't working, .. Feature:Toolbar Address bar, see also Feature:Search P2 Upcoming release performance Possible performance wins S3 Blocks non-critical functionality and a work around exists

Comments

@cpeterso
Copy link

cpeterso commented Apr 19, 2019

Steps to reproduce

  1. In Fenix, load about:telemetry.
  2. Click the "Raw JSON" link.
  3. Before the JSON finishes loading, press the Android Back button.

Expected behavior

In Fennec and Focus+GV, the JSON data is loaded in the browser or you are given the open to open in a JSON Viewer app.

Actual behavior

Fenix hangs while trying to load the JSON data.

If I kill the Fenix process and launch it again, Fenix will still hang. Perhaps the Fenix home screen is trying to show the JSON data in the list of recent sessions? I had to uninstall and reinstall Fenix to make it stop hanging.

Device information

  • Android device: Moto G5 Plus
  • Fenix version:

I originally filed this bug against GV in Bugzilla: "Loading about:telemetry's Raw JSON data will hang Fenix, even after restarting the app". But bholley's conclusion was that:

  • The hang doesn't actually require visiting the page, just putting the extremely-long data URI in the URL bar is sufficient. As such, I'm pretty sure the bug involves some exponential URL text processing in Fenix.
  • This worked fine on an older Fenix build I had installed, but I got the hang after upgrading. So this is a recent regression.
  • It's not actually a hang, just a very long period of jank. It recovers (and displays the JSON as text) in about 2.5 minutes. The Gecko threads in the parent and content processes seem idle and responsive.

https://bugzilla.mozilla.org/show_bug.cgi?id=1542410

┆Issue is synchronized with this Jira Task

@cpeterso cpeterso added the 🐞 bug Crashes, Something isn't working, .. label Apr 19, 2019
@kbrosnan kbrosnan added Feature:Toolbar Address bar, see also Feature:Search performance Possible performance wins labels Apr 27, 2019
@vesta0 vesta0 added the P1 Current sprint label Apr 30, 2019
@vesta0 vesta0 added this to the Bugs milestone Apr 30, 2019
@sblatz sblatz added S3 Blocks non-critical functionality and a work around exists P2 Upcoming release and removed P1 Current sprint labels Jul 16, 2019
@boek boek removed this from the Bugs and Polish milestone Jul 17, 2019
@vesta0 vesta0 removed this from the Bugs and Polish milestone Jul 24, 2019
@karlcow
Copy link

karlcow commented Oct 2, 2019

This seems to be a duplicate of #1681
and we have a webcompat issue which is related except it is not pasting but navigating to.
on nasa Website webcompat/web-bugs#39953

@MarcLeclair
Copy link
Contributor

MarcLeclair commented Dec 2, 2019

From looking at this, #1681 is a REGEX / a "schema" that should always be "denied" ( also from A-C) which we already have rules set up for "about" ( which would work if you type in about:networking#networkID but not about:networking).

As for the Nasa Website bug ( nasa Website #39953) the issue stems from Android Component redirecting a Data URI ( as pointed out in that issue, the href is assigned a base64 string) which 1) creates an intent and then 2) tries to start an activity with an image in the bundle which creates a TransactionTooLargeException.

For the last raised issue, please refer to #5217

@MarcLeclair
Copy link
Contributor

MarcLeclair commented Dec 6, 2019

The root cause of this issue is from the fact that we don't truncate the URL which we use to do in Fennec ( from browser.js). I believe this is more something the Toolbar component should handle instead of the Fenix UI. For more information regarding this bug ( trace file, possible solution, and reproduction of my own test case) please refer to #5249

@MarcLeclair MarcLeclair removed their assignment Dec 6, 2019
@mcomella
Copy link
Contributor

mcomella commented Jan 7, 2020

@MarcLeclair Can this issue be closed or is there additional work needed to close it?

@csadilek
Copy link
Contributor

OK, tested and verified this is fixed now on master after patches linked above landed.

@liuche liuche mentioned this issue Jun 10, 2020
29 tasks
@data-sync-user data-sync-user changed the title [Bug] Pasting extremely-long data URI in the address bar will hang Fenix FNX2-17429 ⁃ [Bug] Pasting extremely-long data URI in the address bar will hang Fenix Aug 4, 2020
@data-sync-user data-sync-user changed the title FNX2-17429 ⁃ [Bug] Pasting extremely-long data URI in the address bar will hang Fenix FNX3-15841 ⁃ [Bug] Pasting extremely-long data URI in the address bar will hang Fenix Aug 11, 2020
@data-sync-user data-sync-user changed the title FNX3-15841 ⁃ [Bug] Pasting extremely-long data URI in the address bar will hang Fenix FNX-483 ⁃ [Bug] Pasting extremely-long data URI in the address bar will hang Fenix Aug 11, 2020
@data-sync-user data-sync-user changed the title FNX-483 ⁃ [Bug] Pasting extremely-long data URI in the address bar will hang Fenix [Bug] Pasting extremely-long data URI in the address bar will hang Fenix May 17, 2022
@poseidon2060
Copy link

Hey @MarcLeclair, I was solving issue #28094 where I am supposed to write tests for a function that shortens URI to MAX_URI_LENGTH which is equal to 25000 characters, I saw you mention this issue and you gave this example https://github.com/MarcLeclair/DataURIStaticTestPage/blob/master/index.html in which there is a long URI on line 42

I need a long URI to write my test, can you please guide me on how to obtain it?
I am new to Android Dev and Open Source so I don't have a lot of experience, your help will be precious.

@MarcLeclair
Copy link
Contributor

Hey @poseidon2060 , I would suggest to just encode a large picture to base64 which, if I remember correctly, is what I did for this issue. I believe the JSON uri in that file (line 42) is the one I'm referring to 😄

@poseidon2060
Copy link

Thankyou that worked 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Crashes, Something isn't working, .. Feature:Toolbar Address bar, see also Feature:Search P2 Upcoming release performance Possible performance wins S3 Blocks non-critical functionality and a work around exists
Projects
None yet
Development

Successfully merging a pull request may close this issue.