Closed Bug 1927729 Opened 6 days ago Closed 7 hours ago

Firefox hangs when opening and clicking into a new blank tab

Categories

(Toolkit :: Places, defect)

Firefox 134
defect

Tracking

()

RESOLVED DUPLICATE of bug 1927173

People

(Reporter: hitman66, Unassigned)

References

Details

Attachments

(4 files)

Attached file firefox hangs bug.txt

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0

Steps to reproduce:

Just open or clicking into a new blank tab and it will hangs naturally.

Actual results:

It hangs for a minute before I'm able to do anything with the browser

Expected results:

Opening a tab shouldn't cause any hangs to begin with.

You seem to have quite a few add-ons installed.

Does it work if you start Firefox in Troubleshoot mode?

If it does, I would start trying disabling some add-ons to try and find what's causing the issue.

If the problem persists, recording a profile and sharing it here could help
https://profiler.firefox.com/

Flags: needinfo?(hitman66)

Here you go : https://share.firefox.dev/3Urn2Su

It runs in troubleshooting mode mind you. Hope that helps.

Flags: needinfo?(hitman66)

Moving to Core::Performance for investigation.

It runs in troubleshooting mode mind you. Hope that helps.

I would start disabling add-ons that are tab-related (you have a few, like FoxyTab, and see if you can pinpoint the issue).

Component: Untriaged → Performance
Product: Firefox → Core

