Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 596238 - net-libs/nodejs-6.7.0: 2967419 Segmentation fault in .../work/node-v6.7.0/out/Release/mksnapshot --startup_src .../work/node-v6.7.0/out/Release/obj.target/v8_snapshot/geni/snapshot
Summary: net-libs/nodejs-6.7.0: 2967419 Segmentation fault in .../work/node-v6.7.0/out...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jeroen Roovers (RETIRED)
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks:
 
Reported: 2016-10-05 13:19 UTC by Anton Kochkov
Modified: 2019-04-17 09:02 UTC (History)
4 users (show)

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


Attachments
nodejs_build.log.gz (nodejs_build.log.gz,38.82 KB, application/gzip)
2016-10-05 13:20 UTC, Anton Kochkov
Details
hardened-nodejs-4.4.6-build.log (hardened-nodejs-4.4.6-build.log,302.32 KB, text/plain)
2016-11-03 16:20 UTC, Damien Thébault
Details
hardened-nodejs-4.6.1-build.log (hardened-nodejs-4.6.1-build.log,302.37 KB, text/plain)
2016-11-03 16:21 UTC, Damien Thébault
Details
hardened-nodejs-7.0.0-build.log.gz (hardened-nodejs-7.0.0-build.log.gz,54.89 KB, application/gzip)
2016-11-03 16:21 UTC, Damien Thébault
Details
hardened-emerge-info.txt (hardened-emerge-info.txt,5.04 KB, text/plain)
2016-11-03 16:21 UTC, Damien Thébault
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Kochkov 2016-10-05 13:19:36 UTC
LD_LIBRARY_PATH=/var/tmp/portage/net-libs/nodejs-6.7.0/work/node-v6.7.0/out/Release/lib.host:/var/tmp/portage/net-libs/nodejs-6.7.0/work/node-v6.7.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/tools/gyp; mkdir -p /var/tmp/portage/net-libs/nodejs-6.7.0/work/node-v6.7.0/out/Release/obj.target/v8_snapshot/geni; "/var/tmp/portage/net-libs/nodejs-6.7.0/work/node-v6.7.0/out/Release/mksnapshot" --startup_src "/var/tmp/portage/net-libs/nodejs-6.7.0/work/node-v6.7.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc" ""
/bin/sh: line 1: 2967419 Segmentation fault      "/var/tmp/portage/net-libs/nodejs-6.7.0/work/node-v6.7.0/out/Release/mksnapshot" --startup_src "/var/tmp/portage/net-libs/nodejs-6.7.0/work/node-v6.7.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc" ""
make: *** [deps/v8/tools/gyp/v8_snapshot.target.mk:13: /var/tmp/portage/net-libs/nodejs-6.7.0/work/node-v6.7.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc] Error 139
make: *** Waiting for unfinished jobs....
make: Leaving directory '/var/tmp/portage/net-libs/nodejs-6.7.0/work/node-v6.7.0/out'


Portage 2.3.1 (python 2.7.12-final-0, hardened/linux/amd64/no-multilib, gcc-5.3.0, glibc-2.23-r2, 3.3.2-hardened x86_64)
=================================================================
System uname: Linux-3.3.2-hardened-x86_64-Intel-R-_Core-TM-_i7_CPU_930_@_2.80GHz-with-gentoo-2.3
KiB Mem:     8167824 total,   3541572 free
KiB Swap:   16016792 total,  15887488 free
Timestamp of repository gentoo: Wed, 05 Oct 2016 11:15:01 +0000
sh bash 4.4
ld GNU ld (Gentoo 2.26.1 p1.0) 2.26.1
app-shells/bash:          4.4::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.12::gentoo, 3.5.2::gentoo
dev-util/cmake:           3.6.2::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.22.1::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.69-r2::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.26.1::gentoo
sys-devel/gcc:            5.3.0::gentoo, 5.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.7::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo
Repositories:

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

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

gentoo-xvilka
    location: /var/lib/layman/gentoo-xvilka
    masters: gentoo
    priority: 1

godin
    location: /var/lib/layman/godin
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -mtune=generic -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind /var/qmail/alias /var/qmail/control /var/spool/munin-async/.ssh /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /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=core2 -mtune=generic -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 sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cvs cxx dri gdbm git gnutls hardened iconv ipv6 justify lighttpd mercurial mmx mmxext modules ncurses nls nptl openmp pam pax_kernel pcre perl php pie postgresql python readline sbcl seccomp session sse sse2 sse4 ssl ssp ssse3 subversion tcpd unicode urandom xattr xml xmlrpc xsl xtpax zlib" ABI_X86="64" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby21 ruby22" USERLAND="GNU" 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, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Anton Kochkov 2016-10-05 13:20:35 UTC
Created attachment 449228 [details]
nodejs_build.log.gz
Comment 2 Tomáš Mózes 2016-10-07 04:27:54 UTC
Works here:

net-libs/nodejs-6.7.0::gentoo was built with the following:
USE="npm snapshot ssl -debug -doc -icu -test" ABI_X86="64" CPU_FLAGS_X86="sse2" PYTHON_TARGETS="python2_7"

Try setting different MAKEOPTS.
Comment 3 Anton Kochkov 2016-10-19 11:53:56 UTC
(In reply to Tomáš Mózes from comment #2)
> Works here:
> 
> net-libs/nodejs-6.7.0::gentoo was built with the following:
> USE="npm snapshot ssl -debug -doc -icu -test" ABI_X86="64"
> CPU_FLAGS_X86="sse2" PYTHON_TARGETS="python2_7"
> 
> Try setting different MAKEOPTS.

MAKEOPTS="-j1" - still same error. It's unrelated.
Comment 4 Damien Thébault 2016-11-03 16:19:40 UTC
I have the issue as well on my hardened gentoo.

4.4.1 worked apparently fine.
4.4.6 segfaults on mksnapshot.
4.6.1 segfaults on mksnapshot.
7.0.0 segfaults on mksnapshot.

I tried with MAKEOPTS="-j1" and got the same result.
Comment 5 Damien Thébault 2016-11-03 16:20:45 UTC
Created attachment 452270 [details]
hardened-nodejs-4.4.6-build.log
Comment 6 Damien Thébault 2016-11-03 16:21:01 UTC
Created attachment 452272 [details]
hardened-nodejs-4.6.1-build.log
Comment 7 Damien Thébault 2016-11-03 16:21:34 UTC
Created attachment 452274 [details]
hardened-nodejs-7.0.0-build.log.gz
Comment 8 Damien Thébault 2016-11-03 16:21:54 UTC
Created attachment 452276 [details]
hardened-emerge-info.txt
Comment 9 Anton Kochkov 2016-11-30 15:55:16 UTC
Not much changed I bet, but it reproduces also on net-libs/nodejs-7.2.0.
Comment 10 Damien Thébault 2017-02-01 13:18:24 UTC
Still reproduced on nodejs 7.4.0, but the following workaround [1] allowed me to install it anyway (to not have vulnerability GLSA 201612-43 [2] on my system).

[1] https://bugs.gentoo.org/show_bug.cgi?id=539342#c4
[2] https://security.gentoo.org/glsa/201612-43
Comment 11 Anton Kochkov 2017-05-09 11:10:25 UTC
Still in 7.9.0
```
ector_protocol_json.h"
  LD_LIBRARY_PATH=/var/tmp/portage/net-libs/nodejs-7.9.0/work/node-v7.9.0/out/Release/lib.host:/var/tmp/portage/net-libs/nodejs-7.9.0/work/node-v7.9.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/src; mkdir -p /var/tmp/portage/net-libs/nodejs-7.9.0/work/node-v7.9.0/out/Release/obj.target/v8_snapshot/geni; "/var/tmp/portage/net-libs/nodejs-7.9.0/work/node-v7.9.0/out/Release/mksnapshot" --startup_src "/var/tmp/portage/net-libs/nodejs-7.9.0/work/node-v7.9.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc" ""

<--- Last few GCs --->

[3736333:0xf347414f260] 21241353229 ms: Mark-sweep 0.1 (3.0) -> 0.1 (3.0) MB, 0.2 / 0.0 ms  allocation failure GC in old space requested
[3736333:0xf347414f260] 21241353229 ms: Mark-sweep 0.1 (3.0) -> 0.1 (3.0) MB, 0.2 / 0.0 ms  last resort 
[3736333:0xf347414f260] 21241353229 ms: Mark-sweep 0.1 (3.0) -> 0.1 (3.0) MB, 0.2 / 0.0 ms  last resort 


<--- JS stacktrace --->


#
# Fatal javascript OOM in CALL_AND_RETRY_LAST
#

/bin/sh: line 1: 3736333 Illegal instruction     "/var/tmp/portage/net-libs/nodejs-7.9.0/work/node-v7.9.0/out/Release/mksnapshot" --startup_src "/var/tmp/portage/net-libs/nodejs-7.9.0/work/node-v7.9.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc" ""
make: *** [deps/v8/src/v8_snapshot.target.mk:13: /var/tmp/portage/net-libs/nodejs-7.9.0/work/node-v7.9.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc] Error 132
make: *** Waiting for unfinished jobs....
make: Leaving directory '/var/tmp/portage/net-libs/nodejs-7.9.0/work/node-v7.9.0/out'
 * ERROR: net-libs/nodejs-7.9.0::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=net-libs/nodejs-7.9.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=net-libs/nodejs-7.9.0::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/net-libs/nodejs-7.9.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-libs/nodejs-7.9.0/temp/environment'.
 * Working directory: '/var/tmp/portage/net-libs/nodejs-7.9.0/work/node-v7.9.0'
 * S: '/var/tmp/portage/net-libs/nodejs-7.9.0/work/node-v7.9.0'

```
Comment 12 Anton Kochkov 2017-06-13 10:49:19 UTC
Still in 8.1.0:

  LD_LIBRARY_PATH=/var/tmp/portage/net-libs/nodejs-8.1.0/work/node-v8.1.0/out/Release/lib.host:/var/tmp/portage/net-libs/nodejs-8.1.0/work/node-v8.1.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/src; mkdir -p /var/tmp/portage/net-libs/nodejs-8.1.0/work/node-v8.1.0/out/Release/obj.target/v8_snapshot/geni; "/var/tmp/portage/net-libs/nodejs-8.1.0/work/node-v8.1.0/out/Release/mksnapshot" --startup_src "/var/tmp/portage/net-libs/nodejs-8.1.
0/work/node-v8.1.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc" ""

<--- Last few GCs --->

[2670228:0xc711eb65c80] 2197169569 ms: Mark-sweep 0.1 (3.0) -> 0.1 (3.0) MB, 0.3 / 0.0 ms  allocation failure GC in old space requested
[2670228:0xc711eb65c80] 2197169569 ms: Mark-sweep 0.1 (3.0) -> 0.1 (3.0) MB, 0.2 / 0.0 ms  last resort 
[2670228:0xc711eb65c80] 2197169569 ms: Mark-sweep 0.1 (3.0) -> 0.1 (3.0) MB, 0.2 / 0.0 ms  last resort 


<--- JS stacktrace --->


#
# Fatal javascript OOM in CALL_AND_RETRY_LAST
#

/bin/sh: line 1: 2670228 Illegal instruction     "/var/tmp/portage/net-libs/nodejs-8.1.0/work/node-v8.1.0/out/Release/mksnapshot" --startup_src "/var/tmp/portage/net-libs/nodejs-8.1.0/work/node-v8.1.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc" ""
make: *** [deps/v8/src/v8_snapshot.target.mk:13: /var/tmp/portage/net-libs/nodejs-8.1.0/work/node-v8.1.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc] Error 132
make: *** Waiting for unfinished jobs....
rm 0160c75d03e666b2da9efdea33bf816603f4dadd.intermediate
make: Leaving directory '/var/tmp/portage/net-libs/nodejs-8.1.0/work/node-v8.1.0/out'
 * ERROR: net-libs/nodejs-8.1.0::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=net-libs/nodejs-8.1.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=net-libs/nodejs-8.1.0::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/net-libs/nodejs-8.1.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-libs/nodejs-8.1.0/temp/environment'.
 * Working directory: '/var/tmp/portage/net-libs/nodejs-8.1.0/work/node-v8.1.0'
 * S: '/var/tmp/portage/net-libs/nodejs-8.1.0/work/node-v8.1.0'
Comment 13 Damien Thébault 2017-06-16 12:18:00 UTC
I had a look at this the last time I upgraded.

Because the ebuild does include "pax-mark m [...] mksnapshot".

After digging a little bit, it appears that I was using PT_PAX instead of XATTR_PAX, and this was the problem because PT_PAX is deprecated.

I migrated to XATTR_PAX, with the help of the wiki:
https://wiki.gentoo.org/wiki/Hardened/PaX_flag_migration_from_PT_PAX_to_XATTR_PAX

Now the elfix tests are passing without any error.
And I can install nodejs (e.g. 7.7.2) without any mksnapshot issue.

For me this is resolved.
Maybe you can have a look to see if it's the same problem for you ?
Comment 14 User3569 2017-07-03 03:04:30 UTC
(In reply to Damien Thébault from comment #13)
> For me this is resolved.
> Maybe you can have a look to see if it's the same problem for you ?

This worked for me with 8.1.2. Thanks!
Comment 15 Anton Kochkov 2017-09-18 06:52:18 UTC
Note for everyone with the same problem (copy from another bug):

0. emerge -a net-libs/nodejs
1. paxctl -xm /var/tmp/portage/net-libs/nodejs-8.5.0/work/node-8.5.0/out/Release/mksnapshot
2. ebuild /usr/portage/net-libs/nodejs/nodejs-8.5.0.ebuild merge
Comment 16 Attila Tóth 2017-12-01 12:23:03 UTC
I think this bug has at least some common elements with this:
https://bugs.gentoo.org/579712
Comment 17 Anton Kochkov 2019-04-17 08:04:53 UTC
I think this one can be closed, since the grsecurity kernels are now unavailable.