Skip to content

Segmentation fault with openssl 1.1.0 #1386

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

Closed
gdaybrice opened this issue Feb 28, 2018 · 3 comments
Closed

Segmentation fault with openssl 1.1.0 #1386

gdaybrice opened this issue Feb 28, 2018 · 3 comments

Comments

@gdaybrice
Copy link

gdaybrice commented Feb 28, 2018

I have a C++ app using libssl.so.1.1 as a dependency, it runs correctly when I run it directly but when included via the .node binary I get a segmentation fault.

Tried to build with nan and node-addon-api, same error.

Is there some kind of conflict with the version of openssl in node versus the one I use as a dependency?

  • Node Version: v8.9.4 and v9.6.1
  • Platform: ubuntu:16.04

binding.gyp

{
  "targets": [
    {
      "target_name": "nuclea",
      "cflags!": [ "-fno-exceptions", "-std=gnu++0x" ],
      "cflags_cc!": [ "-fno-exceptions", "-std=gnu++0x" ],
      "cflags": [ "-std=c++14" ],
      "cflags_cc": [ "-std=c++14" ],
      "sources": [ "src/app.cc" ],
      "include_dirs": [
        "<!(node -e \"require('nan')\")"
      ],
      "link_settings": {
        "libraries": [
          "-lapp"
        ],
        "ldflags": [
          "-L<(module_root_dir)/libs"
        ]
      },
      "defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ]
    }
  ]
}

Segfault

PID 1941 received SIGSEGV for address: 0x7f6d7735bbe0
/app/node_modules/segfault-handler/build/Release/segfault-handler.node(+0x1b60)[0x7f6d85f23b60]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f6d88505390]
/app/libs/libssl.so.1.1(+0x269be0)[0x7f6d7735bbe0]
@bnoordhuis
Copy link
Member

Is there some kind of conflict with the version of openssl in node versus the one I use as a dependency?

Yes, almost certainly. Your options are:

  1. fix up the link order so your local .so comes first, or
  2. dlopen+dlsym your local .so, or
  3. use the bundled openssl

If you have more questions, can you move them to nodejs/help? This bug tracker is for node-gyp bugs, which this is not. Thanks.

@gdaybrice
Copy link
Author

gdaybrice commented Feb 28, 2018 via email

@kekkokk
Copy link

kekkokk commented Nov 26, 2018

Is there some kind of conflict with the version of openssl in node versus the one I use as a dependency?

Yes, almost certainly. Your options are:

  1. fix up the link order so your local .so comes first, or
  2. dlopen+dlsym your local .so, or
  3. use the bundled openssl

If you have more questions, can you move them to nodejs/help? This bug tracker is for node-gyp bugs, which this is not. Thanks.

Hi guys, can I have more explanation on this? I really can't find any help, how can I load my openssl 1.1 version before node exports its symbols?

Many thanks

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

3 participants