Closed Bug 1633266 Opened 5 years ago Closed 5 years ago

Frequent crashes with error "called `Option::unwrap()` on a `None` value" (AudioThreadPriorityError)

Categories

(Core :: Audio/Video: cubeb, defect, P2)

75 Branch
All
Linux
defect

Tracking

()

VERIFIED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: jpalecek, Assigned: padenot)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (X11; Linux i686; rv:75.0) Gecko/20100101 Firefox/75.0

Steps to reproduce:

Hello,
when i browse some websites, like The Guardian, Reuters, I get frequent crashes, typically just as the article loads.

Actual results:

Crashes like these:
https://crash-stats.mozilla.org/report/index/34721275-2250-4a58-9242-fb6450200426

Expected results:

Possibly, no crash

Seems like the unwrap in From<dbus::Error>::from is failing.

Component: Untriaged → Audio/Video: cubeb
Flags: needinfo?(padenot)
Product: Firefox → Core

Unclear why this crashes, maybe this Firefox is sandboxed harder than normal ones. Easy to fix regardless.

Flags: needinfo?(padenot)
Assignee: nobody → padenot
Status: UNCONFIRMED → NEW
Ever confirmed: true

Depends on D72636

Status: NEW → ASSIGNED
OS: Unspecified → Linux
Priority: -- → P2
Hardware: Unspecified → All
Pushed by padenot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/36cb992cb56a Bump audio_thread_priority to 0.22.1. r=kinetik

Hrm screwed up and landed only one of the two patches.

Flags: needinfo?(padenot)
Just out of curiosity, I checked what was failing by stracing firefox and found: 1. setpriority was indeed failing, but adding CAP_SYS_NICE to firefox didn't help (ie. setpriority succeeds, firefox crashes) 2. the strace contains strange entries. - socketcall failing due to seccomp and - rt_sigreturn failing with ENAMETOOLONG? Never heard of it ```

(In reply to Jiri Palecek from comment #9)

Just out of curiosity, I checked what was failing by stracing firefox and
found:

  1. setpriority was indeed failing, but adding CAP_SYS_NICE to firefox didn't
    help (ie. setpriority succeeds, firefox crashes)
  2. the strace contains strange entries.
  • socketcall failing due to seccomp and
  • rt_sigreturn failing with ENAMETOOLONG? Never heard of it

The socket failing is intentional: in you configuration, this process is sandboxed and we can't promote thread this way: they are promoted differently, from another process, but we still try it here, because some users have special configuration that let it succeed. The issue is that this was supposed to fail without crashing, this is what I'm fixing here. You'll be able to check tomorrow in a Nightly build if it's fixed (I can't reproduce unfortunately).

I'm curious why you're facing this, do you have any special configuration on your machine? Is it a build from a distro? As far as I know, we have only around 20 crashes with this signature, so something is different from all other configurations, if I can find what it is, I might be able to make this work better.

When succeeding in playing audio, and while audio is playing, what does the following command output:

ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm -T | grep RR

This checks what threads are real-time currently on the machine. If this succeeds, then there should be a few thread with names starting with AudioIPC.

Flags: needinfo?(jpalecek)

When succeeding in playing audio, and while audio is playing, what does the following command output:

ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm -T | grep RR

This checks what threads are real-time currently on the machine. If this succeeds, then there should be a few thread with names starting with AudioIPC.

Does youtube suffice in this case? I only got this:

$ ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm -T | grep RR
 7419  7430 TS       -   0  19   0  0.0 SLl  -              TRR Background
Flags: needinfo?(jpalecek)

Yep it doesn't work for you. I need more info to understand why, if you could answer this:

I'm curious why you're facing this, do you have any special configuration on your machine? Is it a build from a distro? As far as I know, we have only around 20 crashes with this signature, so something is different from all other configurations, if I can find what it is, I might be able to make this work better.

(In reply to Paul Adenot (:padenot) from comment #12)

Yep it doesn't work for you. I need more info to understand why, if you could answer this:

I'm curious why you're facing this, do you have any special configuration on your machine? Is it a build from a distro? As far as I know, we have only around 20 crashes with this signature, so something is different from all other configurations, if I can find what it is, I might be able to make this work better.

Sorry my bad. It is normal Debian packaging, and nothing special i know of, even though i386 architecture and iso8859-2 locale could be borderline special. Reportbug gives:

Package: firefox
Version: 75.0-2

-- Extensions information
Name: Amazon.com
Location: /usr/lib/firefox/browser/omni.ja
Status: enabled

Name: Ant Video downloader
Location: ${PROFILE_EXTENSIONS}/anttoolbar@ant.com.xpi
Status: user-disabled

Name: Bing
Location: /usr/lib/firefox/browser/omni.ja
Status: enabled

Name: Clearly
Location: ${PROFILE_EXTENSIONS}/readable@evernote.com.xpi
Status: app-disabled

Name: ClixAddon
Location: ${PROFILE_EXTENSIONS}/jid1-wKRSK9TpFpr9Hw@jetpack.xpi
Status: enabled

Name: Dark theme
Location: /usr/lib/firefox/browser/omni.ja
Status: user-disabled

Name: Default theme
Location: /usr/lib/firefox/omni.ja
Status: enabled

Name: DoH Roll-Out

-- Addons package information

-- System Information:
Debian Release: 10.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'unstable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: i386 (i686)
Foreign Architectures: amd64

Kernel: Linux 5.5.0-rc5-686-pae (SMP w/2 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=cs_CZ, LC_CTYPE=cs_CZ (charmap=ISO-8859-2), LANGUAGE=cs_CZ (charmap=ISO-8859-2)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages firefox depends on:
ii  debianutils         4.9.1
ii  fontconfig          2.13.1-4
ii  libatk1.0-0         2.36.0-2
ii  libc6               2.30-4
ii  libcairo-gobject2   1.16.0-4
ii  libcairo2           1.16.0-4
ii  libdbus-1-3         1.12.16-2
ii  libdbus-glib-1-2    0.110-4
ii  libevent-2.1-7      2.1.11-stable-1
ii  libffi7             3.3-3
ii  libfontconfig1      2.13.1-4
ii  libfreetype6        2.10.1-2
ii  libgcc-s1           10-20200418-1
ii  libgdk-pixbuf2.0-0  2.40.0+dfsg-1
ii  libglib2.0-0        2.64.2-1
ii  libgtk-3-0          3.24.18-1
ii  libnspr4            2:4.25-1
ii  libnss3             2:3.51-1
ii  libpango-1.0-0      1.44.7-4
ii  libstdc++6          10-20200418-1
ii  libvpx6             1.8.2-dmo1
ii  libx11-6            2:1.6.9-2
ii  libx11-xcb1         2:1.6.9-2
ii  libxcb-shm0         1.14-2
ii  libxcb1             1.14-2
ii  libxcomposite1      1:0.4.5-1
ii  libxdamage1         1:1.1.5-1
ii  libxext6            2:1.3.3-1+b2
ii  libxfixes3          1:5.0.3-1
ii  libxrender1         1:0.9.10-1
ii  libxt6              1:1.1.5-1+b3
ii  procps              2:3.3.16-4
ii  zlib1g              1:1.2.11.dfsg-2

Versions of packages firefox recommends:
ii  libavcodec58  10:4.2.2-dmo8

Versions of packages firefox suggests:
ii  fonts-lmodern          2.004.5-5
ii  fonts-stix [otf-stix]  1.1.1-3
ii  libcanberra0           0.30-7
ii  libgssapi-krb5-2       1.17-5
ii  libgtk2.0-0            2.24.32-4
pn  pulseaudio             <none>

-- no debconf information
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77

(In reply to Paul Adenot (:padenot) from comment #12)

Yep it doesn't work for you. I need more info to understand why, if you could answer this:

I'm curious why you're facing this, do you have any special configuration on your machine? Is it a build from a distro? As far as I know, we have only around 20 crashes with this signature, so something is different from all other configurations, if I can find what it is, I might be able to make this work better.

Oh, after thinking about it, I think I can see what is the "special configuration on my machine". Could it be that I don't have pulseaudio installed? Debian still builds packages with alsa.

And I can see in the Nightly build it doesn't crash anymore.

Status: RESOLVED → VERIFIED

(In reply to Jiri Palecek from comment #15)

(In reply to Paul Adenot (:padenot) from comment #12)

Yep it doesn't work for you. I need more info to understand why, if you could answer this:

I'm curious why you're facing this, do you have any special configuration on your machine? Is it a build from a distro? As far as I know, we have only around 20 crashes with this signature, so something is different from all other configurations, if I can find what it is, I might be able to make this work better.

Oh, after thinking about it, I think I can see what is the "special configuration on my machine". Could it be that I don't have pulseaudio installed? Debian still builds packages with alsa.

For sure. You need rtkit for all this to work, usually it's a dependency of pulseaudio (but you don't need to effectively use pulse to get those real-time threads). I believe you can install rtkit without pulseaudio, but I haven't tried.

(In reply to Paul Adenot (:padenot) from comment #17)

(In reply to Jiri Palecek from comment #15)

(In reply to Paul Adenot (:padenot) from comment #12)

Yep it doesn't work for you. I need more info to understand why, if you could answer this:

I'm curious why you're facing this, do you have any special configuration on your machine? Is it a build from a distro? As far as I know, we have only around 20 crashes with this signature, so something is different from all other configurations, if I can find what it is, I might be able to make this work better.

Oh, after thinking about it, I think I can see what is the "special configuration on my machine". Could it be that I don't have pulseaudio installed? Debian still builds packages with alsa.

For sure. You need rtkit for all this to work, usually it's a dependency of pulseaudio (but you don't need to effectively use pulse to get those real-time threads). I believe you can install rtkit without pulseaudio, but I haven't tried.

I tried installing rtkit and now I indeed see the real time thread AudioIPC. However FF 75 still crashes regardless (with the same signature).

(In reply to Jiri Palecek from comment #18)

I tried installing rtkit and now I indeed see the real time thread AudioIPC. However FF 75 still crashes regardless (with the same signature).

As a workaround until the patch done in this bug is in a stable version, I believe you can go to about:config, type media.audiograph.single_thread.enabled, and flip that to false (it should be to true by default). This prevents another object called AudioWorklet to work, but AudioWorklet is only enabled in 76.

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

Attachment

General

Created:
Updated:
Size: