Comments (1)
I'm getting a segfault of my own just from including the "segfault-handler" module. It doesn't make it far enough in to set its own signal handler routine before the SEGV occurs.
Here is the first few lines of my reproduction:
const config = require('../config.json');
// TODO: This module has not been updated in over 4 years, but its functionality is vital.
// Ironically, the current version of this module running in the latest stable version of
// nodejs segfaults before it can even get far enough into its own initialization to report
// a stack trace.
var SegfaultHandler = require('segfault-handler');
//SegfaultHandler.registerHandler('logs/lsstream_crash.log');
process.exit(1);
It should exit with status 1 immediately after loading "segfault-handler", but instead it just unceremoniously segfaults during a wrapper function around dlopen:
jfolker-local@jfolker-ubuntu1:~/git/lscat/lsnode/backend$ node lsstream.js
Segmentation fault (core dumped)
Can you try running your nodejs script under gdb and post your stack trace? I wanna see if yours is similar to mine:
jfolker-local@jfolker-ubuntu1:~/git/lscat/lsnode/backend$ gdb node
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 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 "x86_64-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 node...
(gdb) r lsstream.js
Starting program: /home/jfolker-local/.nvm/versions/node/v20.11.1/bin/node lsstream.js
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff77ff640 (LWP 869426)]
[New Thread 0x7ffff6ffe640 (LWP 869427)]
[New Thread 0x7ffff67fd640 (LWP 869428)]
[New Thread 0x7ffff5ffc640 (LWP 869429)]
[New Thread 0x7ffff57fb640 (LWP 869430)]
[New Thread 0x7ffff7fba640 (LWP 869431)]
Thread 1 "node" received signal SIGSEGV, Segmentation fault.
0x00007fffce01a985 in ?? () from /lib/x86_64-linux-gnu/libnode.so.72
(gdb) bt
#0 0x00007fffce01a985 in ?? () from /lib/x86_64-linux-gnu/libnode.so.72
#1 0x00007ffff7fc947e in call_init (l=<optimized out>, argc=argc@entry=2, argv=argv@entry=0x7fffffffe2f8, env=env@entry=0x7fffffffe310)
at ./elf/dl-init.c:70
#2 0x00007ffff7fc9568 in call_init (env=0x7fffffffe310, argv=0x7fffffffe2f8, argc=2, l=<optimized out>) at ./elf/dl-init.c:33
#3 _dl_init (main_map=0x5673330, argc=2, argv=0x7fffffffe2f8, env=0x7fffffffe310) at ./elf/dl-init.c:117
#4 0x00007ffff7974af5 in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>)
at ./elf/dl-error-skeleton.c:182
#5 0x00007ffff7fd0ff6 in dl_open_worker (a=0x7fffffffc280) at ./elf/dl-open.c:808
#6 dl_open_worker (a=a@entry=0x7fffffffc280) at ./elf/dl-open.c:771
#7 0x00007ffff7974a98 in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>)
at ./elf/dl-error-skeleton.c:208
#8 0x00007ffff7fd134e in _dl_open (file=<optimized out>, mode=-2147483647,
caller_dlopen=0xc6a2be <std::_Function_handler<bool (node::binding::DLib*), node::binding::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&)::{lambda(node::binding::DLib*)#1}>::_M_invoke(std::_Any_data const&, node::binding::DLib*&&)+62>, nsid=-2, argc=2,
argv=<optimized out>, env=0x7fffffffe310) at ./elf/dl-open.c:883
#9 0x00007ffff789063c in dlopen_doit (a=a@entry=0x7fffffffc4f0) at ./dlfcn/dlopen.c:56
#10 0x00007ffff7974a98 in __GI__dl_catch_exception (exception=exception@entry=0x7fffffffc450, operate=<optimized out>, args=<optimized out>)
at ./elf/dl-error-skeleton.c:208
#11 0x00007ffff7974b63 in __GI__dl_catch_error (objname=0x7fffffffc4a8, errstring=0x7fffffffc4b0, mallocedp=0x7fffffffc4a7,
operate=<optimized out>, args=<optimized out>) at ./elf/dl-error-skeleton.c:227
#12 0x00007ffff789012e in _dlerror_run (operate=operate@entry=0x7ffff78905e0 <dlopen_doit>, args=args@entry=0x7fffffffc4f0)
at ./dlfcn/dlerror.c:138
#13 0x00007ffff78906c8 in dlopen_implementation (dl_caller=<optimized out>, mode=<optimized out>, file=<optimized out>)
at ./dlfcn/dlopen.c:71
#14 ___dlopen (file=<optimized out>, mode=<optimized out>) at ./dlfcn/dlopen.c:81
#15 0x0000000000c6a2be in std::_Function_handler<bool (node::binding::DLib*), node::binding::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&)::{lambda(node::binding::DLib*)#1}>::_M_invoke(std::_Any_data const&, node::binding::DLib*&&) ()
#16 0x0000000000c1a14e in node::Environment::TryLoadAddon(char const*, int, std::function<bool (node::binding::DLib*)> const&) ()
#17 0x0000000000c69819 in node::binding::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&) ()
#18 0x0000000000f328df in v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) ()
#19 0x0000000000f3314d in v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, unsigned long*, int) ()
#20 0x0000000000f33615 in v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) ()
#21 0x000000000193cdf6 in Builtins_CEntry_Return1_ArgvOnStack_BuiltinExit ()
#22 0x00000000018aed1c in Builtins_InterpreterEntryTrampoline ()
#23 0x00000405422004e9 in ?? ()
#24 0x0000383fdf047711 in ?? ()
#25 0x0000000700000000 in ?? ()
#26 0x00000405422005b9 in ?? ()
#27 0x0000383fdf043851 in ?? ()
#28 0x00002758e77054b1 in ?? ()
#29 0x00002758e77048c9 in ?? ()
#30 0x0000036d7281d141 in ?? ()
#31 0x00002758e77048c9 in ?? ()
#32 0x00000405422004e9 in ?? ()
from node-segfault-handler.
Related Issues (20)
- Failing to run on Alpine Linux HOT 2
- registerHandler is not a function in Ubuntu 14.04 LTS
- Side effects on native dependencies on Windows HOT 1
- question: requiring this module fixes my segfault problem. What am I doing? :-D HOT 1
- Please clean build output [cosmetic]
- Fails to build under Node 12 HOT 6
- Node 13.x uses SIGSEGV, new API available HOT 1
- Electron 7.x.x and > throws context aware warning HOT 1
- Out of the box build failure -- `'v8-debug.h' file not found` HOT 3
- Missing "execinfo.h" on Node Alpine HOT 7
- Possible to unregister at runtime?
- invalid ELF header
- Segfault handler should abort, or have the option to abort
- Crash log only contains SIGSEGV and /lib/libc.so.6 HOT 2
- Error when building on electron HOT 2
- ...
- Error building on Node 16.19.0
- Windows: segfault in `RtlGetLengthWithoutLastFullDosOrNtPathElement` seemingly innocuous, but gets trapped anyways HOT 3
- Error: Could not locate the bindings file (node_modules/bindings/bindings.js:135). Tried: HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-segfault-handler.