Comments (10)
Same thing, but reproduces only in ava v4 with workerThreads enabled, turning off workerThreads fixes the problem. Here is my stacktrace:
FROM node:16.13.1-slim
, esm-enabled code
> NODE_ENV=test NODE_OPTIONS=--enable-source-maps ./node_modules/.bin/ava
Fatal error condition occurred in /codebuild/output/src422080616/src/aws-crt-nodejs/source/module.c:603: s_node_uv_elg == NULL
Exiting Application
################################################################################
Stack trace:
################################################################################
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(aws_backtrace_print+0x41) [0x7fe50c825d21]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(aws_fatal_assert+0x43) [0x7fe50c81b0f3]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(napi_register_module_v1+0x9e6) [0x7fe50c5fee36]
node(_Z30napi_module_register_by_symbolN2v85LocalINS_6ObjectEEENS0_INS_5ValueEEENS0_INS_7ContextEEEPFP12napi_value__P10napi_env__S8_E+0x351) [0xac7dc1]
node() [0xacc367]
node(_ZN4node7binding6DLOpenERKN2v820FunctionCallbackInfoINS1_5ValueEEE+0x2c3) [0xacc893]
node() [0xd4a35e]
node(_ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE+0xaf) [0xd4b77f]
node() [0x15e78f9]
Signal received: 1866676063, errno: 2019914862
################################################################################
Stack trace:
################################################################################
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(aws_backtrace_print+0x41) [0x7fe50c825d21]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(+0x652d3) [0x7fe50c5fd2d3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730) [0x7fe51ffa7730]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x10b) [0x7fe51fe0b7bb]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x121) [0x7fe51fdf6535]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(+0x2830f8) [0x7fe50c81b0f8]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(napi_register_module_v1+0x9e6) [0x7fe50c5fee36]
node(_Z30napi_module_register_by_symbolN2v85LocalINS_6ObjectEEENS0_INS_5ValueEEENS0_INS_7ContextEEEPFP12napi_value__P10napi_env__S8_E+0x351) [0xac7dc1]
node() [0xacc367]
node(_ZN4node7binding6DLOpenERKN2v820FunctionCallbackInfoINS1_5ValueEEE+0x2c3) [0xacc893]
node() [0xd4a35e]
node(_ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE+0xaf) [0xd4b77f]
node() [0x15e78f9]
Signal received: 0, errno: 0
################################################################################
Stack trace:
################################################################################
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(aws_backtrace_print+0x41) [0x7fe50c825d21]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(+0x652d3) [0x7fe50c5fd2d3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730) [0x7fe51ffa7730]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x10b) [0x7fe51fe0b7bb]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x121) [0x7fe51fdf6535]
node() [0xa315d8]
/lib/x86_64-linux-gnu/libc.so.6(+0x39d8c) [0x7fe51fe0dd8c]
/lib/x86_64-linux-gnu/libc.so.6(+0x39eba) [0x7fe51fe0deba]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(+0x652dd) [0x7fe50c5fd2dd]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730) [0x7fe51ffa7730]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x10b) [0x7fe51fe0b7bb]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x121) [0x7fe51fdf6535]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(+0x2830f8) [0x7fe50c81b0f8]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(napi_register_module_v1+0x9e6) [0x7fe50c5fee36]
node(_Z30napi_module_register_by_symbolN2v85LocalINS_6ObjectEEENS0_INS_5ValueEEENS0_INS_7ContextEEEPFP12napi_value__P10napi_env__S8_E+0x351) [0xac7dc1]
node() [0xacc367]
node(_ZN4node7binding6DLOpenERKN2v820FunctionCallbackInfoINS1_5ValueEEE+0x2c3) [0xacc893]
node() [0xd4a35e]
node(_ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE+0xaf) [0xd4b77f]
node() [0x15e78f9]
Signal received: 0, errno: 0
################################################################################
Stack trace:
################################################################################
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(aws_backtrace_print+0x41) [0x7fe50c825d21]
/srv/shorturl_redirector/node_modules/aws-crt/dist/bin/linux-x64/aws-crt-nodejs.node(+0x652d3) [0x7fe50c5fd2d3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730) [0x7fe51ffa7730]
[0x66457d0]
from aws-crt-nodejs.
I don't really know anything about ava v4 but the thread-crash vs. process-no-crash as well as the call stacks make me wonder if the issue is with NAPI module multi-init. The CRT does not support multi-init of its native module right now and if multiple inits get invoked within the same process it's going to crash. If that is indeed the root problem, I don't have a timeline when it will get fixed. It's in the backlog, but we haven't had a pressing external stimulus to get it prioritized.
from aws-crt-nodejs.
Can you at least add a human-readable node exception? Crashing process, which destroys all connections in the middle of request is not the best way to communicate about errors
from aws-crt-nodejs.
If you're able to provide from-scratch step-by-step repro, I can try and squeeze something in.
from aws-crt-nodejs.
repro.js:
import { Worker, isMainThread, parentPort } from 'worker_threads';
const worker = new Worker('./reproWorker.js');
reproWorker.js:
import 'aws-crt';
package.json:
{
"name": "repro",
"version": "1.0.0",
"description": "",
"main": "index.js.js",
"type": "module",
"author": "",
"license": "ISC",
"dependencies": {
"aws-crt": "1.10.5"
},
"devDependencies": {
}
}
Segfault here
from aws-crt-nodejs.
How does ava factor in?
from aws-crt-nodejs.
By default they use worker threads for running tests. To provide a minimal repro I removed ava and loaded worker threads directly
from aws-crt-nodejs.
Correct me if I'm wrong, but potentially this library is broken for any other dependency or user code that uses worker_threads
API.
from aws-crt-nodejs.
Correct me if I'm wrong, but potentially this library is broken for any other dependency or user code that uses worker_threads API.
Not potentially, it is. The bigger problem is that it kills whole node process instead of raising an exception
from aws-crt-nodejs.
v1.10.6 now throws an exception if the module init is called more than once.
from aws-crt-nodejs.
Related Issues (20)
- Node and Browser versions of the `iot.AwsIotMqttConnectionConfigBuilder` do not provide the same API HOT 8
- Buffer constructor is deprecated (node) HOT 1
- Migrate browser samples to use aws-sdk v3
- Webpack build warning HOT 4
- Segmentation Fault immediately on require inside Worker threads on Linux HOT 6
- Improve error messages that are returned when an exception is thrown while attempting to subscribe in JS HOT 1
- upgrade axios to 1.x HOT 6
- Add Esbuild support HOT 15
- 'AWS Signer SigV4A Headers' unit test failing HOT 9
- yarn install for aws-crt-nodejs: CMake Error: CMAKE_C_COMPILER not set HOT 11
- Node binaries not loading from binding.js when hoisted to root of node_modules HOT 6
- IoT unsigned custom authentication builder broken HOT 10
- Support `aws-c-s3` HOT 1
- Default provider chain does not support SSO profile-defined credentials HOT 2
- upgrade axios to ^1.6.4 HOT 1
- IoT MQTT5 MqttConnectCustomAuthConfig has invalid typing for custom authorizer + browser HOT 14
- linux-arm64-musl pre built missing HOT 7
- AWS_IO_TLS_ERROR_NEGOTIATION_FAILURE with 1.21.3 HOT 7
- Windows ARM64 Support? HOT 1
- npm audit - 2 vulnerabilities found - Severity: 2 high HOT 5
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 aws-crt-nodejs.