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

Segmentation fault after install #582

Closed
duncanh opened this issue Jan 4, 2017 · 10 comments
Closed

Segmentation fault after install #582

duncanh opened this issue Jan 4, 2017 · 10 comments

Comments

@duncanh
Copy link

duncanh commented Jan 4, 2017

Hi - got a problem with loading this library after install. Many thanks in advance for any help you can offer! :)

  1. What error(s) you are seeing?
    (Can't seem to 'require' it at all)
node -e "require('segfault-handler').registerHandler('crash.log'); require('oracledb')"
PID 22155 received SIGSEGV for address: 0x10
/home/fakeuser/monitor/node_modules/segfault-handler/build/Release/segfault-handler.node(+0x1dd7)[0x7f6a06e04dd7]
/lib64/libpthread.so.0(+0xf810)[0x7f6a0738f810]
/lib64/libpthread.so.0(pthread_mutex_destroy+0x0)[0x7f6a07388db0]
/home/fakeuser/11202/lib/libclntsh.so.11.1(sltsmxd+0x23)[0x7f6a04a4fa1d]
/home/fakeuser/11202/lib/libclntsh.so.11.1(kpufhndl0+0x153f)[0x7f6a0472e2a5]
/home/fakeuser/11202/lib/libclntsh.so.11.1(kpufhndl+0xb)[0x7f6a0472cd61]
/home/fakeuser/11202/lib/libclntsh.so.11.1(OCIHandleFree+0x13)[0x7f6a046f8eed]
/home/fakeuser/monitor/node_modules/oracledb/build/Release/oracledb.node(_ZN7EnvImpl7cleanupEv+0x1f)[0x7f6a06befaaf]
/home/fakeuser/monitor/node_modules/oracledb/build/Release/oracledb.node(_ZN7EnvImplC1ERKSsjj+0x14b)[0x7f6a06befe8b]
/home/fakeuser/monitor/node_modules/oracledb/build/Release/oracledb.node(_ZN7EnvImpl13createEnvImplERKSsjj+0x3d)[0x7f6a06befeed]
/home/fakeuser/monitor/node_modules/oracledb/build/Release/oracledb.node(_ZN3dpi3Env9createEnvERKSsjj+0x9)[0x7f6a06bef769]
/home/fakeuser/monitor/node_modules/oracledb/build/Release/oracledb.node(_ZN8OracledbC1Ev+0x74)[0x7f6a06bcdea4]
/home/fakeuser/monitor/node_modules/oracledb/build/Release/oracledb.node(_ZN8Oracledb3NewERKN3Nan20FunctionCallbackInfoIN2v85ValueEEE+0x63)[0x7f6a06bce013]
/home/fakeuser/monitor/node_modules/oracledb/build/Release/oracledb.node(+0x144bf)[0x7f6a06bc94bf]
node(_ZN2v88internal25FunctionCallbackArguments4CallEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEE+0xa1)[0x7f6641]
node[0x8269ab]
[0x17c0919060a2]
  1. What exact command caused the problem (e.g. what command did you try to install with)? Who were you logged in as?
    Actual command is in the trace above, but installation appeared to go absolutely fine - logged in as fakeuser;
rm -Rf /home/fakeuser/.node-gyp
> npm cache clean
> npm install --python=/usr/bin/python2.7 node-gyp
> export OCI_INC_DIR=/home/fakeuser/11202/sdk/include/
> export OCI_LIB_DIR=/home/fakeuser/11202/lib
> npm install --python=/usr/bin/python2.7 oracledb
[email protected] node_modules/oracledb
  [email protected]
  1. What environment variables did you set? How exactly did you set them?
> export ORACLE_HOME=/home/fakeuser/11202
> export OCI_INC_DIR=/home/fakeuser/11202/sdk/include/
> export OCI_LIB_DIR=/home/fakeuser/11202/lib
> export LD_LIBRARY_PATH=/home/fakeuser/11202/lib
  1. What is your version of Node.js?
    v0.12.16

  2. What is your version of the Oracle client (e.g. Instant Client)? How was it installed? Where it is installed?
    Oracle Instant Client Basic 11.2.02 (not lite)

  3. What is your OS and version?
    Suse Linux Enterprise 11.3

  4. What compiler version did you use? For example, with GCC, run gcc --version
    gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]

Prob worth noting that;

  • SQL*Plus works from that same client installation...
  • libaio v0.3.109 is installed
@cjbj
Copy link
Member

