Bug 2275382 - jlpm segfault on aarch64
Summary: jlpm segfault on aarch64
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: nodejs20
Version: 42
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Jan Staněk
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-04-17 01:37 UTC by Jerry James
Modified: 2025-05-19 11:16 UTC (History)
4 users (show)

Fixed In Version: nodejs20-20.19.2-1.fc43
Clone Of:
Environment:
Last Closed: 2025-05-19 11:16:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github nodejs node issues 52606 0 None open Segfault on non-x86_64 architectures 2024-04-20 03:38:12 UTC

Description Jerry James 2024-04-17 01:37:25 UTC
Description of problem:
This is on an aarch64 Rawhide machine:
$ sudo dnf install jupyterlab
$ wget https://github.com/mwouts/jupytext/archive/v1.16.1/jupytext-1.16.1.tar.gz
$ tar xf jupytext-1.16.1.tar.gz
$ cd jupytext-1.16.1/jupyterlab
$ jlpm install
➤ YN0065: Yarn will periodically gather anonymous telemetry: https://yarnpkg.com/advanced/telemetry
➤ YN0065: Run yarn config set --home enableTelemetry 0 to disable

➤ YN0000: ┌ Resolution step
➤ YN0002: │ @jupyterlab/galata@npm:5.0.8 doesn't provide react (p4cf78), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/services@npm:7.0.8 doesn't provide react (p38eec), requested by @jupyterlab/settingregistry
➤ YN0002: │ @lerna/legacy-package-management@npm:6.6.2 doesn't provide nx (pa803c), requested by @nrwl/devkit
➤ YN0002: │ jupyterlab-jupytext@workspace:packages/jupyterlab-jupytext-extension doesn't provide react (pca723), requested by @jupyterlab/settingregistry
➤ YN0002: │ jupyterlab-rise@npm:0.41.0 doesn't provide react (p4a7ca), requested by @jupyterlab/settingregistry
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 540ms
➤ YN0000: ┌ Fetch step
Segmentation fault (core dumped)

The same segfault happens on every Fedora architecture *except* x86_64, which completes this operation normally.  GDB says:

$ gdb /usr/bin/python3
(gdb) run /usr/bin/jlpm install
Thread 1 "node" received signal SIGSEGV, Segmentation fault.
v8::internal::JSSegments::Create () at ../../deps/v8/src/objects/js-segments.cc:33
Downloading source file /usr/src/debug/nodejs20-20.12.2-1.fc41.aarch64/out/Release/../../deps/v8/src/objects/js-segments.cc
33            segmenter->icu_break_iterator().raw()->clone();
(gdb) bt
#0  v8::internal::JSSegments::Create () at ../../deps/v8/src/objects/js-segments.cc:33
#1  0x0000fffff63d2410 in Builtin_Impl_SegmenterPrototypeSegment () at ../../deps/v8/src/builtins/builtins-intl.cc:1170
#2  v8::internal::Builtin_SegmenterPrototypeSegment () at ../../deps/v8/src/builtins/builtins-intl.cc:1160
#3  0x0000fffff6206964 in Builtins_CEntry_Return1_ArgvOnStack_BuiltinExit () from /lib64/libnode.so.115
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) info locals
No locals.

I see that nodej20 is compiled with -g1, hence the inability to examine the local variables.

If this isn't https://issues.chromium.org/issues/40245807, it is very similar.

Version-Release number of selected component (if applicable):
nodejs-devel-20.12.2-1.fc41.aarch64

How reproducible:
Always

Steps to Reproduce:
1. Steps given above

Actual results:
A segfault.

Expected results:
JavaScript packages should be installed without a segfault.

Additional info:
While "yarn install" does complete without segfaulting, it also does not install all of the jupyterlab-specific packages, so cannot be used as a substitute.

Comment 1 Lumír Balhar 2024-04-17 08:53:33 UTC
If this seems to be an issue in nodejs, shouldn't this be reported for the nodejs component?

Comment 2 Jerry James 2024-04-17 14:56:51 UTC
I must have been tired.  Yes, I meant to file it against nodejs20.  Sorry about that.

Comment 3 Stephen Gallagher 2024-04-22 19:02:56 UTC
I just followed the exact steps you described on fresh containers on aarch64 (F40 host). On a Fedora 39 container, everything works fine. On a Fedora Rawhide (41) container, I get an error about a missing file while it's trying to build the "@parcel" NPM, but not a segmentation fault.

Are you sure the problem isn't specific to your setup somehow?

Comment 4 Jerry James 2024-04-22 22:18:18 UTC
Well, I hit this in the first place while trying to do a scratch build of a candidate python-jupytext package.  I reproduced it during a mock build on aarch64-test01.fedorainfracloud.org.  Let's try again (with irrelevant output omitted):

$ ssh jjames.org
[jjames@aarch64-test01 ~][PROD]$ mock -r fedora-rawhide-aarch64 --init
[jjames@aarch64-test01 ~][PROD]$ mock -r fedora-rawhide-aarch64 --install jupyterlab nodejs20 wget
[jjames@aarch64-test01 ~][PROD]$ mock -r fedora-rawhide-aarch64 --shell --enable-network
<mock-chroot> sh-5.2# chown mockbuild:mock /builddir /builddir/.bash_history /builddir/.rpmmacros
<mock-chroot> sh-5.2# su - mockbuild
[mockbuild@2054049533a14ac688327666e787c302 ~]$ cd build/SOURCES
[mockbuild@256e4e362d934f31a9a0d48363063b9b ~]$ wget https://github.com/mwouts/jupytext/archive/v1.16.1/jupytext-1.16.1.tar.gz
[mockbuild@256e4e362d934f31a9a0d48363063b9b ~]$ tar xzf jupytext-1.16.1.tar.gz
[mockbuild@256e4e362d934f31a9a0d48363063b9b ~]$ cd jupytext-1.16.1/jupyterlab
[mockbuild@256e4e362d934f31a9a0d48363063b9b jupyterlab]$ jlpm install
➤ YN0065: Yarn will periodically gather anonymous telemetry: https://yarnpkg.com/advanced/telemetry
➤ YN0065: Run yarn config set --home enableTelemetry 0 to disable

