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

Jérémy Lal kapouer at melix.org
Mon Jul 15 10:02:13 BST 2024


Thanks.

It may be that browserify hits a bug by exhausting resources (heap).
Using another bundler might be a good idea (rollup, webpack, esbuild...).

Upstream doesn't support 32-bits builds on linux, however it does provide
32-bits build for windows.
If that bug can be reproduced there, it would be awesome, see
https://nodejs.org/fr/download/prebuilt-binaries

I may have an old windows vm to test this, but I may not have time to do
this.





Le lun. 15 juil. 2024 à 10:39, Сергей Сёмин <syominsergey at gmail.com> a
écrit :

> Hi!
> Just now I upgraded my existing Debian Bookworm i386 installation to
> Debian Sid using this repositories:
> deb http://deb.debian.org/debian unstable contrib main non-free-firmware
> deb-src http://deb.debian.org/debian unstable contrib main
> non-free-firmware
>
> Now I have these versions of packages of interest installed:
> nodejs/unstable,now 20.15.1+dfsg-1 i386
> node-browserify/unstable,now 17.0.0+ds-5 all [installed]
>
> Then I downloaded again sources of node-chai using "apt source
> node-chai", version 4.3.7~ds1+~cs9.7.21-1 received.
> And building with dpkg-buildpackage also fails with segfault in node:
> /usr/bin/make chai.js
> make[2]: Entering directory '/root/node-chai-4.3.7~ds1+~cs9.7.21'
> ==> [Browser :: build]
> make[2]: *** [Makefile:24: chai.js] Segmentation fault (core dumped)
>
> root at debian-bookworm-i386:~/node-chai-4.3.7~ds1+~cs9.7.21# make --trace
> chai.js
> Makefile:23: update target 'chai.js' due to: node_modules lib/chai
> lib/chai.js
> printf "==> [Browser :: build]\n"
> ==> [Browser :: build]
> browserify \
>        --bare \
>        --outfile chai.js \
>        --standalone chai \
>        --entry index.js
> make: *** [Makefile:24: chai.js] Segmentation fault (core dumped)
>
> root at debian-bookworm-i386:~/node-chai-4.3.7~ds1+~cs9.7.21# browserify \
>        --bare \
>        --outfile chai.js \
>        --standalone chai \
>        --entry index.js
> Segmentation fault (core dumped)
>
> Backtrace looks like this:
>
> root at debian-bookworm-i386:~/node-chai-4.3.7~ds1+~cs9.7.21# date
> Sun Jul 14 04:03:55 AM MSK 2024
> root at debian-bookworm-i386:~/node-chai-4.3.7~ds1+~cs9.7.21# coredumpctl -1
> debug
>           PID: 1831 (node)
>           UID: 0 (root)
>           GID: 0 (root)
>        Signal: 11 (SEGV)
>     Timestamp: Sun 2024-07-14 04:03:47 MSK (12s ago)
>  Command Line: node /usr/bin/browserify --bare --outfile chai.js
> --standalone chai --entry index.js
>    Executable: /usr/bin/node
> Control Group: /user.slice/user-0.slice/session-1.scope
>          Unit: session-1.scope
>         Slice: user-0.slice
>       Session: 1
>     Owner UID: 0 (root)
>       Boot ID: c006ef12e75e47edb9084d298ace0431
>    Machine ID: bb88a0eb919c40a690e344da5d477cfb
>      Hostname: debian-bookworm-i386
>       Storage:
> /var/lib/systemd/coredump/core.node.0.c006ef12e75e47edb9084d298ace0431.1831.1720919027000000.zst
> (present)
>  Size on Disk: 5.2M
>       Message: Process 1831 (node) of user 0 dumped core.
>
>                Module libzstd.so.1 from deb libzstd-1.5.6+dfsg-1.i386
>                Module libgcc_s.so.1 from deb gcc-14-14.1.0-4.i386
>                Module libstdc++.so.6 from deb gcc-14-14.1.0-4.i386
>                Stack trace of thread 1831:
>                #0  0x00000000b557d9c7 _ZN4node2fs9FSReqBaseD1Ev
> (libnode.so.115 + 0x97d9c7)
>                #1  0x00000000b5599e7d _ZN4node2fs13FSReqCallbackD0Ev
> (libnode.so.115 + 0x999e7d)
>                #2  0x00000000b556a859
> _ZN4node24MakeLibuvRequestCallbackI7uv_fs_sPFvPS1_EE7WrapperES2_
> (libnode.so.115 + 0x96a859)
>                #3  0x00000000b4bea0a2 n/a (libuv.so.1 + 0x230a2)
>                #4  0x00000000b4bd5af5 uv_run (libuv.so.1 + 0xeaf5)
>                #5  0x00000000b5473267
> _ZN4node21SpinEventLoopInternalEPNS_11EnvironmentE (libnode.so.115 +
> 0x873267)
>                #6  0x00000000b55cb2bf
> _ZN4node16NodeMainInstance3RunEPNS_8ExitCodeEPNS_11EnvironmentE
> (libnode.so.115 + 0x9cb2bf)
>                #7  0x00000000b55cb6b3 _ZN4node16NodeMainInstance3RunEv
> (libnode.so.115 + 0x9cb6b3)
>                #8  0x00000000b5526d29 _ZN4node5StartEiPPc
> (libnode.so.115 + 0x926d29)
>                #9  0x0000000000454087 main (node + 0x1087)
>                #10 0x00000000b7cf2c65 __libc_start_call_main
> (libc.so.6 + 0x23c65)
>                #11 0x00000000b7cf2d28 __libc_start_main_impl
> (libc.so.6 + 0x23d28)
>                #12 0x00000000004540c7 _start (node + 0x10c7)
>
>                Stack trace of thread 1849:
>                #0  0x0000000000000000 n/a (n/a + 0x0)
>                ELF object binary architecture: Intel 80386
>
> GNU gdb (Debian 13.2-1+b2) 13.2
> 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)
>
> warning: Can't open file anon_inode:[io_uring] which was expanded to
> anon_inode:[io_uring] during file-backed mapping note processing
>
> warning: Can't open file anon_inode:[io_uring] which was expanded to
> anon_inode:[io_uring] during file-backed mapping note processing
>
> warning: Can't open file anon_inode:[io_uring] which was expanded to
> anon_inode:[io_uring] during file-backed mapping note processing
>
> warning: Can't open file anon_inode:[io_uring] which was expanded to
> anon_inode:[io_uring] during file-backed mapping note processing
>
> warning: Can't open file anon_inode:[io_uring] which was expanded to
> anon_inode:[io_uring] during file-backed mapping note processing
>
> warning: Can't open file anon_inode:[io_uring] which was expanded to
> anon_inode:[io_uring] during file-backed mapping note processing
>
> warning: Can't open file anon_inode:[io_uring] which was expanded to
> anon_inode:[io_uring] during file-backed mapping note processing
>
> warning: Can't open file anon_inode:[io_uring] which was expanded to
> anon_inode:[io_uring] during file-backed mapping note processing
>
> warning: Can't open file anon_inode:[io_uring] which was expanded to
> anon_inode:[io_uring] during file-backed mapping note processing
>
> warning: Can't open file anon_inode:[io_uring] which was expanded to
> anon_inode:[io_uring] during file-backed mapping note processing
>
> warning: Can't open file anon_inode:[io_uring] which was expanded to
> anon_inode:[io_uring] during file-backed mapping note processing
>
> warning: Can't open file anon_inode:[io_uring] which was expanded to
> anon_inode:[io_uring] during file-backed mapping note processing
> [New LWP 1831]
> [New LWP 1849]
> [New LWP 1846]
> [New LWP 1848]
> [New LWP 1837]
> [New LWP 1845]
> [New LWP 1834]
> [New LWP 1847]
> [New LWP 1841]
> [New LWP 1840]
> [New LWP 1833]
> [New LWP 1842]
> [New LWP 1836]
> [New LWP 1844]
> [New LWP 1838]
> [New LWP 1843]
> [New LWP 1835]
> [New LWP 1832]
> [New LWP 1839]
> [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 --bare --outfile
> chai.js --standalone chai --entry ind'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  0xb557d9c7 in node::fs::FSReqBase::~FSReqBase() () from
> /lib/i386-linux-gnu/libnode.so.115
> --Type <RET> for more, q to quit, c to continue without paging--
> [Current thread is 1 (Thread 0xb7c9e780 (LWP 1831))]
> (gdb) bt
> #0  0xb557d9c7 in node::fs::FSReqBase::~FSReqBase() () from
> /lib/i386-linux-gnu/libnode.so.115
> #1  0xb5599e7d in node::fs::FSReqCallback::~FSReqCallback() () from
> /lib/i386-linux-gnu/libnode.so.115
> #2  0xb556a859 in node::MakeLibuvRequestCallback<uv_fs_s, void
> (*)(uv_fs_s*)>::Wrapper(uv_fs_s*) () from
> /lib/i386-linux-gnu/libnode.so.115
> #3  0xb4bea0a2 in ?? () from /lib/i386-linux-gnu/libuv.so.1
> #4  0xb4bd5af5 in uv_run () from /lib/i386-linux-gnu/libuv.so.1
> #5  0xb5473267 in node::SpinEventLoopInternal(node::Environment*) ()
> from /lib/i386-linux-gnu/libnode.so.115
> #6  0xb55cb2bf in node::NodeMainInstance::Run(node::ExitCode*,
> node::Environment*) () from /lib/i386-linux-gnu/libnode.so.115
> #7  0xb55cb6b3 in node::NodeMainInstance::Run() () from
> /lib/i386-linux-gnu/libnode.so.115
> #8  0xb5526d29 in node::Start(int, char**) () from
> /lib/i386-linux-gnu/libnode.so.115
> #9  0x00454087 in main ()
>
> пн, 15 июл. 2024 г. в 11:12, Jérémy Lal <kapouer at melix.org>:
> >
> > Le dim. 14 juil. 2024 à 23:48, Sergei Semin <syominsergey at gmail.com> a
> écrit :
> >>
> >> Package: nodejs
> >> Version: 18.19.0+dfsg-6~deb12u2
> >> I was trying to build from source package node-chai in Debian Bookworm
> i386. And there was a failure. Now I will describe how to reproduce.
> >
> >
> > Thank you for the detailed report.
> >
> > First thing is to check for regressions from
> > 18.19.0+dfsg-6~deb12u2
> > 18.19.0+dfsg-6~deb12u1
> > 18.19.0+dfsg-5
> > and also check if this is reproducible in debian/testing with nodejs 20.x
> >
> > Upstream doesn't build a i386 version, it's going to be difficult to
> make them fix it.
> >
> > Any help is welcome.
> >
> > Jérémy
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20240715/2f1bf335/attachment.htm>


More information about the Pkg-javascript-devel mailing list