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

Bug 453780

Summary: www-client/elinks-0.12_pre6[javascript] + spidermonkey-1.8.5-r4: elinks freezes on startup
Product: Gentoo Linux Reporter: Roman Žilka <roman.zilka>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: bug, fssirc, jstein
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Roman Žilka 2013-01-24 09:37:15 UTC
When compiled with USE="javascript" elinks freezes upon startup, no matter which site I'm trying to open (even none). Default config files. That's sad - js support is such a nice thing about elinks. According to strace, it's caught in some kind of endless mmap->munmap loop. Compiled with no CFLAGS/CXXFLAGS/LDFLAGS/MAKEOPTS. Problems persists even if compiled with all USE flags except "javascript" turned off.

Elinks runs OK with js support when compiled against spidermonkey-1.8.7-r3, but that's currently hardmasked. Spidermonkey-1.8.5-r4 - the latest ~amd64 - doesn't do the job.

https://bugzilla.redhat.com/show_bug.cgi?id=798103 seems to have found a solution to this issue, but their patch makes no difference on my system.

I also tried spidermonkey-1.8.5-r1 and elinks-0.13-20130124 (latest experimental from official git), but the problem remains the same. The config was:
./configure --disable-leds --disable-88-colors --disable-256-colors --disable-true-color --disable-html-highlight --without-gpm --without-zlib --without-bzlib --without-x --without-lua --without-guile --without-perl --without-ruby --without-idn --with-spidermonkey --disable-bittorrent --disable-nls --disable-ipv6 --disable-ftp --disable-gopher --disable-nntp --disable-finger --disable-smb --disable-mouse --disable-fastmem --without-openssl --without-gnutls

Is the reason for spidermonkey-1.8.7 being hardmasked still valid?

I use the hardened kernel sources, but there are no log reports from grsec about app blockages. Also, elinks used to run fine for me about a year ago (with then latest stable gentoo elinks and spidermonkey pkgs) with grsec.

Reproducible: Always




