Giter VIP home page Giter VIP logo

Comments (10)

gugu avatar gugu commented on September 24, 2024

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.

bretambrose avatar bretambrose commented on September 24, 2024

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.

gugu avatar gugu commented on September 24, 2024

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.

bretambrose avatar bretambrose commented on September 24, 2024

If you're able to provide from-scratch step-by-step repro, I can try and squeeze something in.

from aws-crt-nodejs.

gugu avatar gugu commented on September 24, 2024

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.

bretambrose avatar bretambrose commented on September 24, 2024

How does ava factor in?

from aws-crt-nodejs.

gugu avatar gugu commented on September 24, 2024

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.

Kikobeats avatar Kikobeats commented on September 24, 2024

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.

gugu avatar gugu commented on September 24, 2024

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.

bretambrose avatar bretambrose commented on September 24, 2024

v1.10.6 now throws an exception if the module init is called more than once.

from aws-crt-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.