Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 559788

Summary: firefox with musl on x86 - typing about:config leads to segfault - ABORT: Divide by zero
Product: Gentoo Linux Reporter: tt_1 <herrtimson>
Component: [OLD] UnspecifiedAssignee: Gentoo musl team <musl>
Severity: normal CC: blueness, herrtimson, mozilla, musl, tsmksubc
Priority: Normal    
Version: unspecified   
Hardware: x86   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on: 559818, 583266    
Bug Blocks: 430702, 531846    
result of firefox -g -d gdb and output of backtrace
output of gdb

Description tt_1 2015-09-06 14:58:28 UTC
Created attachment 411184 [details]

[31508] ###!!! ABORT: Divide by zero: file /var/tmp/portage/www-client/firefox-40.0.3-r99/work/mozilla-release/toolkit/xre/nsSigHandlers.cpp, line 154
Segmentation fault

happens with firefox-38.0.5-r99 as well as with the up to date 40.0.3-r99. 

There are also users from Alpine, having the same problem. See

my useflags are 

USE="dbus gstreamer jemalloc3 minimal system-cairo system-icu system-jpeg system-libvpx system-sqlite -bindist -custom-cflags -custom-optimization -debug -egl -gmp-autoupdate -gstreamer-0 (-hardened) -jit (-neon) (-pgo) -pulseaudio (-selinux) -startup-notification -test -wifi"
Comment 1 Felix Janda 2015-09-06 17:09:56 UTC
Could you emerge with debug use flag and provide a backtrace with gdb?
Maybe attach the build log as well.
Comment 2 tt_1 2015-09-06 18:36:54 UTC
I have never debugged a programm, so this would need some more information. Wrote you an email with my questions to not to have too much spam here.
Comment 3 tt_1 2015-09-06 23:27:38 UTC
Created attachment 411218 [details]

output of gdb firefox and then backtrace. 