➤ YN0000: ┌ Resolution step
➤ YN0002: │ @jupyterlab/galata@npm:5.0.8 doesn't provide react (p4cf78), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/services@npm:7.0.8 doesn't provide react (p38eec), requested by @jupyterlab/settingregistry
➤ YN0002: │ @lerna/legacy-package-management@npm:6.6.2 doesn't provide nx (pa803c), requested by @nrwl/devkit
➤ YN0002: │ jupyterlab-jupytext@workspace:packages/jupyterlab-jupytext-extension doesn't provide react (pca723), requested by @jupyterlab/settingregistry
➤ YN0002: │ jupyterlab-rise@npm:0.41.0 doesn't provide react (p4a7ca), requested by @jupyterlab/settingregistry
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 548ms
➤ YN0000: ┌ Fetch step
Segmentation fault (core dumped)

So I can reproduce on the koji builders while doing a scratch build, and on the Fedora test machines in mock.  Could something in the mock environment be triggering the segfault?  If so, I have to figure out how to avoid that if a python-jupytext package is ever going to be possible.

Comment 5 Jerry James 2024-04-22 22:20:07 UTC
Oops, omit the "cd build/SOURCES" step.  I did that to avoid the chown that I ultimately inserted 2 steps above, because jlpm insisted on having a writable home directory to create the .yarn directory in.

Comment 6 Jerry James 2024-04-28 03:16:57 UTC
I did see build failures on all non-x86_64 architectures, but on further examination, only aarch64 segfaulted.  I have found fixes for the issues on most of the other architectures (except s390x, which is reporting a byte-reversed error code coming out of libzip).  So this segfault occurs only on aarch64.

I ran jlpm under strace to see if that gave any clues.  Here is a new sequence of actions to trigger the segfault, without invoking jlpm, just node itself.

$ ssh jjames.org
[jjames@aarch64-test01 ~][PROD]$ mock -r fedora-rawhide-aarch64 --init
[jjames@aarch64-test01 ~][PROD]$ mock -r fedora-rawhide-aarch64 --install gcc-c++ jupyterlab make nodejs-devel nodejs-npm python3-setuptools wget
[jjames@aarch64-test01 ~][PROD]$ mock -r fedora-rawhide-aarch64 --shell --enable-network
<mock-chroot> sh-5.2# chown mockbuild:mock /builddir /builddir/.rpmmacros
<mock-chroot> sh-5.2# su - mockbuild
[mockbuild@f000e4f063ab46d987c3f44d65a1ad87 ~]$ wget https://github.com/mwouts/jupytext/archive/v1.16.1/jupytext-1.16.1.tar.gz
[mockbuild@f000e4f063ab46d987c3f44d65a1ad87 ~]$ tar xzf jupytext-1.16.1.tar.gz
[mockbuild@f000e4f063ab46d987c3f44d65a1ad87 jupyterlab]$ node /usr/lib/python3.12/site-packages/jupyterlab/staging/yarn.js install
➤ YN0065: Yarn will periodically gather anonymous telemetry: https://yarnpkg.com/advanced/telemetry
➤ YN0065: Run yarn config set --home enableTelemetry 0 to disable

➤ YN0000: ┌ Resolution step
➤ YN0002: │ @jupyterlab/galata@npm:5.0.8 doesn't provide react (p4cf78), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/services@npm:7.0.8 doesn't provide react (p38eec), requested by @jupyterlab/settingregistry
➤ YN0002: │ @lerna/legacy-package-management@npm:6.6.2 doesn't provide nx (pa803c), requested by @nrwl/devkit
➤ YN0002: │ jupyterlab-jupytext@workspace:packages/jupyterlab-jupytext-extension doesn't provide react (pca723), requested by @jupyterlab/settingregistry
➤ YN0002: │ jupyterlab-rise@npm:0.41.0 doesn't provide react (p4a7ca), requested by @jupyterlab/settingregistry
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 582ms
➤ YN0000: ┌ Fetch step
Segmentation fault (core dumped)

According to strace, the cause is a null pointer dereference:

--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---

Comment 7 Jerry James 2024-04-30 17:25:28 UTC
I discovered quite by accident that setting LC_ALL=C.UTF-8 makes the segfault go away.  The crash has something to do with operating in an ASCII environment, it seems.

Comment 8 Stephen Gallagher 2024-05-02 19:29:13 UTC
Jerry, can you check if you have the `nodejs-full-i18n` package on your system? If not, does adding it make the problem go away? I had that package installed on my aarch64 situation, which might have masked the crash.

It looks like this MIGHT be another instance of https://github.com/nodejs/node/issues/51752

Comment 9 Fedora Admin user for bugzilla script actions 2024-06-25 02:55:57 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 10 Jerry James 2024-06-26 22:45:50 UTC
Oops, sorry, I overlooked comment 8 somehow.  Yes, installing nodejs-full-i18n prevents the crash!  Thank you!  This does indeed look like another instance of that nodejs issue.

Comment 11 Aoife Moloney 2025-02-26 13:01:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 12 Fedora Update System 2025-05-19 11:08:33 UTC
FEDORA-2025-70d216243f (nodejs20-20.19.2-1.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-70d216243f

Comment 13 Fedora Update System 2025-05-19 11:16:32 UTC
FEDORA-2025-70d216243f (nodejs20-20.19.2-1.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.