Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack traces for potential segfaults? #138

Closed
clausreinke opened this issue Apr 16, 2020 · 2 comments
Closed

stack traces for potential segfaults? #138

clausreinke opened this issue Apr 16, 2020 · 2 comments

Comments

@clausreinke
Copy link
Contributor

While testing out proposed fixes for #128, our servers occasionally disappear (to be restarted by their services). When that happens, there is no error information whatsoever.

This reminds me a lot of segfaults, so I checked the node docs for event handling options. Those explain that attaching JS event handlers to such events would make no sense and that source debug info would be required from the native code in question to get useful stack traces anyway.

So I wonder: would it be possible to add an optional segfault handler and debug info in this packages native code in the hope of gaining helpful stack traces (or a confirmation that the silent crashes are either not segfaults or not located in this package or its dependencies)?

@clausreinke
Copy link
Contributor Author

just learned about Diagnostic Report (already in v12, too, as experimental). It seems the debug info for useful native stack traces is already there, though I still don't know how to trigger a report on a fatal error (--report-on-fatalerror did not seem to do the trick on the single crash I managed all day).

Here is a native stack triggered in the error handler of a client.invoke (note the PrepareAsync::OnOK with source file and line number):

  "nativeStack": [
    {
      "pc": "0x00007ff71adf1729",
      "symbol": "std::basic_ostream >::operator<<+10873"
    },
    {
      "pc": "0x00007ff71adf5b4c",
      "symbol": "std::basic_ostream >::operator<<+28316"
    },
    {
      "pc": "0x00007ff71adf4b08",
      "symbol": "std::basic_ostream >::operator<<+24152"
    },
    {
      "pc": "0x00007ff71adedfb6",
      "symbol": "std::basic_ostream >::basic_ostream >+5638"
    },
    {
      "pc": "0x00007ff71b69c4e0",
      "symbol": "v8::internal::Builtins::builtin_handle+325536"
    },
    {
      "pc": "0x00007ff71b69ba27",
      "symbol": "v8::internal::Builtins::builtin_handle+322791"
    },
    {
      "pc": "0x00007ff71b69bd68",
      "symbol": "v8::internal::Builtins::builtin_handle+323624"
    },
    {
      "pc": "0x00007ff71b69bb6e",
      "symbol": "v8::internal::Builtins::builtin_handle+323118"
    },
    {
      "pc": "0x00007ff71bb1414d",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+568205"
    },
    {
      "pc": "0x00007ff71ba93bdc",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+42524"
    },
    {
      "pc": "0x00007ff71ba93bdc",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+42524"
    },
    {
      "pc": "0x00007ff71ba93bdc",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+42524"
    },
    {
      "pc": "0x00007ff71ba93bdc",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+42524"
    },
    {
      "pc": "0x00007ff71ba93bdc",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+42524"
    },
    {
      "pc": "0x00007ff71bae1a06",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+361542"
    },
    {
      "pc": "0x00007ff71ba8f313",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+23891"
    },
    {
      "pc": "0x00007ff71bb74e70",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+964784"
    },
    {
      "pc": "0x00007ff71ba93bdc",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+42524"
    },
    {
      "pc": "0x00007ff71ba93bdc",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+42524"
    },
    {
      "pc": "0x00007ff71ba91191",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+31697"
    },
    {
      "pc": "0x00007ff71ba90d7c",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+30652"
    },
    {
      "pc": "0x00007ff71b5f62d3",
      "symbol": "v8::internal::Execution::CallWasm+1395"
    },
    {
      "pc": "0x00007ff71b5f5c56",
      "symbol": "v8::internal::Execution::Call+182"
    },
    {
      "pc": "0x00007ff71b6c6ecb",
      "symbol": "v8::Function::Call+603"
    },
    {
      "pc": "0x00007ff71af1bcfd",
      "symbol": "napi_call_function+237"
    },
    {
      "pc": "0x00007fffc4372e4c",
      "symbol": "Napi::FunctionReference::Call+220 [...\\sap\\node-rfc\\node_modules\\node-addon-api\\napi-inl.h]:L2591"
    },
    {
      "pc": "0x00007fffc43752a0",
      "symbol": "node_rfc::PrepareAsync::OnOK+1776 [...\\project\\server\\node_modules\\node-rfc\\src\\client.cc]:L319"
    },
    {
      "pc": "0x00007fffc437380d",
      "symbol": "::operator()+61 [...\\sap\\node-rfc\\node_modules\\node-addon-api\\napi-inl.h]:L3842"
    },
    {
      "pc": "0x00007fffc437b93c",
      "symbol": "Napi::details::WrapCallback< >+28 [...\\sap\\node-rfc\\node_modules\\node-addon-api\\napi-inl.h]:L73"
    },
    {
      "pc": "0x00007fffc437374f",
      "symbol": "Napi::AsyncWorker::OnWorkComplete+111 [...\\sap\\node-rfc\\node_modules\\node-addon-api\\napi-inl.h]:L3838"
    },
    {
      "pc": "0x00007ff71af0451c",
      "symbol": "node_module_register+1692"
    },
    {
      "pc": "0x00007ff71af8d950",
      "symbol": "uv_timer_stop+560"
    },
    {
      "pc": "0x00007ff71af8da27",
      "symbol": "uv_timer_stop+775"
    },
    {
      "pc": "0x00007ff71af8a4eb",
      "symbol": "uv_async_send+331"
    },
    {
      "pc": "0x00007ff71af89c8c",
      "symbol": "uv_loop_init+1212"
    },
    {
      "pc": "0x00007ff71af89e54",
      "symbol": "uv_run+244"
    },
    {
      "pc": "0x00007ff71aeabc12",
      "symbol": "v8::internal::Scope::locals+30946"
    },
    {
      "pc": "0x00007ff71af09a73",
      "symbol": "node::Start+275"
    },
    {
      "pc": "0x00007ff71adc667c",
      "symbol": "RC4_options+339324"
    },
    {
      "pc": "0x00007ff71bbc7138",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+1301368"
    },
    {
      "pc": "0x00007ffff2e07bd4",
      "symbol": "BaseThreadInitThunk+20"
    },
    {
      "pc": "0x00007ffff4dace51",
      "symbol": "RtlUserThreadStart+33"
    }
  ],

@clausreinke
Copy link
Contributor Author

Diagnostic Report is specifically for this purpose, and debug info is there, so closing here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant