Open Bug 1776263 Opened 2 years ago Updated 2 years ago

[X11] Firefox crashed randomly while selecting text while video playing in another window

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 103
x86_64
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: jaakko.haarla, Unassigned)

References

Details

Attachments

(7 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0

Steps to reproduce:

On up to date Fedora 36 Cinnamon with Nvidia 510.68.02 and firefox 101.0.1.

Crash does not happen when:

  • using nouveau gpu driver
  • firefox in safe-mode

Crash happens when using nvidia 510.68.02 drivers:

  1. Open firefox
  2. open second tab
  3. pull second tab as a new separate firefox window
  4. Play video from youtube in the second window
    5a. Select text by holding mouse button from some website on the first window
    5b. mouse-click to unselect.
    repeat 5a and 5b for few minutes.

Actual results:

After couple minutes of selecting/unselecting text, firefox crashes with command line message "Exiting due to channel error."

Crash does not leave entry on about:crashes

Expected results:

Selecting and un-selecting text without crash

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

Hello, thanks for the report! That's interesting behavior, though I was unable to reproduce it on my Linux machine with amdgpu drivers. I have a few questions to help diagnose. Could you share a pair of example URLs you've noticed the behavior with? Would you be able to paste the contents of your about:support page? If you disable hardware acceleration in about:config by changing the value of media.hardware-video-decoding.enabled, do you experience the same behavior? Do you notice Firefox becoming laggy / less responsive the longer you select the text for? Submitting a performance profile with the Firefox Profiler and posting the link here could be helpful.

Flags: needinfo?(jaakko.haarla)
OS: Unspecified → Linux
Hardware: Unspecified → x86_64

(In reply to az [:az] from comment #2)

Hello, thanks for the report! That's interesting behavior, though I was unable to reproduce it on my Linux machine with amdgpu drivers. I have a few questions to help diagnose. Could you share a pair of example URLs you've noticed the behavior with? Would you be able to paste the contents of your about:support page? If you disable hardware acceleration in about:config by changing the value of media.hardware-video-decoding.enabled, do you experience the same behavior? Do you notice Firefox becoming laggy / less responsive the longer you select the text for? Submitting a performance profile with the Firefox Profiler and posting the link here could be helpful.

Hi

I tried with the media.hardware-video-decoding.enabled -> false but it made no difference.

e.g. https://www.youtube.com/watch?v=fIzMlrh3tOY and https://bbs.io-tech.fi/
I put the video playing and just select and unselect repeatedly areas of text on the forum front page and firefox crashed after about 30s.

I don't experience any change in firefox behavior before the crash and the crash happens always during a mouse click event. So the crash does not happen just by itself.

I'll try the profiler.

Flags: needinfo?(jaakko.haarla)

Firefox profiler crashed with everything else so I can't get any events with that.

Anyway I made a screen capture just to show what happens:
https://www.youtube.com/watch?v=8_xbO9DQkeY

Attached file firefox_about_support.txt (deleted) —

firefox about:support

Thanks for the info! I loaded up the sites you had used in your screen capture to attempt a repro but was unable to. I'll see if I can find more information on this.

Attached file strace_output_last1k (deleted) —

Here is last 1k lines from strace firefox output if it helps.

Attached file gdb.txt (deleted) —

and gdb; catch syscall exit_group; backtrace

Component: Audio/Video: Playback → Widget: Gtk
Summary: Firefox crashed randomly while selecting text while video playing in another window → [X11] Firefox crashed randomly while selecting text while video playing in another window

I changed the component -> Widget: Gtk since the gdb backtrace points to something gtk clipboard related

Attachment #9282906 - Attachment mime type: application/octet-stream → text/plain

_XIOError is often called when the X server crashes.
Is this a Wayland system where the Xwayland process may have crashed?

(In reply to Karl Tomlinson (:karlt) from comment #10)

_XIOError is often called when the X server crashes.
Is this a Wayland system where the Xwayland process may have crashed?

No. Just x11. As far as I know, cinnamon de does not support wayland.

xtrace may be the best way to identify what is going wrong here. The log will be long, but the tail end would hopefully provide some clues. That's called x11trace on Fedora IIUC. Perhaps x11vis may be easier to use, but i don't know whether or not it is as complete as xtrace.

(In reply to Karl Tomlinson (:karlt) from comment #12)

xtrace may be the best way to identify what is going wrong here. The log will be long, but the tail end would hopefully provide some clues. That's called x11trace on Fedora IIUC. Perhaps x11vis may be easier to use, but i don't know whether or not it is as complete as xtrace.

I tried using "x11trace firefox &> x11trace_output" to get log but I could not replicate the crash. Tested again with "firefox" only and crashed like before.

Then I accidentally had firefox already running while using the "x11trace firefox &> x11trace_output". Then I could replicate the crash and got some logs. Not sure if these help but I put them as attachments anyway.

Attached file x11trace_output_1 (deleted) —
Attached file x11trace_output_2 (deleted) —

000:<:003c: 12: RANDR-Request(140,33): UNKNOWN opcode=0x8c opcode2=0x21

That's RRGetProviderInfo, which is plausibly the last request for a test process, so I don't see anything remarkable there.

Then I accidentally had firefox already running while using the "x11trace firefox &> x11trace_output". Then I could replicate the crash and got some logs.

Which process crashed? The one already running or the one started with x11trace?

(In reply to Karl Tomlinson (:karlt) from comment #16)

000:<:003c: 12: RANDR-Request(140,33): UNKNOWN opcode=0x8c opcode2=0x21

That's RRGetProviderInfo, which is plausibly the last request for a test process, so I don't see anything remarkable there.

Then I accidentally had firefox already running while using the "x11trace firefox &> x11trace_output". Then I could replicate the crash and got some logs.

Which process crashed? The one already running or the one started with x11trace?

The one started with x11trace but the crash closes every open firefox even if it was started before x11trace. The log files are very different sizes.

case 1:
"x11trace firefox &> x11trace_output" generates 1GB log file in few minutes but I cannot replicate the crash.

but

case 2:
"firefox &"
"x11trace firefox &> x11trace_output" generates only few MB size log file which are in the attachments. I do everything to the window opened by this command and can replicate the crash. The crash closes all firefox windows even from previous "firefox &".

If I start a second firefox from terminal (case 2), does it really make a separate process or just some sub-process for the first one?

(In reply to jaakko.haarla from comment #17)

If I start a second firefox from terminal (case 2), does it really make a separate process or just some sub-process for the first one?

If no separate profile is specified, then the second process will hand over to the first, which will create a new window or tab.
A separate profile can be specified for a separate process:

% mkdir fx-profile
% firefox -profile fx-profile

(In reply to Karl Tomlinson (:karlt) from comment #18)

(In reply to jaakko.haarla from comment #17)

If I start a second firefox from terminal (case 2), does it really make a separate process or just some sub-process for the first one?

If no separate profile is specified, then the second process will hand over to the first, which will create a new window or tab.
A separate profile can be specified for a separate process:

% mkdir fx-profile
% firefox -profile fx-profile

Thank. I tried two firefox with separate profiles and it seems I cannot replicate the crash while using x11trace. So one firefox or two separate firefox processes with x11trace will not reproduce the crash.

It crashes only when I start main firefox process without x11trace and then fire up another firefox with x11trace but using the same profile. But this produces only the small(partial?) log-file.

Will the x11trace do any sanity check for the passthrough communication? It seems weird that using x11trace will prevent the crash somehow.

(In reply to jaakko.haarla from comment #19)

Will the x11trace do any sanity check for the passthrough communication?

From what I've seen, no. e.g. it passes through requests and responses that it does not understand.

It seems weird that using x11trace will prevent the crash somehow.

There would be some timing differences, which plausibly might be involved. I don't have anything more than speculation.

Version: Firefox 101 → Firefox 102

Fedora updated to Firefox 102.0. Same behavior as before. Crash without x11trace. Doesn't crash with x11trace.

I'm out of ideas so hopefully someone else can replicate this bug.

Version: Firefox 102 → Firefox 103

I can reproduce this bug on openSUSE Tumbleweed, x11 Plasma. Nvidia 525.53-15.1 drivers, Firefox 107.0 (64-bit). Same thing, open a new window, leave a youtube video playing, and then double clicking to select text will instantly or almost instantly freeze Firefox. The video's audio keeps playing, and a crash isn't recorded. Same thing happens on a new profile and disabling hardware media decoding. I will leave attached the contents of about:support.

Attached file about:support page (deleted) —
Priority: -- → P3

Can you run with MOZ_LOG="Widget:5 WidgetClipboard:5" on terminal, reproduce the issue and attach terminal output here?
Thanks.

Flags: needinfo?(ale.aparicio2000)

Doing this opened Firefox to a tab that said:
File not found. Firefox can’t find the file at /home/ale/MOZ_LOG=Widget:5 WidgetClipboard:5.
Check the file name for capitalization or other typing errors.
Check to see if the file was moved, renamed or deleted.

The terminal output is:
firefox MOZ_LOG="Widget:5 WidgetClipboard:5"
[GFX1-]: glxtest: VA-API test failed: failed to initialise VAAPI connection.
kf.i18n: KLocalizedString: Using an empty domain, fix the code. msgid: "Mozilla Firefox" msgid_plural: "" msgctxt: ""
[2022-11-23T21:30:43Z ERROR glean_core::metrics::ping] Invalid reason code startup for ping background-update
[2022-11-23T21:31:07Z ERROR mp4parse] Found 2 nul bytes in "\0\0"
[2022-11-23T21:31:07Z ERROR mp4parse] Found 2 nul bytes in "\0\0"
[2022-11-23T21:31:07Z ERROR mp4parse] Found 2 nul bytes in "\0\0"
[2022-11-23T21:31:07Z ERROR mp4parse] Found 2 nul bytes in "\0\0"
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Terminated

I'm not well versed using the terminal, so if I did anything wrong let me know and I'll try again.

Flags: needinfo?(ale.aparicio2000)

Please run on terminal:

MOZ_LOG="Widget:5 WidgetClipboard:5" firefox > log.txt 2>&1

and then attach the log.txt file here.
Thanks.

Flags: needinfo?(ale.aparicio2000)
Attached file log.txt (deleted) —
Flags: needinfo?(ale.aparicio2000)

I noticed that after upgrading from fedora 36 to 37 a while ago I cannot replicate the crash anymore. Not sure what the difference was as the packages for firefox, xorg and nvidia should be based on the same version in f36 and f37.

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

Attachment

General

Creator:
Created:
Updated:
Size: