mivion / swisseph

Swiss Ephemeris binding for node.js
GNU General Public License v2.0
205 stars 72 forks source link

cannot allocate memory in static TLS block #47

Closed timotejroiko closed 7 years ago

timotejroiko commented 7 years ago

my app is running it fine in a windows machine with node-webkit and nw-gpy. now im trying to port it into pure nodejs to use in a linux VPS.

The standard "npm install swisseph" works fine, but its version 2.02, not the latest swisseph 2.06 i tried both "npm install swisseph-new" and "npm install swisseph-zp", as well as downloading the zip package and running "node-gyp rebuild". all of them build but give the following error when running:

genesis@genesis-virtual-machine ~/astrobot $ node index.js
module.js:641
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: /home/genesis/astrobot/node_modules/swisseph-new/build/Release/swisseph.node: cannot allocate memory in static TLS block
    at Object.Module._extensions..node (module.js:641:18)
    at Module.load (module.js:531:32)
    at tryModuleLoad (module.js:494:12)
    at Function.Module._load (module.js:486:3)
    at Module.require (module.js:556:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/genesis/astrobot/node_modules/swisseph-new/lib/swisseph.js:1:78)
    at Module._compile (module.js:612:30)
    at Object.Module._extensions..js (module.js:623:10)
    at Module.load (module.js:531:32)
keel commented 7 years ago

That is not the swisseph's issue, you can try to update glibc on your server, if your vps is CentOS ,you can try yum update -y. checkout https://github.com/nodesource/distributions/issues/513

timotejroiko commented 7 years ago

@keel Thanks for your response. im running linux mint 18 (based on ubuntu 16), node 8.8.1, glibc version 2.23 and libc6 version 2.23 the older version of swisseph present in npm works fine. was there a change in glibc requirment between swisseph versions? edit: i installed libc6 / glibc 2.26 and reinstalled swisseph-new but the problem persists

keel commented 7 years ago

swisseph-new is my work to update swisseph to 2.0.6, (sorry mivion, I need this version at that time), now mivion have done the update, so I reset it to mivion's version, but mivion forgot to push to npm.

@mivion please publish this version to npm, so we can use the new one.

@timotejroiko you can try to update swisseph-new which is same as mivion's current version. or downgrade the nodejs to 6 for a try.

timotejroiko commented 7 years ago

@keel I tried switching to various node versions, including 6 and the newest 9. problem persists on all of them. I used nvm to switch node version, then used npm install swisseph-new again.

i messed around with the files a bit and the problem seems to occur somewhere in swisseph/deps

perhaps it is also a problem with my virtual machine. i will try to test in another environment

EDIT: It successfully installed and ran in another virtual machine running linux mint 14. It seems the problem is indeed this linux installation. I will reinstall linux mint 18 and test it again.

Edit2: still no success in linux mint 18 after a clean install. i dont know what the problem is...

keel commented 7 years ago

@timotejroiko I'm not familiar with glibc nor ubuntu, and I have no environment to test it. If I were you, I will try this: 1.Change Ubuntu package server 2.Reinstall all dependency package from new server 3.Reinstall nodejs I just found this steps from another issue like yours, but it may takes a lot of time .

timotejroiko commented 7 years ago

@keel The problem seems to be with the architecture. I installed the x64 version of mint 18 this time and it worked. my previous install that didnt work was x86. so either there is a problem with the new swisseph and x86 or there is a problem in the x86 version of dependencies.

well, for now the issue has been resolved.

mivion commented 7 years ago

@keel could you make a PR, or even add you as contributor?

Also i've added you as collaborator to npm. You may publish updated version.

@timotejroiko @keel thanks a lot for your help.

keel commented 7 years ago

@mivion thanks for your trust, I have published the updated version to npm.

mivion commented 7 years ago

@keel, thanks for your help. Could you create a release tag in repo to be the same as in npmjs.org?

keel commented 7 years ago

OK, it's done.

mivion commented 7 years ago

👍