# emerge --info elinks spidermonkey
Portage 2.1.11.31 (hardened/linux/amd64, gcc-4.6.3, glibc-2.15-r3, 3.7.0 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.7.0-x86_64-Intel-R-_Core-TM-_i5-2520M_CPU_@_2.50GHz-with-gentoo-2.1
Timestamp of tree: Wed, 23 Jan 2013 19:15:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -fomit-frame-pointer -march=core2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes -mpclmul -mpopcnt -mcx16"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -fomit-frame-pointer -march=core2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes -mpclmul -mpopcnt -mcx16"
DISTDIR="/tmp/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs candy collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news noinfo parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.mirror.dkm.cz/pub/gentoo/ http://ftp.fi.muni.cz/pub/linux/gentoo/ http://gentoo.mirror.web4u.cz/ http://gentoo.wheel.sk/ ftp://gentoo.mirror.dkm.cz/pub/gentoo/"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--compress --compress-level=9"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/boot/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.cz.gentoo.org/gentoo-portage"
USE="X a52 aac acpi aes-ni alsa amd64 avx bash-completion berkdb bluetooth bzip2 cddb cjk cli cracklib crypt cxx dri encode ffmpeg flac fontconfig ftp gdbm geoip gif gnutls gps gzip hardened hddtemp iconv icu idn imap javascript jpeg jpeg2k justify libass lm_sensors lzma lzo matroska mbox mime mms mmx mmxext modules mp3 mp4 mpeg mplayer mudflap multilib musicbrainz ncurses nls nocd nptl ogg opengl pam pax_kernel pcre pda pdf png postscript quicktime raw readline recode session smp sockets sound spell sse sse2 sse3 sse4 sse4_1 sse4_2 ssl ssse3 svg syslog threads truetype udev unicode urandom usb v4l vdpau videos vim-syntax vorbis wifi x264 xcomposite xosd xscreensaver xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" 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 ubx" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en cs ja" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="intel vesa" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

www-client/elinks-0.12_pre5-r2 was built with the following:
USE="X bzip2 ftp idn javascript mouse (multilib) nls ssl unicode zlib -bittorrent -debug -finger -gopher -gpm -guile -ipv6 -lua -nntp -perl -ruby -samba"


dev-lang/spidermonkey-1.8.5-r1 was built with the following:
USE="(multilib) -debug -static-libs -test"
Comment 1 Roman Žilka 2013-01-24 10:11:14 UTC
By the way, elinks-0.11.7 works with javascript. It pulls in spidermonkey-1.7.0.

dev-lang/spidermonkey-1.7.0: "(multilib) -threadsafe"
www-client/elinks-0.11.7: "X bzip2 ftp idn javascript (multilib) nls ssl unicode zlib -bittorrent -debug -finger -gopher -gpm -guile -ipv6 -lua -nntp -perl -ruby"
Comment 2 Roman Žilka 2013-02-01 11:12:46 UTC
FWIW, on x86 elinks-0.12_pre5-r2 works OK even with javascript and spidermonkey-1.8.5-r1.
Comment 3 Sergey Popov gentoo-dev 2013-08-24 19:51:12 UTC
Can not reproduce this with current version of elinks too. Marking this OBSOLETE
Comment 4 Roman Žilka 2013-08-24 20:35:53 UTC
(In reply to Sergey Popov from comment #3)
> Can not reproduce this with current version of elinks too. Marking this
> OBSOLETE

The version of elinks in Portage hasn't changed - 0.12_pre5-r2. Are you not testing elinks from another repo? 0.12_pre5-r2 still freezes on my amd64 hardened (does not on x86 default).

By the way, the test phase of spidermonkey-1.8.5-r4 freezes as well - maybe it's the same catch.
Comment 5 Ian Stakenvicius (RETIRED) gentoo-dev 2013-08-29 20:45:46 UTC
Works for me -- both _pre5-r2 and _pre6 run fine (no freezes at all, and javascript content works).

I did the porting in elinks to spidermonkey-1.8.5 (and also have patches here to support 1.8.7, but that's going to be removed from the tree soon so I never committed them).  My install of spidermonkey and elinks are default, and i tested using the USE flags you had set as well.

pre6 does contain a couple of upstream fixes that related to hangs or crashes, perhaps your system for whatever reason is triggering those?
Comment 6 Roman Žilka 2013-08-31 15:30:02 UTC
I tried pre6, but the freeze is still there.

I recently ran the test phase of spidermonkey and that hangs on me as well. Right at the beginning. The catch seems to lie there. Spidermonkey 1.8.7 is OK. I don't currently have the time to make an attempt at the spidermonkey bug. But perhaps 1.8.7 can be stabilized...?
Comment 7 fssirc 2013-09-30 17:25:17 UTC
I also use hardened kernel sources and have the same problem. If the USE="javascript" flag is set, elinks-0.12_pre6 gives the message ``segmentation fault'' and stops working with the following message in the logs:

elinks[19390]: segfault at 10 ip 000002d631458f47 sp 0000039f81211d90 error 4
in libpthread-2.15.so[2d63144e000+18000]

I had to add these lines in /etc/portage/package.mask in order for elinks to work:

=www-client/elinks-0.12_pre6
=www-client/elinks-0.12_pre5-r2

The version 0.11.7, which requires dev-lang/spidermonkey-1.7.0, compiles normally on my system.

emerge --info elinks spidermonkey
Portage 2.2.1 (hardened/linux/amd64/selinux, gcc-4.7.3, glibc-2.15-r3, 3.10.1-hardened-r1-gnu x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.10.1-hardened-r1-gnu-x86_64-Pentium-R-_Dual-Core_CPU_T4200_@_2.00GHz-with-gentoo-2.2
KiB Mem:     3006656 total,   1244836 free
KiB Swap:     497660 total,    497660 free
Timestamp of tree: Sun, 29 Sep 2013 00:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r2, 3.2.5-r2
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
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 selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.bloodhost.ru/ http://mirror2.corbina.ru/gentoo-distfiles/ ftp://xeon.gentoo.ru/mirrors/gentoo/distfiles/ http://mirror.yandex.ru/gentoo-distfiles/ ftp://mirror.yandex.ru/gentoo-distfiles/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
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"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC=""
USE="alsa amd64 berkdb bindist bzip2 cdr cli cracklib crypt cxx dri dvd gdbm hardened iconv ipv6 justify mmx modules mudflap multilib ncurses nls nptl open_perms openmp pam pax_kernel pcre readline selinux session sse sse2 ssl tcpd unicode urandom zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id 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" 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 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" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="intel" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

www-client/elinks-0.11.7 was built with the following:
USE="X bzip2 ipv6 javascript (multilib) nls (selinux) ssl unicode zlib -bittorrent -debug -finger -ftp -gopher -gpm -guile -idn -lua -nntp -perl -ruby" ABI_X86="64"


dev-lang/spidermonkey-1.7.0 was built with the following:
USE="(multilib) (selinux) -threadsafe" ABI_X86="64"
Comment 8 Marcin Mirosław 2015-12-02 16:22:37 UTC
I'm using hardened-sources, also I've got segfault (spidermonkey-1.8.5-r4:0/mozjs185::gentoo). Here is backtrace:


# gdb -q /usr/bin/elinks 'core-1449073007-0-11-!usr!bin!elinks-5096'
Reading symbols from /usr/bin/elinks...Reading symbols from /usr/lib64/debug//usr/bin/elinks.debug...done.
done.
[New LWP 5096]
[New LWP 5099]
[New LWP 5098]
[New LWP 5097]

warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `elinks'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __GI___pthread_mutex_lock (mutex=0x0) at ../nptl/pthread_mutex_lock.c:67
67        unsigned int type = PTHREAD_MUTEX_TYPE_ELISION (mutex);
(gdb) bt
#0  __GI___pthread_mutex_lock (mutex=0x0) at ../nptl/pthread_mutex_lock.c:67
#1  0x000003ad7752919f in PR_Lock () from /usr/lib64/libnspr4.so
#2  0x000003ad77fd7ec6 in AutoLockGC (rt=0x2a1e9f8580, this=<synthetic pointer>) at jscntxt.h:2601
#3  finish (rt=0x2a1e9f8580, this=0x2a1e9f87f8) at jsgc.cpp:2048
#4  js_FinishGC (rt=rt@entry=0x2a1e9f8580) at jsgc.cpp:869
#5  0x000003ad77f545b7 in JSRuntime::~JSRuntime (this=0x2a1e9f8580, __in_chrg=<optimized out>) at jsapi.cpp:696
#6  0x000003ad77f546ff in JS_Finish (rt=0x2a1e9f8580) at jsapi.cpp:763
#7  0x000003ad77f64e65 in JS_Init (maxbytes=maxbytes@entry=4194304) at jsapi.cpp:753
#8  0x0000002a1df8338a in spidermonkey_runtime_addref () at spidermonkey-shared.c:47
#9  0x0000002a1df8367b in spidermonkey_init (xxx=<optimized out>) at spidermonkey.c:143
#10 0x0000002a1df965a7 in init_module (module=0x2a1e0348a0 <spidermonkey_module>) at module.c:116
#11 0x0000002a1df965d5 in init_module (module=0x2a1e034580 <ecmascript_module>) at module.c:120
#12 0x0000002a1df96855 in init_modules (modules=0x2a1e03bb80 <builtin_modules>) at module.c:173
#13 0x0000002a1df96079 in init () at main.c:184
#14 0x0000002a1df96fe6 in select_loop (init=0x2a1df95e10 <init>) at select.c:222
#15 0x0000002a1df2efd8 in main (argc=1, argv=0x3ed92a8e8a8) at main.c:353
(gdb) l
62      __pthread_mutex_lock (mutex)
63           pthread_mutex_t *mutex;
64      {
65        assert (sizeof (mutex->__size) >= sizeof (mutex->__data));
66
67        unsigned int type = PTHREAD_MUTEX_TYPE_ELISION (mutex);
68
69        LIBC_PROBE (mutex_entry, 1, mutex);
70
71        if (__builtin_expect (type & ~(PTHREAD_MUTEX_KIND_MASK_NP
(gdb)
Comment 9 Pacho Ramos gentoo-dev 2017-10-12 07:01:44 UTC
Retry with 0.12_pre6-r2 please