is it helpfull at all?
Comment 4 tt_1 2015-09-07 06:40:11 UTC
Created attachment 411230 [details]
result of firefox -g -d gdb and output of backtrace
Comment 5 dashmz 2015-11-17 12:57:08 UTC
Any news on this issue? I keep getting this error for a few days now.
Comment 6 Jory A. Pratt gentoo-dev 2015-11-17 13:08:02 UTC
(In reply to dashmz from comment #5)
> Any news on this issue? I keep getting this error for a few days now.

add to pref.js via ${HOME}/.mozilla/firefox/*./prefs.js

pref("layers.acceleration.force-enabled",              true);
pref("webgl.force-enabled",              true);

make sure you do this while firefox is shut down.
Comment 7 Jory A. Pratt gentoo-dev 2015-11-17 13:10:16 UTC
(In reply to dashmz from comment #5)
> Any news on this issue? I keep getting this error for a few days now.

I also wanted to point out your using an experimental libc things are not fixed immediately for this setup. You will need to be able to provide patches if you are wanting to see problems like this resolved in a much faster manner whether it be via the mozilla overlay, musl overlay, or even the tree.
Comment 8 tt_1 2015-11-17 21:44:18 UTC
I just had a look if the bug is still occuring. On amd64 with recent firefox-esr, which is 38.4, there is no segfault when typing about:config. 

@ dashmz - are you on x86? posting your emerge --info output could be eventually helpfull. 

By the way, musl has no bugtracker and neither has the musl overlay. So I am posting faults and bugs here in the hope that it may be helpfull. If I don't get any answer or help, that's ok, I'm not using it as a production system anyway.
Comment 9 dashmz 2015-11-28 13:25:14 UTC
@  tt_1 

Portage 2.2.26 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop/gnome, gcc-4.9.3, glibc-2.22-r1, 4.3.0-gentoo x86_64)
System uname: Linux-4.3.0-gentoo-x86_64-Intel-R-_Core-TM-_i5-3550_CPU_@_3.30GHz-with-gentoo-2.2
KiB Swap:   23500792 total,  23500448 free
Timestamp of repository gentoo: Sat, 28 Nov 2015 10:00:01 +0000
sh bash 4.3_p42
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.22.0::gentoo
dev-lang/python:          2.7.10-r3::gentoo, 3.4.3-r2::gentoo, 3.5.0-r1::gentoo
dev-util/cmake:           3.4.0-r1::gentoo
dev-util/pkgconfig:       0.29::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.18.3::gentoo
sys-apps/sandbox:         2.9::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.12.6::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r1::gentoo

    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://
    priority: -1000

    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-march=native -O2"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="32bit 64bit X a52 aac aalib accessibility acl acpi aiglx alsa amd64 apm ares audiofile avi berkdb bigger-fonts bitmap-fonts boost branding bzip2 cairo ccache cdda cdparanoia cdrom clang cleartype cli colord consolekit corefonts cpudetection cracklib crypt css ctype curl cxx dbus device-mapper dhcp dri dts dvd dvdr encode exif expat fbcon ffmpeg flac fortran ftp fuse gconf gd gdbm gif glamor glut gmp gnutls gpg gstreamer gtk gtk2 gtk3 gudev gvfs gzip i18n iconv icu idn imlib infinality introspection ipv6 jabber javafx jit jpeg jpeg2k json latex latex3 latexmk lcms libg++ libnotify libsecret libwww llvm lm_sensors logitech-mouse loop-aes lzma mad matroska md5sum memlimit menubar mjpeg mmx mmxext mng modules mouse mp3 mp4 mplayer multilib musepack musicbrainz ncurses nforce2 nls nptl nsplugin nss ntfs ogg oggvorbis opencl opencv opengl openmp openrc openssl opus pam pango pcre pdf perl php plasma plugins pmu png policykit posix postproc ppds pulseaudio purple python qt3support qt4 qt5 readline rtmp sdl seccomp session simplexml smp sndfile soap sockets sox sqlite sqlite3 sse sse-filters sse2 ssh ssl startup-notification suid svg symlink syslog system-wine systemd-units tcltk tcpd theora threads tiff timidity tokenizer tracker transcode truetype udev udisks unicode usb vaapi vcd videos vorbis webgl webkit webm wma wma123 x264 xattr xcb xcomposite xml xpm xscreensaver xsl xv xvid zip zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_core authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Comment 10 tt_1 2015-11-28 13:32:18 UTC
well, this bug is about a segfault with musl as a libc, not glibc?
Comment 11 tt_1 2016-01-01 10:56:22 UTC
@ dashmz please write me an email if it is still not working for you.
Comment 12 tt_1 2016-05-15 16:27:11 UTC
Created attachment 434350 [details]

reopening as the bug is back in firefox-38esr and firefox-46 branch. I attached a recent emerge --info
Comment 13 tt_1 2016-05-15 16:37:50 UTC
Created attachment 434358 [details]
output of gdb

the part of interest starts at line 452 

is it helpfull somehow?
Comment 14 Felix Janda 2016-05-16 10:50:43 UTC
Regarding Comment 13:
Very nice backtrace.

Assertion failure: Could not find EV root in NSS storage

has AFAIR something to do with nss and can be fixed with a different
version of nss. Anyway, that is not the initial bug.

Now the problem is a division by zero in nsTreeBodyFrame::ReflowFinished
at layout/xul/tree/nsTreeBodyFrame. I'm looking at the source of version
46 instead of 38 but the problematic division seems to be

mPageLength = mInnerBox.height / mRowHeight;

Now, either this line is not supposed to be run in this situation or
mRowHeight is not supposed to be zero. Whether the first is true can
be checked by running a amd64-build and instructing gdb to

break /var/tmp/portage/www-client/firefox-38.8.0/work/mozilla-esr38/layout/xul/tree/nsTreeBodyFrame.cpp:432

(Sorry I have no debug build of firefox lying around to test.) and
see whether firefox gets break when doing the same thing producing
the segfault on x86.

If amd64 firefox also hits this line, the next thing to check is why
mRowHeight turns out to be zero. It seems to be initialized in
nsTreeBodyFrame::GetRowHeight . Stepping through that function and
checking what happens to the variable "height" might be interesting.
Comment 15 Jory A. Pratt gentoo-dev 2017-08-26 17:56:55 UTC
If you feel I have closed your bug and it is still a current issue, please reopen and update it completely. We will not work bugs that have no ebuild in tree any longer or can not be reproduced with a current system.

Thank You for your support and understanding
The Mozilla Team