Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 559788 - firefox with musl on x86 - typing about:config leads to segfault - ABORT: Divide by zero
Summary: firefox with musl on x86 - typing about:config leads to segfault - ABORT: Div...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Gentoo musl team
URL: http://bugs.alpinelinux.org/issues/4247
Whiteboard:
Keywords:
Depends on: 559818 PR68470
Blocks: musl-porting 531846
  Show dependency tree
 
Reported: 2015-09-06 14:58 UTC by tt_1
Modified: 2017-08-26 17:56 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge.info (emerge-info-verbose.log,14.83 KB, text/plain)
2015-09-06 14:58 UTC, tt_1
Details
gdb.txt (gdb.txt,11.83 KB, text/plain)
2015-09-06 23:27 UTC, tt_1
Details
result of firefox www.google.de -g -d gdb and output of backtrace (no debugging symbols found.log,41.05 KB, text/plain)
2015-09-07 06:40 UTC, tt_1
Details
emerge.info (recent-emerge.info,4.96 KB, text/plain)
2016-05-15 16:27 UTC, tt_1
Details
output of gdb (firefox-38.8.0-about-config.crash.log,60.67 KB, text/plain)
2016-05-15 16:37 UTC, tt_1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2015-09-06 14:58:28 UTC
Created attachment 411184 [details]
emerge.info

[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 http://bugs.alpinelinux.org/issues/4247


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]
gdb.txt

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 www.google.de -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
Repositories:

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

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

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2"
CHOST="x86_64-pc-linux-gnu"
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"
DISTDIR="/usr/portage/distfiles"
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"
GENTOO_MIRRORS="ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/"
LANG="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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"
PORTAGE_TMPDIR="/var/tmp"
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"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
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]
emerge.info

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