You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#0 0x0000000000000000 in ?? ()
#1 0x0000000000538d09 in std::condition_variable::notify_all() ()
#2 0x000000000043e67b in icu_64::umtx_initImplPostInit (uio=...) at ../deps/icu-small/source/common/umutex.cpp:151
It looks like initCondition() calls out to the std::condition_variable constructor but actually returns an useless object in the end.
Yes, now it compiles without errors. Thanks! (By the way I don't understand what has caused this error - I've tested different node versions and node compiles without this error up to 12.8.1 release and starting from 12.9.0 release static compilation breaks with this error)
And little off-topic question - do I need to add --enable-static flag if I already added --fully-static flag ? I just need statically compiled node to run inside docker "FROM scratch" image and seems like in both cases (with and without --enable-static flag) I am getting executable /out/Release/node file
@bgnx I think --enable-static just means that it (also?) builds a static library from Node.js for embedding, in addition to the binary, but I think I might be wrong.
Activity
addaleax commentedon Oct 30, 2019
Relevant bits of the stack trace:
It looks like
initCondition()calls out to thestd::condition_variableconstructor but actually returns an useless object in the end.addaleax commentedon Oct 30, 2019
Machine code of the stdlib method in question:
Obviously
call 0isn’t quite right.¹ This only happens when linkingout/Debug/gen-regexp-special-casewith-static.¹ Edit: Looks like that should have been a call to
pthread_cond_broadcast, according to the relocation data in my static libstdc++.addaleax commentedon Oct 31, 2019
Tiny repro:
Googling a bit gives https://stackoverflow.com/questions/35116327/when-g-static-link-pthread-cause-segmentation-fault-why, which does not quite seem to answer why this is crashing but does provide a helpful solution.
@bgnx Can you confirm that this solves your issue?
bgnx commentedon Oct 31, 2019
Yes, now it compiles without errors. Thanks! (By the way I don't understand what has caused this error - I've tested different node versions and node compiles without this error up to 12.8.1 release and starting from 12.9.0 release static compilation breaks with this error)
And little off-topic question - do I need to add --enable-static flag if I already added --fully-static flag ? I just need statically compiled node to run inside docker "FROM scratch" image and seems like in both cases (with and without --enable-static flag) I am getting executable /out/Release/node file
addaleax commentedon Oct 31, 2019
@bgnx I think
--enable-staticjust means that it (also?) builds a static library from Node.js for embedding, in addition to the binary, but I think I might be wrong.build: use --whole-archive for pthread with --fully-static
emerzon commentedon Jan 13, 2022
Issues persist on v17.3.1. Unfortunately, the provided patch didn't solve it for me. Not present on v11.15.0.
alexnagelberg commentedon Feb 16, 2023
Issue still exists in v18.14.0 -- I used the patch and it worked.
bugwelle commentedon Jun 22, 2023
Issue persists in Node v20.3.1 ( 9869bdc ). I applied the patch and it works on:
./configure --fully-static --enable-static --ninjaUpdate 2024-04-23: Same with a2f3b1d
YanghangZheng-GDUT commentedon Nov 18, 2024
May I ask which patch you used? I have met the same problem.
skyone-wzw commentedon Nov 18, 2024
@YanghangZheng-GDUT I use
sed -i "s/'-static'/'-static', '-Wl,--whole-archive', '-lpthread', '-Wl,--no-whole-archive'/" configure.py ./configure --fully-static --enable-staticAnd it has been successfully compiled.
YanghangZheng-GDUT commentedon Nov 18, 2024
Thank you so much! My question seems to be done.