(In reply to Francesco Lodolo [:flod] from comment #3)

Moving to Core::Performance for investigation.

It runs in troubleshooting mode mind you. Hope that helps.

I would start disabling add-ons that are tab-related (you have a few, like FoxyTab, and see if you can pinpoint the issue).

Already removed all the tab related extensions, you may refer to the new troubleshooting info data that I uploaded just now.

And it still hangs whenever I tried to open a new tab or clicking into a blank tab.

Another profiler link : https://share.firefox.dev/3A7gTUN

Now it effects randomly while clicking either history or bookmark selection on application menu

https://share.firefox.dev/3YqJc8y

I've begun to experience the same since ~ 2024/10/24 - Nightly channel. I used troubleshooting mode to test and to capture the attached profiles. As is visible the places database is implicated in the 6-8s hangs, accessing bookmark info.
. In the second profile I intuited the cause and hid the Bookmarks bar (was set to show on new tab). You can see this during the profile.

https://share.firefox.dev/4fiDVr7

Searching for places in the tracker I see the most recent mention of places is #1926789. I did not check Mg for changes related to this issue but it might be something to inspect.

To sum up, hiding the bookmarks bar on the new tab page causes the hangs to cease.

Bug #977149 I mean.

@mak
Are you aware of any recent change that could be causing this?

I wonder if this is going to show up in Beta, given the timing.

Component: Performance → Places
Flags: needinfo?(mak)
Product: Core → Toolkit
See Also: → 1927173

There is a perf regression in bug 1927173, though I'm not sure how it would cause multi-second thread contention. It's compatible with the timeframe and it may cause some latency like this, especially on slow disks.

If you can reproduce this bug, and you have telemetry enabled, could you please go to about:telemetry, pick the Slow SQL section and post here queries from the list that are taking more than 500ms?

And, if confirmed, this is also related to bug 599980, as favicons are currently sharing the main connection, while they should be moved to the same connection resolving visited links coloring.

(In reply to Marco Bonardo [:mak] from comment #11)

There is a perf regression in bug 1927173, though I'm not sure how it would cause multi-second thread contention. It's compatible with the timeframe and it may cause some latency like this, especially on slow disks.

If you can reproduce this bug, and you have telemetry enabled, could you please go to about:telemetry, pick the Slow SQL section and post here queries from the list that are taking more than 500ms?

SELECT i.icon_url FROM moz_pages_w_icons pwi JOIN moz_icons_to_pages itp ON pwi.id = itp.page_id JOIN moz_icons i ON itp.icon_id = i.id JOIN moz_places p ON p.url_hash = pwi.page_url_hash WHERE p.url BETWEEN :pageRoot AND :pageRoot || X:private ORDER BY p.frecency DESC, i.width DESC LIMIT 1 /* places.sqlite */

Hits : 2

Avg. Time (ms) : 29721

Hope that helps

Have several.

In troubleshooting mode:

Main thread
6 hits, 943 ms:

	SELECT i.icon_url FROM moz_pages_w_icons pwi JOIN moz_icons_to_pages itp ON pwi.id = itp.page_id JOIN moz_icons i ON itp.icon_id = i.id JOIN moz_places p ON p.url_hash = pwi.page_url_hash WHERE p.url BETWEEN :pageRoot AND :pageRoot || X:private ORDER BY p.frecency DESC, i.width DESC LIMIT 1 /* places.sqlite */

In normal mode:

Main thread
5 hits, 910ms:

	WITH tagged(place_id, tags) AS ( SELECT b.fk, group_concat(p.title ORDER BY p.title) FROM moz_bookmarks b JOIN moz_bookmarks p ON p.id = b.parent JOIN moz_bookmarks g ON g.id = p.parent WHERE g.guid = :private GROUP BY b.fk ) SELECT h.id, h.url, b.title, h.rev_host, h.visit_count, h.last_visit_date, null, b.id, b.dateAdded, b.lastModified, b.parent, (SELECT tags FROM tagged WHERE place_id = h.id) AS tags, h.frecency, h.hidden, h.guid, null, null, null, b.guid, b.position, b.type, b.fk, t.guid, t.id, t.title FROM moz_bookmarks b LEFT JOIN moz_places h ON b.fk = h.id LEFT JOIN moz_bookmarks t ON t.guid = target_folder_guid(h.url) WHERE b.parent = :parent AND (NOT :excludeItems OR b.type = :folder OR h.url_hash BETWEEN hash(:private, :private) AND hash(:private, :private)) ORDER BY b.position ASC /* places.sqlite */ 

Helper threads

2 hits, 942 ms:

	SELECT * FROM (VALUES(null, :private, :BookmarksToolbarFolderTitle, null, null, null, null, null, 0, 0, null, null, null, null, :private, null, null, null, null, null, null, null, :private, (SELECT id FROM moz_bookmarks WHERE guid = :private), :BookmarksToolbarFolderTitle), (null, :private, :BookmarksMenuFolderTitle, null, null, null, null, null, 0, 0, null, null, null, null, :private, null, null, null, null, null, null, null, :private, (SELECT id FROM moz_bookmarks WHERE guid = :private), :BookmarksMenuFolderTitle), (null, :private, :OtherBookmarksFolderTitle, null, null, null, null, null, 0, 0, null, null, null, null, :private, null, null, null, null, null, null, null, :private, (SELECT id FROM moz_bookmarks WHERE guid = :private), :OtherBookmarksFolderTitle),(null, :private, :MobileBookmarksFolderTitle, null, null, null, null, null, 0, 0, null, null, null, null, :private, null, null, null, null, null, null, null, :private, (SELECT id FROM moz_bookmarks WHERE guid = :private), :Mobil... /* places.sqlite */ 

104 hits, 1079ms:

	SELECT i.icon_url FROM moz_pages_w_icons pwi JOIN moz_icons_to_pages itp ON pwi.id = itp.page_id JOIN moz_icons i ON itp.icon_id = i.id JOIN moz_places p ON p.url_hash = pwi.page_url_hash WHERE p.url BETWEEN :pageRoot AND :pageRoot || X:private ORDER BY p.frecency DESC, i.width DESC LIMIT 1 /* places.sqlite */ 

1 hit, 1866ms:

	UPDATE moz_perms SET permission = ?2, expireType= ?3, expireTime = ?4, modificationTime = ?5 WHERE id = ?1 /* permissions.sqlite */

1849 hits, 1849 ms:

	Untracked SQL for bounce-tracking-protection.sqlite 

I tried to replicate it in the "default" profile (via about:profiles) but even after importing the bookmarks from my regular profile the issue didn't manifest clearly. I suspect this needs a sizeable places database. Mine's a couple of years old, I move my profile when I reinstall.

I suppose a couple aren't directly relevant but please let me know if I should follow up on any on a dedicated issue.

(In reply to goncalo from comment #14)

	SELECT i.icon_url FROM moz_pages_w_icons pwi JOIN moz_icons_to_pages itp ON pwi.id = itp.page_id JOIN moz_icons i ON itp.icon_id = i.id JOIN moz_places p ON p.url_hash = pwi.page_url_hash WHERE p.url BETWEEN :pageRoot AND :pageRoot || X:private ORDER BY p.frecency DESC, i.width DESC LIMIT 1 /* places.sqlite */

This and comment 13 is indeed bug 1927173, so we can confirm the regression range.

Though I'm not sure why it says it's on the main-thread. That's not right, and afaict that's not possible.
Is that a copy/paste mistake?

The next ones are not new, afaict.

Main thread
5 hits, 910ms:

	WITH tagged(place_id, tags) AS ( SELECT b.fk, group_concat(p.title ORDER BY p.title) FROM moz_bookmarks b JOIN moz_bookmarks p ON p.id = b.parent JOIN moz_bookmarks g ON g.id = p.parent WHERE g.guid = :private GROUP BY b.fk ) SELECT h.id, h.url, b.title, h.rev_host, h.visit_count, h.last_visit_date, null, b.id, b.dateAdded, b.lastModified, b.parent, (SELECT tags FROM tagged WHERE place_id = h.id) AS tags, h.frecency, h.hidden, h.guid, null, null, null, b.guid, b.position, b.type, b.fk, t.guid, t.id, t.title FROM moz_bookmarks b LEFT JOIN moz_places h ON b.fk = h.id LEFT JOIN moz_bookmarks t ON t.guid = target_folder_guid(h.url) WHERE b.parent = :parent AND (NOT :excludeItems OR b.type = :folder OR h.url_hash BETWEEN hash(:private, :private) AND hash(:private, :private)) ORDER BY b.position ASC /* places.sqlite */ 

Do you have many tags on bookmarks?
I also see it on my profile, even if at 170ms.
This is just tags being on the Main Thread, it's a bug on file already.

Helper threads

2 hits, 942 ms:

	SELECT * FROM (VALUES(null, :private, :BookmarksToolbarFolderTitle, null, null, null, null, null, 0, 0, null, null, null, null, :private, null, null, null, null, null, null, null, :private, (SELECT id FROM moz_bookmarks WHERE guid = :private), :BookmarksToolbarFolderTitle), (null, :private, :BookmarksMenuFolderTitle, null, null, null, null, null, 0, 0, null, null, null, null, :private, null, null, null, null, null, null, null, :private, (SELECT id FROM moz_bookmarks WHERE guid = :private), :BookmarksMenuFolderTitle), (null, :private, :OtherBookmarksFolderTitle, null, null, null, null, null, 0, 0, null, null, null, null, :private, null, null, null, null, null, null, null, :private, (SELECT id FROM moz_bookmarks WHERE guid = :private), :OtherBookmarksFolderTitle),(null, :private, :MobileBookmarksFolderTitle, null, null, null, null, null, 0, 0, null, null, null, null, :private, null, null, null, null, null, null, null, :private, (SELECT id FROM moz_bookmarks WHERE guid = :private), :Mobil... /* places.sqlite */ 

This being slow is strange, as it's all static content, it must be contending resources with the main-thread.

104 hits, 1079ms:

	SELECT i.icon_url FROM moz_pages_w_icons pwi JOIN moz_icons_to_pages itp ON pwi.id = itp.page_id JOIN moz_icons i ON itp.icon_id = i.id JOIN moz_places p ON p.url_hash = pwi.page_url_hash WHERE p.url BETWEEN :pageRoot AND :pageRoot || X:private ORDER BY p.frecency DESC, i.width DESC LIMIT 1 /* places.sqlite */ 

Still bug 1927173.

I am confident this is just dupe of that bug.

Flags: needinfo?(mak)

Though I'm not sure why it says it's on the main-thread. That's not right, and afaict that's not possible.
Is that a copy/paste mistake?

No. See this capture of the about:telemetry page.

Do you have many tags on bookmarks?
I also see it on my profile, even if at 170ms.
This is just tags being on the Main Thread, it's a bug on file already.

I have no tags at all, just checked the Bookmarks window.

Still bug 1927173.
I am confident this is just dupe of that bug.

Quite possible. I've seen that side-effect as well but not always. It may be the icons are cached after the first load?

You can attach an image to the bug (see Attach New File button above the first comment)

(In reply to Francesco Lodolo [:flod] from comment #18)

Created attachment 9434281 [details]
about:telemetry screenshot

You can attach an image to the bug (see Attach New File button above the first comment)

Thank you, was looking for it in the comment box.

Though I'm not sure why it says it's on the main-thread. That's not right, and afaict that's not possible.
Is that a copy/paste mistake?

Nope, do refer to the image I uploaded just now.

The image says "on Helper Thread", that is reasonable. Comment 14 first query was instead reported as Main Thread, that as far as I can tell is not possible to happen. I'm asking this just because if it would be really Main Thread, then there'd be another bug somewhere we are not aware of.

Just to report that those few Firefox updates lately has solved this issue once and for all. Thanks for the effort!

Status: UNCONFIRMED → RESOLVED
Closed: 7 hours ago
Duplicate of bug: 1927173
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: