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

On SunOS fatal relocation error shows up between Node version 6.7.0 and 6.8.0 #11444

Closed
mehayden opened this issue Feb 17, 2017 · 11 comments
Closed
Labels
smartos Issues and PRs related to the SmartOS platform.

Comments

@mehayden
Copy link

  • Version: 6.8.0+
  • Platform: SunOS XXX.local 5.11 joyent_XXX i86pc i386 i86pc Solaris
  • Subsystem: node (from npm version command)

On SunOS I made some mods to the asdf-nodejs plugin (see issue asdf-vm/asdf-nodejs#26) so I can easily install different version of Node. I discovered that npm version seems to work on all Node versions <= 6.7.0 but fails on versions >= 6.8.0. For example:

$ asdf global nodejs 6.7.0
$ node -v
v6.7.0
$ npm version
{ npm: '3.10.3',
  ares: '1.10.1-DEV',
  http_parser: '2.7.0',
  icu: '57.1',
  modules: '48',
  node: '6.7.0',
  openssl: '1.0.2j',
  uv: '1.9.1',
  v8: '5.1.281.83',
  zlib: '1.2.8' }
$ asdf global nodejs 6.8.0
$ node -v
v6.8.0
$ npm version
ld.so.1: node: fatal: relocation error: file /home/mhayden/.asdf/installs/nodejs/6.8.0/         bin/node: symbol _ZNSt8__detail15_List_node_base7_M_hookEPS0_: referenced symbol not fo         und
Killed

I've run npm version tests on the following node versions, with results:

4.4.6 => ok
5.0.0 => ok
5.12.0 => ok
6.0.0 => ok
6.6.0 => ok
6.7.0 => ok
6.8.0 => fail
6.9.5 => fail
7.5.0 => fail

@mehayden
Copy link
Author

New information: Now the same relocation error occurs on version 6.7.0 during generation of a new Pheonix application in the command: npm install && node node_modules/brunch/bin/brunch build

$ npm install
ld.so.1: node: fatal: relocation error: file /home/mhayden/.asdf/installs/nodejs/6.7.0/bin/node: symbol _ZNSt8__detail15_List_node_base7_M_hookEPS0_: referenced symbol not found
Killed

This may be an asdf issue.

@mehayden
Copy link
Author

More info:

$ ldd -d node
        libkstat.so.1 =>         /lib/64/libkstat.so.1
        libumem.so.1 =>  /lib/64/libumem.so.1
        libsocket.so.1 =>        /lib/64/libsocket.so.1
        libnsl.so.1 =>   /lib/64/libnsl.so.1
        librt.so.1 =>    /lib/64/librt.so.1
        libsendfile.so.1 =>      /lib/64/libsendfile.so.1
        libstdc++.so.6 =>        /usr/lib/64/libstdc++.so.6
        libstdc++.so.6 (GLIBCXX_3.4.18) =>       (version not found)
        libstdc++.so.6 (CXXABI_1.3) =>   (version not found)
        libm.so.2 =>     /lib/64/libm.so.2
        libgcc_s.so.1 =>         /usr/lib/64/libgcc_s.so.1
        libpthread.so.1 =>       /lib/64/libpthread.so.1
        libc.so.1 =>     /lib/64/libc.so.1
        libmp.so.2 =>    /lib/64/libmp.so.2
        libmd.so.1 =>    /lib/64/libmd.so.1

Seems some incompatibility between node build and my libs.

@mscdex mscdex added the solaris label Feb 18, 2017
@misterdjules
Copy link

Can you provide the following information:

  1. The output of elfdump -d `which node` | grep -i runpath for each version of node that presents these issues
  2. Are you running node on SmartOS (it seems like it), and if so is it within a zone or within the global zone?
  3. If node is running within a zone, can you provide the following information:
    • The output of cat /etc/pkgsrc_version
    • The output of mdata-get sdc:image_uuid

This should allow us to determine whether the environment within which you're running node is supposed to have support out of the box for the node versions you're trying to run and how to fix the problem if that's not the case.

@mehayden
Copy link
Author

  1. The output of elfdump -d which node | grep -i runpath for each:
    6.7.0:
    RUNPATH 0x2b5f8c /opt/local/gcc48/x86_64-sun solaris2.11/lib/amd64:/opt/local/gcc48/lib/amd64
    6.9.5:
    RUNPATH 0x2b643d /opt/local/gcc48/x86_64-sun-solaris2.11/lib/amd64:/opt/local/gcc48/lib/amd64
    7.5.0:
    RUNPATH 0x351323 /opt/local/gcc48/x86_64-sun-solaris2.11/lib/amd64:/opt/local/gcc48/lib/amd64

    My gcc is gcc47 and I don't see a gcc48 available from pkgin.

  2. Yes it is a SmartOS in a zone.

cat /etc/pkgsrc_version
release: 2012Q1
architecture: i386
mdata-get sdc:image_uuid
3390ca7c-f2e7-11e1-8818-c36e0b12e58b

Thanks for your help!

@misterdjules
Copy link

misterdjules commented Feb 18, 2017

@mehayden

To make a long story short: recent node versions are not supported for this image/package repository. The minimum required SmartOS image for node versions >= 6.x and < 7.x is base-lts 14.x. The minimum required SmartOS image for node versions >= 7.x is base lts 15.x.

You will still need to install gcc-4.8 on zones provisioned from these images though, which is not ideal from a user experience point of view. This is because it seems that node binaries for SmartOS have been built with gcc 4.8.

If that's not an acceptable solution, then I would suggest contacting Joyent's support.

@jbergstroem I know we've had countless discussions on that topic, but do you remember why we went for gcc 4.9 instead of gcc 4.8 to build SmartOS binaries?

EDIT: I got confused by a typo I had made earlier in this comment, these node binaries are of course built with GCC 4.8, as the output of elfdump in a previous comment shows. So we might want to consider building these binaries with GCC 4.9 in the future.

@jperkin It seems that gcc 4.8 comes by default with base-lts 15.x and 16.x images, is that correct?

EDIT: I got confused for the same reason, and I had meant to ask if it is correct that GCC 4.9 comes by default installed for 15.x and 16.x images.

I hope that helps!

@jperkin
Copy link

jperkin commented Feb 18, 2017

GCC 4.8 is not recommended on SmartOS, it has never been the default compiler so has not been well tested, and does not have our fixes and patches. GCC 4.9 is a much better choice.

@misterdjules
Copy link

It seems that gcc 4.8 comes by default with base-lts 15.x and 16.x images, is that correct?

GCC 4.8 is not recommended on SmartOS, it has never been the default compiler so has not been well tested, and does not have our fixes and patches. GCC 4.9 is a much better choice.

Sorry, I actually got confused and I had meant to ask if it is correct that GCC 4.9 comes installed by default with 15.x and 16.x images.

However I realized that the default list of preinstalled packages was already documented for 16.x and 15.x images, and they include GCC 4.9 for both of them.

@jbergstroem I'll create an issue in nodejs/build to discuss moving to GCC 4.9 to build SmartOS binaries.

@misterdjules misterdjules added smartos Issues and PRs related to the SmartOS platform. and removed solaris labels Feb 19, 2017
@mehayden
Copy link
Author

Thanks all for the further info.

My immediate need in installing Node is to support it's use in Pheonix which requires >= 5.0.0. according to the docs. BTW, this is only for use of npm, in turn to support brunch.io's packaging, which is actually optional in Pheonix. However, I would like to keep with the defaults as much as possible and so would like a working Node.

In looking at the Node releases >= 5.0.0 with elfdump, they all require GCC 4.8. In looking at the SmartOS base packages the only one I can find that includes GCC 4.8 is 15.3.0. Before that they include only GCC 4.7 and after that they include both GCC 4.7 and 4.9 until 16.4.0, when only GCC 4.9 is supported.

So, I guess my options now are:

  1. Use an existing Node build and either move to a 15.3.0 base or get GCC 4.8 installed somehow.
  2. Wait for a new Node build requiring GCC 4.9 and upgrade to a recent SmartOS supporting it.
  3. Give up and use a different static asset manager with Pheonix.

I'll contact Joyent support to see what they recommend.

@misterdjules
Copy link

misterdjules commented Feb 20, 2017

@mehayden

The 2015Q4 and 2014Q4 pkgsrc repositories both have GCC 4.8 available as an installable package.

However, I would recommend to use the nodejs SmartOS packages instead of the binaries available at nodejs.org if this is an acceptable option. You should be able to find a package for a version that would meet your requirements and that is installable from a supported image.

@bnoordhuis
Copy link
Member

Please don't file issues about those packages here, though. We (nodejs/node) don't support them.

@mehayden
Copy link
Author

Closing this since resolution seems to be through Joyent. Also nodejs/build#628 looks promising to help in the future. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
smartos Issues and PRs related to the SmartOS platform.
Projects
None yet
Development

No branches or pull requests

5 participants