Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node and npm just segfault when compiled on alpine #3405

Closed
ghost opened this issue Oct 16, 2015 · 4 comments
Closed

node and npm just segfault when compiled on alpine #3405

ghost opened this issue Oct 16, 2015 · 4 comments
Labels
build Issues and PRs related to build files or the CI.

Comments

@ghost
Copy link

ghost commented Oct 16, 2015

node -v gives me
v4.2.1

g++ -v gives me

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/4.9.2/lto-wrapper
Target: x86_64-alpine-linux-musl
Configured with: /home/buildozer/aports/main/gcc/src/gcc-4.9.2/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 4.9.2' --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-esp --enable-cloog-backend --enable-languages=c,c++,objc,java,fortran,ada --disable-libssp --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-system-zlib
Thread model: posix
gcc version 4.9.2 (Alpine 4.9.2)

python -v gives me

# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib/python2.7/site.pyc matches /usr/lib/python2.7/site.py
import site # precompiled from /usr/lib/python2.7/site.pyc
# /usr/lib/python2.7/os.pyc matches /usr/lib/python2.7/os.py
import os # precompiled from /usr/lib/python2.7/os.pyc
import errno # builtin
import posix # builtin
# /usr/lib/python2.7/posixpath.pyc matches /usr/lib/python2.7/posixpath.py
import posixpath # precompiled from /usr/lib/python2.7/posixpath.pyc
# /usr/lib/python2.7/stat.pyc matches /usr/lib/python2.7/stat.py
import stat # precompiled from /usr/lib/python2.7/stat.pyc
# /usr/lib/python2.7/genericpath.pyc matches /usr/lib/python2.7/genericpath.py
import genericpath # precompiled from /usr/lib/python2.7/genericpath.pyc
# /usr/lib/python2.7/warnings.pyc matches /usr/lib/python2.7/warnings.py
import warnings # precompiled from /usr/lib/python2.7/warnings.pyc
# /usr/lib/python2.7/linecache.pyc matches /usr/lib/python2.7/linecache.py
import linecache # precompiled from /usr/lib/python2.7/linecache.pyc
# /usr/lib/python2.7/types.pyc matches /usr/lib/python2.7/types.py
import types # precompiled from /usr/lib/python2.7/types.pyc
# /usr/lib/python2.7/UserDict.pyc matches /usr/lib/python2.7/UserDict.py
import UserDict # precompiled from /usr/lib/python2.7/UserDict.pyc
# /usr/lib/python2.7/_abcoll.pyc matches /usr/lib/python2.7/_abcoll.py
import _abcoll # precompiled from /usr/lib/python2.7/_abcoll.pyc
# /usr/lib/python2.7/abc.pyc matches /usr/lib/python2.7/abc.py
import abc # precompiled from /usr/lib/python2.7/abc.pyc
# /usr/lib/python2.7/_weakrefset.pyc matches /usr/lib/python2.7/_weakrefset.py
import _weakrefset # precompiled from /usr/lib/python2.7/_weakrefset.pyc
import _weakref # builtin
# /usr/lib/python2.7/copy_reg.pyc matches /usr/lib/python2.7/copy_reg.py
import copy_reg # precompiled from /usr/lib/python2.7/copy_reg.pyc
# /usr/lib/python2.7/traceback.pyc matches /usr/lib/python2.7/traceback.py
import traceback # precompiled from /usr/lib/python2.7/traceback.pyc
# /usr/lib/python2.7/sysconfig.pyc matches /usr/lib/python2.7/sysconfig.py
import sysconfig # precompiled from /usr/lib/python2.7/sysconfig.pyc
# /usr/lib/python2.7/re.pyc matches /usr/lib/python2.7/re.py
import re # precompiled from /usr/lib/python2.7/re.pyc
# /usr/lib/python2.7/sre_compile.pyc matches /usr/lib/python2.7/sre_compile.py
import sre_compile # precompiled from /usr/lib/python2.7/sre_compile.pyc
import _sre # builtin
# /usr/lib/python2.7/sre_parse.pyc matches /usr/lib/python2.7/sre_parse.py
import sre_parse # precompiled from /usr/lib/python2.7/sre_parse.pyc
# /usr/lib/python2.7/sre_constants.pyc matches /usr/lib/python2.7/sre_constants.py
import sre_constants # precompiled from /usr/lib/python2.7/sre_constants.pyc
dlopen("/usr/lib/python2.7/lib-dynload/_locale.so", 2);
import _locale # dynamically loaded from /usr/lib/python2.7/lib-dynload/_locale.so
# /usr/lib/python2.7/_sysconfigdata.pyc matches /usr/lib/python2.7/_sysconfigdata.py
import _sysconfigdata # precompiled from /usr/lib/python2.7/_sysconfigdata.pyc
import encodings # directory /usr/lib/python2.7/encodings
# /usr/lib/python2.7/encodings/__init__.pyc matches /usr/lib/python2.7/encodings/__init__.py
import encodings # precompiled from /usr/lib/python2.7/encodings/__init__.pyc
# /usr/lib/python2.7/codecs.pyc matches /usr/lib/python2.7/codecs.py
import codecs # precompiled from /usr/lib/python2.7/codecs.pyc
import _codecs # builtin
# /usr/lib/python2.7/encodings/aliases.pyc matches /usr/lib/python2.7/encodings/aliases.py
import encodings.aliases # precompiled from /usr/lib/python2.7/encodings/aliases.pyc
# /usr/lib/python2.7/encodings/utf_8.pyc matches /usr/lib/python2.7/encodings/utf_8.py
import encodings.utf_8 # precompiled from /usr/lib/python2.7/encodings/utf_8.pyc
Python 2.7.10 (default, Aug 13 2015, 12:27:27) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
dlopen("/usr/lib/python2.7/lib-dynload/readline.so", 2);
import readline # dynamically loaded from /usr/lib/python2.7/lib-dynload/readline.so

running just node or npm just gives me
Segmentation fault

Any idea? When I use valgrind node it starts and run.

==2621== Memcheck, a memory error detector
==2621== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==2621== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==2621== Command: node
==2621== 
==2621== Invalid free() / delete / delete[] / realloc()
==2621==    at 0x4C92A6A: free (vg_replace_malloc.c:473)
==2621==    by 0x40203A0: reclaim_gaps (dynlink.c:434)
==2621==    by 0x4020DB3: map_library (dynlink.c:584)
==2621==    by 0x40218CB: load_library (dynlink.c:829)
==2621==    by 0x402263A: load_preload (dynlink.c:922)
==2621==    by 0x402263A: __dls3 (dynlink.c:1396)
==2621==    by 0x4021F8E: __dls2 (dynlink.c:1212)
==2621==    by 0x401FD65: ??? (in /lib/ld-musl-x86_64.so.1)
==2621==  Address 0x4e9a180 is not stack'd, malloc'd or (recently) free'd
==2621== 
==2621== Warning: set address range perms: large range [0xcfb5750d000, 0xcfb7750d000) (noaccess)
> console.log('');

undefined
> 
(^C again to quit)
> 
==2621== 
==2621== HEAP SUMMARY:
==2621==     in use at exit: 451,359 bytes in 321 blocks
==2621==   total heap usage: 42,844 allocs, 42,526 frees, 127,620,424 bytes allocated
==2621== 
==2621== LEAK SUMMARY:
==2621==    definitely lost: 0 bytes in 0 blocks
==2621==    indirectly lost: 0 bytes in 0 blocks
==2621==      possibly lost: 1,944 bytes in 29 blocks
==2621==    still reachable: 449,415 bytes in 292 blocks
==2621==         suppressed: 0 bytes in 0 blocks
==2621== Rerun with --leak-check=full to see details of leaked memory
==2621== 
==2621== For counts of detected and suppressed errors, rerun with: -v
==2621== ERROR SUMMARY: 3 errors from 1 contexts (suppressed: 0 from 0)
@bnoordhuis
Copy link
Member

No idea. What does the stack trace in gdb look like?

@ghost
Copy link
Author

ghost commented Oct 17, 2015

I won`t have access to the computer that got that alpine VM until tuesday.
But I will check that when I do.

@jbergstroem jbergstroem added the build Issues and PRs related to build files or the CI. label Oct 18, 2015
@ghost
Copy link
Author

ghost commented Nov 6, 2015

Ok, nvm, it was just PaX blocking it.

@ghost ghost closed this as completed Nov 6, 2015
@mbrevda
Copy link

mbrevda commented Jul 17, 2018

For anyone landing here via Google:
To fix, just run:

paxctl -cm `which node`

bnoordhuis added a commit to bnoordhuis/io.js that referenced this issue Jul 22, 2022
Original commit log follows:

darwin: remove EPROTOTYPE error workaround (nodejs#3405)

It's been reported in the past that OS X 10.10, because of a race
condition in the XNU kernel, sometimes returns a transient EPROTOTYPE
error when trying to write to a socket. Libuv handles that by retrying
the operation until it succeeds or fails with a different error.

Recently it's been reported that current versions of the operating
system formerly known as OS X fail permanently with EPROTOTYPE under
certain conditions, resulting in an infinite loop.

Because Apple isn't exactly forthcoming with bug fixes or even details,
I'm opting to simply remove the workaround and have the error bubble up.

Refs: libuv/libuv#482
Fixes: nodejs#43916
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI.
Projects
None yet
Development

No branches or pull requests

3 participants