Docker-node: "npm i" crashes with exit code 134 on ARM64

Created on 27 Apr 2020  路  7Comments  路  Source: nodejs/docker-node

Hello,

I'm trying to build a simple web app via Docker using the node:12 (also tried node:14, no luck) image on my Raspberry Pi 4 running Ubuntu 20.04. When the build process wants to execute npm i I just get the error:

Aborted (core dumped)
The command '/bin/sh -c npm i' returned a non-zero code: 134

Even when I go into a new interactive container and execute npm (no arguments) myself I get the same error.

For some reason, the node:14-alpine image worked, but since my app requires native dependencies that I need to recompile and the image doesn't come with the right build tools I can't use that.

Most helpful comment

I too am using arm64 based Ubuntu 20.04, and ran into the same issue as @SuNNjek.

I've found its specifically the stretch (and slim variant) containers that are producing this. It works with buster (and slim variant), so that's an easier workaround than using alpine!

All 7 comments

Here's the documentation on how to do this: https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#node-gyp-alpine

@LaurentGoderre Thanks, I might try this as a workaround. However, this doesn't change the fact, that the ARM64 image simply doesn't work

I too am using arm64 based Ubuntu 20.04, and ran into the same issue as @SuNNjek.

I've found its specifically the stretch (and slim variant) containers that are producing this. It works with buster (and slim variant), so that's an easier workaround than using alpine!

I have the same issue on a raspberry pi 4 running ubuntu server 20.04.

Every yarn or npm command in a container immediately returns Aborted (core dumped). Both commands work fine outside docker.

I tried stretch packages from node 10 - 14, all with the same error. Buster package works.

I think my issue is related to this.

node --version works, but trying to execute index.js file does not and results in Aborted (core dumped).

Container image: node:14.4

gdb:

Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/local/bin/node...done.
[New LWP 304]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
Core was generated by `node index.js'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x0000007f994d8df4 in __GI_abort () at abort.c:89
#2  0x00000000012a2ba8 in thread_stack_size () at ../deps/uv/src/unix/thread.c:176
#3  uv_thread_create_ex (arg=0x122e4390, entry=0xa8ba28 <node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Start()::{lambda(void*)#1}::_FUN(void*)>, params=<synthetic pointer>, tid=0x122e4b20) at ../deps/uv/src/unix/thread.c:236
#4  uv_thread_create (tid=0x122e4b20, entry=0xa8ba28 <node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Start()::{lambda(void*)#1}::_FUN(void*)>, arg=0x122e4390) at ../deps/uv/src/unix/thread.c:212
#5  0x0000000000a8a044 in node::WorkerThreadsTaskRunner::WorkerThreadsTaskRunner(int) ()
#6  0x0000000000a8a308 in node::NodePlatform::NodePlatform(int, v8::TracingController*) ()
#7  0x00000000009f8f78 in node::InitializeOncePerProcess(int, char**) ()
#8  0x00000000009f93f8 in node::Start(int, char**) ()
#9  0x0000007f994c6364 in __libc_start_main (main=0x0, argc=0, argv=0x0, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=<optimized out>) at libc-start.c:291
#10 0x000000000099bf8c in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

bt full trace via gdb:

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
        set = {__val = {512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 549364153200, 548032843636, 548033970176, 548036849424, 549364153200, 548032843536}}
        pid = <optimized out>
        tid = <optimized out>
#1  0x0000007f994d8df4 in __GI_abort () at abort.c:89
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {549364153584, 548033113036, 548033968536, 8, 549364153872, 305021840, 66587264, 305020960, 305019024, 4, 66587240, 0, 511101108348,
              390842024046, 0, 0}}, sa_flags = 64, sa_restorer = 0x0}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00000000012a2ba8 in thread_stack_size () at ../deps/uv/src/unix/thread.c:176
        lim = {rlim_cur = 549364153664, rlim_max = 11051056}
#3  uv_thread_create_ex (arg=0x122e4390, entry=0xa8ba28 <node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Start()::{lambda(void*)#1}::_FUN(void*)>, params=<synthetic pointer>, tid=0x122e4b20) at ../deps/uv/src/unix/thread.c:236
        err = <optimized out>
        stack_size = <optimized out>
        attr = <optimized out>
        attr_storage = {
          __size = "\020A.\022\000\000\000\000\340\275\247\350\177\000\000\000\020\276\247\350\177\000\000\000\220C.\022\000\000\000\000@\275\247\350\177\000\000\000\030\240\250\000\000\000\000\000\020A.\022\000\000\000\000\034\236\250\000\000\000\000", __align = 305021200}
#4  uv_thread_create (tid=0x122e4b20, entry=0xa8ba28 <node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Start()::{lambda(void*)#1}::_FUN(void*)>, arg=0x122e4390) at ../deps/uv/src/unix/thread.c:212
No locals.
#5  0x0000000000a8a044 in node::WorkerThreadsTaskRunner::WorkerThreadsTaskRunner(int) ()
No symbol table info available.
#6  0x0000000000a8a308 in node::NodePlatform::NodePlatform(int, v8::TracingController*) ()
No symbol table info available.
#7  0x00000000009f8f78 in node::InitializeOncePerProcess(int, char**) ()
No symbol table info available.
#8  0x00000000009f93f8 in node::Start(int, char**) ()
No symbol table info available.
#9  0x0000007f994c6364 in __libc_start_main (main=0x0, argc=0, argv=0x0, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=<optimized out>) at libc-start.c:291
        self = <optimized out>
        result = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {27874416, 0, 10076000, 0, 0, 0, 0, 0, 0, 0, 549364154640, 4188861406190153964, 548036915608, 4188861404836860624, 0, 0, 0, 0, 0, 0, 0, 0}, mask_was_saved = 0}}, priv = {pad = {0x0,
              0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#10 0x000000000099bf8c in _start ()
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

I solved my problem specifying node and npm version engines on package.json:

"engines": {
    "node": "12.1.0",
    "npm": "6.9.0"
  }

was working my - visual studios code - I can't even do my classes now

C:\Program Files\nodejs\node.exe .....\LaunchCode\1stAssignment.js
Debugger attached.
C:\Program Files\nodejs\node.exe[17276]: c:\ws\src\node_file.cc:1724: Assertion `(argc) == (5)' failed.
1: 00007FF6F4BD058F napi_wrap+109311
2: 00007FF6F4B752B6 v8::internal::OrderedHashTable::NumberOfElementsOffset+33302
3: 00007FF6F4B75631 v8::internal::OrderedHashTable::NumberOfElementsOffset+34193
4: 00007FF6F4B69517 v8::base::CPU::has_sse+13095
5: 00007FF6F53EE72F v8::internal::Builtins::builtin_handle+321471
6: 00007FF6F53EDCC4 v8::internal::Builtins::builtin_handle+318804
7: 00007FF6F53EDFB7 v8::internal::Builtins::builtin_handle+319559
8: 00007FF6F53EDE03 v8::internal::Builtins::builtin_handle+319123
9: 00007FF6F54C9F9D v8::internal::SetupIsolateDelegate::SetupHeap+464173
10: 00007FF6F54628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498
11: 00007FF6F54628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498
12: 00007FF6F54628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498
13: 00007FF6F54628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498
14: 00007FF6F545C4D9 v8::internal::SetupIsolateDelegate::SetupHeap+14953
15: 00007FF6F54628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498
16: 00007FF6F54628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498
17: 00007FF6F54628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498
18: 00007FF6F54628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498
19: 00007FF6F54628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498
20: 00007FF6F54628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498
21: 00007FF6F54628A2 v8::internal::SetupIsolateDelegate::SetupHeap+40498
22: 00007FF6F546055E v8::internal::SetupIsolateDelegate::SetupHeap+31470
23: 00007FF6F546014C v8::internal::SetupIsolateDelegate::SetupHeap+30428
24: 00007FF6F5330631 v8::internal::Execution::CallWasm+1649
25: 00007FF6F532FE9F v8::internal::Execution::Call+191
26: 00007FF6F541B7E7 v8::Function::Call+615
27: 00007FF6F4B9FCAE napi_unref_threadsafe_function+3278
28: 00007FF6F4BA3D67 node::Start+1159
29: 00007FF6F4BA4161 node::Start+2177
30: 00007FF6F4BF2501 node::LoadEnvironment+49
31: 00007FF6F4B30203 v8::internal::OrderedHashTable::NumberOfBucketsOffset+9187
32: 00007FF6F4BA3A17 node::Start+311
33: 00007FF6F4A0686C RC4_options+339820
34: 00007FF6F59A604C v8::internal::compiler::RepresentationChanger::Uint32OverflowOperatorFor+153532
35: 00007FF98EFA7034 BaseThreadInitThunk+20
36: 00007FF99055D0D1 RtlUserThreadStart+33
Process exited with code 134

Was this page helpful?
0 / 5 - 0 ratings