cjbj commented Jan 10, 2017

Looks like some some environment thing is happening.

Are you running SQL*Plus in the same terminal that you are trying to run Node?

Try getting a newer version of the Oracle Client. At least 11.2.0.4, but 12.1 would be better.

It would also be worth checking a newer version of Node, e.g. Node 6.

There's no need to set ORACLE_HOME when using Instant Client.

Did you unzip the Instant Client basic into /home/fakeuser/11202/lib or /home/fakeuser/11202?
Doing a standard unzip of the two Instant Client package would have the sdk directory at the same level as the libraries, not in a sub dir.

@arsragavan
Copy link

I am getting the similar error: Segmentation fault: 11
node -v = v6.9.4
npm -v = 4.0.5
instantclient -v = 12.1

@cjbj
Copy link
Member

cjbj commented Jan 11, 2017

@arsragavan install and environment details would be useful.

@arsragavan
Copy link

arsragavan commented Jan 11, 2017

@cjbj
Environment - Mac OSX 10.11.6
There is no problem with npm install oracledb.

node -e "require('segfault-handler').registerHandler('crash.log'); require('oracledb')" is throwing error.I have tried npm rebuild and also removing node_modules and npm install from scratch
my env variables look like

export OCI_LIB_DIR=/XXX/instantclient
export OCI_INC_DIR=/XXX/instantclient/sdk/include
export ORACLE_HOME=XXX/instantclient
export PATH=$ORACLE_HOME:$PATH

Btw, sqlplus works fine

The stack trace is same as mentioned in the issue: #371 (comment)

@cjbj
Copy link
Member

cjbj commented Jan 11, 2017

@arsragavan it doesn't occur for me on 10.11.6 so we'll need your help to work out what is going on. The issue you referenced seemed to be caused by access or environment configuration. What user is everything installed as? What user is running it? Do you have a copy of the old Instant Client lying around?

Also, don't set ORACLE_HOME if you are using Instant Client.

@arsragavan
Copy link

npm, node, instantclient everything is installed as my username (arsragavan) gcc and other Xcode libraries are installed as root
No I don't have old version of instantclient as this is the first time setup I'm trying.
Regardless of ORACLE_HOME env variable the issue occurs

@duncanh
Copy link
Author

duncanh commented Jan 11, 2017

@cjbj thanks for your reply, answers below;

Are you running SQL*Plus in the same terminal that you are trying to run Node?
Yep

Try getting a newer version of the Oracle Client. At least 11.2.0.4, but 12.1 would be better.
Unfortunately I can't - I'm stuck with the installation that's there.

It would also be worth checking a newer version of Node, e.g. Node 6.
Unfortunately I can't - I'm stuck with the installation that's there.

There's no need to set ORACLE_HOME when using Instant Client.
Yep - my env setting was actually done according to the install instructions - it just got clumped together on this issue because I was following the issue template. ORACLE_HOME wasn't delierately set when I actually ran the test, but I will try it again with it explicitly 'un'set, so we can eliminate that.

Did you unzip the Instant Client basic into /home/fakeuser/11202/lib or /home/fakeuser/11202?
A DBA installed it, so I don't actually know what they did, which I admit isn't ideal for problem diagnosis. All I'm told is that it's Instant Client Basic 11.2.0.2. I'll try to get more detail.

Doing a standard unzip of the two Instant Client package would have the sdk directory at the same level as the libraries, not in a sub dir.
Hmm, ok I need to investigate the oracle client installation a bit more then - will report back

@duncanh
Copy link
Author

duncanh commented Jan 11, 2017

Ok this can be closed as far as I'm concerned because I discovered, in fact, that a part of the oracle server had been installed instead of the instant client! Sorry for the time waste and thanks for your help..

@arsragavan
Copy link

It worked for me after setting the LD_LIBRARY_PATH environment variable to instantclient folder. I see this step is missing in the documentation: https://github.com/oracle/node-oracledb/blob/master/INSTALL.md#instosx

@cjbj
Copy link
Member

cjbj commented Jan 12, 2017

@duncanh Sounds like you had some library clash. You can install node-oracledb using just the RDBMS libraries.

@arsragavan you might want to check that, since LD_LIBRARY_PATH is a Linux thing, as far as I'm aware. OS X used to use DYLD_LIBARY_PATH until recent versions introduced SIP and stopped this variable working in subshells (see #149, #231).

@cjbj cjbj closed this as completed Feb 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants