[Pkg-javascript-devel] Bug#1076350: nodejs: segfault in node when running browserify script on i386 when building node-prop-types

Сергей Сёмин syominsergey at gmail.com
Tue Jul 16 16:07:09 BST 2024


It's interesting that problem is reproducible in Debian Bookworm i386
in other cases when building node packages from source.
The same problem with browserify occurs when building source package
node-prop-types_15.8.1+~15.7.5-2.

As earlier, I took Debian Bookworm i386 with repos:
deb http://deb.debian.org/debian bookworm contrib main non-free-firmware
deb-src http://deb.debian.org/debian bookworm contrib main non-free-firmware
deb http://deb.debian.org/debian-security/ bookworm-security contrib
main non-free-firmware
deb-src http://deb.debian.org/debian-security/ bookworm-security
contrib main non-free-firmware
deb http://deb.debian.org/debian bookworm-updates contrib main non-free-firmware
deb-src http://deb.debian.org/debian bookworm-updates contrib main
non-free-firmware

Upgraded system to most recent version with "apt update" and "apt upgrade".

Then I downloaded build deps for node-prop-types with "apt build-dep
node-prop-types".

There were these package among received build deps:
Get:87 http://deb.debian.org/debian bookworm/main i386 nodejs i386
18.19.0+dfsg-6~deb12u2 [319 kB]
Get:377 http://deb.debian.org/debian bookworm/main i386
node-browserify all 17.0.0+ds-5 [29.6 kB]

Then I downloaded sources of "node-prop-types" with "apt source
node-prop-types".

Then I entered into dir with extracted sources and ran
"dpkg-buildpackage -uc -us". I received segfault after this:
make[1]: Entering directory '/home/user/node-prop-types-15.8.1+~15.7.5'
NODE_ENV=development browserify index.js -t loose-envify --standalone
PropTypes -o prop-types.js

This is backtrace:
user at debian-bookworm-i386:~$ coredumpctl debug
Hint: You are currently not seeing messages from other users and the system.
     Users in groups 'adm', 'systemd-journal' can see all messages.
     Pass -q to turn off this notice.
          PID: 8085 (node)
          UID: 1000 (user)
          GID: 1000 (user)
       Signal: 11 (SEGV)
    Timestamp: Tue 2024-07-16 17:32:59 MSK (1min 46s ago)
 Command Line: node /usr/bin/browserify index.js -t loose-envify
--standalone PropTypes -o prop-types.js
   Executable: /usr/bin/node
Control Group: /user.slice/user-1000.slice/session-3.scope
         Unit: session-3.scope
        Slice: user-1000.slice
      Session: 3
    Owner UID: 1000 (user)
      Boot ID: 86acf4527daa44c790c8159b6dc2ce81
   Machine ID: bb88a0eb919c40a690e344da5d477cfb
     Hostname: debian-bookworm-i386
      Storage: /var/lib/systemd/coredump/core.node.1000.86acf4527daa44c790c8159b6dc2ce81.8085.1721140379000000.zst
(present)
 Size on Disk: 5.2M
      Message: Process 8085 (node) of user 1000 dumped core.

               Stack trace of thread 8085:
               #0  0x00000000b5858507 _ZN4node2fs9FSReqBaseD1Ev
(libnode.so.108 + 0x858507)
               #1  0x00000000b5871a4d _ZN4node2fs13FSReqCallbackD0Ev
(libnode.so.108 + 0x871a4d)
               #2  0x00000000b584bc52
_ZN4node24MakeLibuvRequestCallbackI7uv_fs_sPFvPS1_EE7WrapperES2_
(libnode.so.108 + 0x84bc52)
               #3  0x00000000b7c9a620 n/a (libuv.so.1 + 0x9620)
               #4  0x00000000b7c9e24a n/a (libuv.so.1 + 0xd24a)
               #5  0x00000000b7cb399b n/a (libuv.so.1 + 0x2299b)
               #6  0x00000000b7c9ec83 uv_run (libuv.so.1 + 0xdc83)
               #7  0x00000000b577424a
_ZN4node13SpinEventLoopEPNS_11EnvironmentE (libnode.so.108 + 0x77424a)
               #8  0x00000000b58a185c
_ZN4node16NodeMainInstance3RunEPiPNS_11EnvironmentE (libnode.so.108 +
0x8a185c)
               #9  0x00000000b58a1cb9 _ZN4node16NodeMainInstance3RunEv
(libnode.so.108 + 0x8a1cb9)
               #10 0x00000000b5807951
_ZN4node22LoadSnapshotDataAndRunEPPKNS_12SnapshotDataEPKNS_20InitializationResultE
(libnode.so.108 + 0x807951)
               #11 0x00000000b580b70e _ZN4node5StartEiPPc
(libnode.so.108 + 0x80b70e)
               #12 0x00000000004f8087 main (node + 0x1087)
               #13 0x00000000b7d072d5 n/a (libc.so.6 + 0x232d5)
               #14 0x00000000b7d07398 __libc_start_main (libc.so.6 + 0x23398)
               #15 0x00000000004f80c7 _start (node + 0x10c7)

               Stack trace of thread 8087:
               #0  0x00000000b7f17559 __kernel_vsyscall
(linux-gate.so.1 + 0x559)
               #1  0x00000000b7df9bd2 n/a (libc.so.6 + 0x115bd2)
               #2  0x00000000b7d685b5 n/a (libc.so.6 + 0x845b5)
               #3  0x00000000b7d6b80e pthread_cond_wait (libc.so.6 + 0x8780e)
               #4  0x00000000b7cad69c uv_cond_wait (libuv.so.1 + 0x1c69c)
               #5  0x00000000b58ce222 n/a (libnode.so.108 + 0x8ce222)
               #6  0x00000000b7d6c35d n/a (libc.so.6 + 0x8835d)
               #7  0x00000000b7e07688 n/a (libc.so.6 + 0x123688)

               Stack trace of thread 8090:
               #0  0x00000000b7f17559 __kernel_vsyscall
(linux-gate.so.1 + 0x559)
               #1  0x00000000b7df9bd2 n/a (libc.so.6 + 0x115bd2)
               #2  0x00000000b7d685b5 n/a (libc.so.6 + 0x845b5)
               #3  0x00000000b7d6b80e pthread_cond_wait (libc.so.6 + 0x8780e)
               #4  0x00000000b7cad69c uv_cond_wait (libuv.so.1 + 0x1c69c)
               #5  0x00000000b58ce222 n/a (libnode.so.108 + 0x8ce222)
               #6  0x00000000b7d6c35d n/a (libc.so.6 + 0x8835d)
               #7  0x00000000b7e07688 n/a (libc.so.6 + 0x123688)

               Stack trace of thread 8091:
               #0  0x00000000b7f17559 __kernel_vsyscall
(linux-gate.so.1 + 0x559)
               #1  0x00000000b7df9bd2 n/a (libc.so.6 + 0x115bd2)
               #2  0x00000000b7d685b5 n/a (libc.so.6 + 0x845b5)
               #3  0x00000000b7d74912 n/a (libc.so.6 + 0x90912)
               #4  0x00000000b7d749bb n/a (libc.so.6 + 0x909bb)
               #5  0x00000000b7cad72b uv_sem_wait (libuv.so.1 + 0x1c72b)
               #6  0x00000000b597f6e3 n/a (libnode.so.108 + 0x97f6e3)
               #7  0x00000000b7d6c35d n/a (libc.so.6 + 0x8835d)
               #8  0x00000000b7e07688 n/a (libc.so.6 + 0x123688)

               Stack trace of thread 8086:
               #0  0x00000000b7f17559 __kernel_vsyscall
(linux-gate.so.1 + 0x559)
               #1  0x00000000b7e05bc3 epoll_wait (libc.so.6 + 0x121bc3)
               #2  0x00000000b7cb3c8e n/a (libuv.so.1 + 0x22c8e)
               #3  0x00000000b7c9ec83 uv_run (libuv.so.1 + 0xdc83)
               #4  0x00000000b58d3378
_ZZN4node23WorkerThreadsTaskRunner20DelayedTaskScheduler5StartEvENUlPvE_4_FUNES2_
(libnode.so.108 + 0x8d3378)
               #5  0x00000000b7d6c35d n/a (libc.so.6 + 0x8835d)
               #6  0x00000000b7e07688 n/a (libc.so.6 + 0x123688)

               Stack trace of thread 8095:
               #0  0x00000000b7f17559 __kernel_vsyscall
(linux-gate.so.1 + 0x559)
               #1  0x00000000b7df9bd2 n/a (libc.so.6 + 0x115bd2)
               #2  0x00000000b7d685b5 n/a (libc.so.6 + 0x845b5)
               #3  0x00000000b7d6b80e pthread_cond_wait (libc.so.6 + 0x8780e)
               #4  0x00000000b7cad69c uv_cond_wait (libuv.so.1 + 0x1c69c)
               #5  0x00000000b7c99f5d n/a (libuv.so.1 + 0x8f5d)
               #6  0x00000000b7d6c35d n/a (libc.so.6 + 0x8835d)
               #7  0x00000000b7e07688 n/a (libc.so.6 + 0x123688)

               Stack trace of thread 8092:
               #0  0x00000000b7f17559 __kernel_vsyscall
(linux-gate.so.1 + 0x559)
               #1  0x00000000b7df9bd2 n/a (libc.so.6 + 0x115bd2)
               #2  0x00000000b7d685b5 n/a (libc.so.6 + 0x845b5)
               #3  0x00000000b7d6b80e pthread_cond_wait (libc.so.6 + 0x8780e)
               #4  0x00000000b7cad69c uv_cond_wait (libuv.so.1 + 0x1c69c)
               #5  0x00000000b7c99f5d n/a (libuv.so.1 + 0x8f5d)
               #6  0x00000000b7d6c35d n/a (libc.so.6 + 0x8835d)
               #7  0x00000000b7e07688 n/a (libc.so.6 + 0x123688)

               Stack trace of thread 8088:
               #0  0x00000000b7f17559 __kernel_vsyscall
(linux-gate.so.1 + 0x559)
               #1  0x00000000b7df9bd2 n/a (libc.so.6 + 0x115bd2)
               #2  0x00000000b7d685b5 n/a (libc.so.6 + 0x845b5)
               #3  0x00000000b7d6b80e pthread_cond_wait (libc.so.6 + 0x8780e)
               #4  0x00000000b7cad69c uv_cond_wait (libuv.so.1 + 0x1c69c)
               #5  0x00000000b58ce222 n/a (libnode.so.108 + 0x8ce222)
               #6  0x00000000b7d6c35d n/a (libc.so.6 + 0x8835d)
               #7  0x00000000b7e07688 n/a (libc.so.6 + 0x123688)

               Stack trace of thread 8089:
               #0  0x00000000b7f17559 __kernel_vsyscall
(linux-gate.so.1 + 0x559)
               #1  0x00000000b7df9bd2 n/a (libc.so.6 + 0x115bd2)
               #2  0x00000000b7d685b5 n/a (libc.so.6 + 0x845b5)
               #3  0x00000000b7d6b80e pthread_cond_wait (libc.so.6 + 0x8780e)
               #4  0x00000000b7cad69c uv_cond_wait (libuv.so.1 + 0x1c69c)
               #5  0x00000000b58ce222 n/a (libnode.so.108 + 0x8ce222)
               #6  0x00000000b7d6c35d n/a (libc.so.6 + 0x8835d)
               #7  0x00000000b7e07688 n/a (libc.so.6 + 0x123688)

               Stack trace of thread 8094:
               #0  0x00000000b7f17559 __kernel_vsyscall
(linux-gate.so.1 + 0x559)
               #1  0x00000000b7df9bd2 n/a (libc.so.6 + 0x115bd2)
               #2  0x00000000b7d685b5 n/a (libc.so.6 + 0x845b5)
               #3  0x00000000b7d6b80e pthread_cond_wait (libc.so.6 + 0x8780e)
               #4  0x00000000b7cad69c uv_cond_wait (libuv.so.1 + 0x1c69c)
               #5  0x00000000b7c99f5d n/a (libuv.so.1 + 0x8f5d)
               #6  0x00000000b7d6c35d n/a (libc.so.6 + 0x8835d)
               #7  0x00000000b7e07688 n/a (libc.so.6 + 0x123688)

               Stack trace of thread 8093:
               #0  0x00000000b7f17559 __kernel_vsyscall
(linux-gate.so.1 + 0x559)
               #1  0x00000000b7df9bd2 n/a (libc.so.6 + 0x115bd2)
               #2  0x00000000b7d685b5 n/a (libc.so.6 + 0x845b5)
               #3  0x00000000b7d6b80e pthread_cond_wait (libc.so.6 + 0x8780e)
               #4  0x00000000b7cad69c uv_cond_wait (libuv.so.1 + 0x1c69c)
               #5  0x00000000b7c99f5d n/a (libuv.so.1 + 0x8f5d)
               #6  0x00000000b7d6c35d n/a (libc.so.6 + 0x8835d)
               #7  0x00000000b7e07688 n/a (libc.so.6 + 0x123688)
               ELF object binary architecture: Intel 80386

GNU gdb (Debian 13.1-3) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
   <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/node...
(No debugging symbols found in /usr/bin/node)
[New LWP 8085]
[New LWP 8087]
[New LWP 8090]
[New LWP 8091]
[New LWP 8086]
[New LWP 8095]
[New LWP 8092]
[New LWP 8088]
[New LWP 8089]
[New LWP 8094]
[New LWP 8093]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Core was generated by `node /usr/bin/browserify index.js -t
loose-envify --standalone PropTypes -o pro'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0xb5858507 in node::fs::FSReqBase::~FSReqBase() () from
/lib/i386-linux-gnu/libnode.so.108
[Current thread is 1 (Thread 0xb4d21780 (LWP 8085))]
(gdb) bt
#0  0xb5858507 in node::fs::FSReqBase::~FSReqBase() () from
/lib/i386-linux-gnu/libnode.so.108
#1  0xb5871a4d in node::fs::FSReqCallback::~FSReqCallback() () from
/lib/i386-linux-gnu/libnode.so.108
#2  0xb584bc52 in node::MakeLibuvRequestCallback<uv_fs_s, void
(*)(uv_fs_s*)>::Wrapper(uv_fs_s*) () from
/lib/i386-linux-gnu/libnode.so.108
#3  0xb7c9a620 in ?? () from /lib/i386-linux-gnu/libuv.so.1
#4  0xb7c9e24a in ?? () from /lib/i386-linux-gnu/libuv.so.1
#5  0xb7cb399b in ?? () from /lib/i386-linux-gnu/libuv.so.1
#6  0xb7c9ec83 in uv_run () from /lib/i386-linux-gnu/libuv.so.1
#7  0xb577424a in node::SpinEventLoop(node::Environment*) () from
/lib/i386-linux-gnu/libnode.so.108
#8  0xb58a185c in node::NodeMainInstance::Run(int*,
node::Environment*) () from /lib/i386-linux-gnu/libnode.so.108
#9  0xb58a1cb9 in node::NodeMainInstance::Run() () from
/lib/i386-linux-gnu/libnode.so.108
#10 0xb5807951 in node::LoadSnapshotDataAndRun(node::SnapshotData
const**, node::InitializationResult const*) () from
/lib/i386-linux-gnu/libnode.so.108
#11 0xb580b70e in node::Start(int, char**) () from
/lib/i386-linux-gnu/libnode.so.108
#12 0x004f8087 in main ()

It is same as was earlier in case of building node-chai.

Also same behaviour in Debian Trixie.
In Debian Trixie I received sources of node-prop-types with version
15.8.1+~15.7.9+~cs1.1.1-1. And necessary build deps with these
packages among them:
nodejs/testing,now 20.15.0+dfsg-1 i386 [installed,automatic]
node-browserify/testing,now 17.0.0+ds-5 all [installed]

Then I ran "dpkg-buildpackage -us -us" and received the same error:
Using polyfills: No polyfills were added, since the `useBuiltIns`
option was not set.
Successfully compiled 7 files with Babel (577ms).
Found debian/nodejs/./build
       cd ./. && sh -ex debian/nodejs/./build
+ NODE_ENV=development browserify index.js -t loose-envify
--standalone PropTypes -o prop-types.js
Segmentation fault (core dumped)
dh_auto_build: error: cd ./. && sh -ex debian/nodejs/./build returned
exit code 139
make: *** [debian/rules:5: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

It is interesting, that build process of node-prop-types migrated
earlier from webpack to browserify because of some problems with
webpack:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1002862

So it looks like not suitable idea to change browserify to webpack
(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076350#30)
Maybe another option is suitable, listed in the mentioned comment - rollup ...



More information about the Pkg-javascript-devel mailing list