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

Loading error: undefined symbol: LIBXSLT_DEFAULT_PLUGINS_PATH #18

Closed
MartijnR opened this issue Jul 23, 2015 · 8 comments
Closed

Loading error: undefined symbol: LIBXSLT_DEFAULT_PLUGINS_PATH #18

MartijnR opened this issue Jul 23, 2015 · 8 comments

Comments

@MartijnR
Copy link

Loading the latest node-libxslt module fails.

Reproduce (used node v0.12.7 on Ubuntu 14.04):

  1. npm install libxslt
  2. node
    > var libxslt = require('libxslt');

Error:

Error: /home/vagrant/node_modules/libxslt/build/Release/node-libxslt.node: undefined symbol: LIBXSLT_DEFAULT_PLUGINS_PATH
    at Error (native)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at bindings (/home/vagrant/node_modules/libxslt/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/home/vagrant/node_modules/libxslt/index.js:8:34)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)

(this works fine in node-libxslt v0.4.1)

@MartijnR
Copy link
Author

Is this reproducible for anybody?

@MartijnR
Copy link
Author

MartijnR commented Sep 1, 2015

Resolved in 0.5.3. Whoheee! 👍

@MartijnR MartijnR closed this as completed Sep 1, 2015
@MartijnR
Copy link
Author

MartijnR commented Sep 1, 2015

Maybe I cheered too soon. I'll update this.

@MartijnR MartijnR reopened this Sep 1, 2015
@MartijnR
Copy link
Author

MartijnR commented Sep 2, 2015

I tried dozens of different Ubuntu version/64-32bit/node version combos. In some the issue occurred. In others it didn't. Doesn't seem to relate to any of those 3 parameters.

The only interesting finding is that it seems that when the npm install libxslt build outputs the following log (without failing to build), the issue does not occur.

==> default: ../deps/libxslt/libxslt/extensions.c: In function ‘xsltExtModuleRegisterDynamic’:
==> default: ../deps/libxslt/libxslt/extensions.c:377:9: warning: implicit declaration of function ‘LIBXSLT_DEFAULT_PLUGINS_PATH’ [-Wimplicit-function-declaration]
==> default:          ext_directory = BAD_CAST LIBXSLT_DEFAULT_PLUGINS_PATH();
==> default:          ^
==> default: In file included from /vagrant/node_modules/libxslt/node_modules/libxmljs-mt/vendor/libxml/include/libxml/tree.h:18:0,
==> default:                  from /vagrant/node_modules/libxslt/node_modules/libxmljs-mt/vendor/libxml/include/libxml/parser.h:16,
==> default:                  from /vagrant/node_modules/libxslt/node_modules/libxmljs-mt/vendor/libxml/include/libxml/globals.h:18,
==> default:                  from /vagrant/node_modules/libxslt/node_modules/libxmljs-mt/vendor/libxml/include/libxml/threads.h:35,
==> default:                  from /vagrant/node_modules/libxslt/node_modules/libxmljs-mt/vendor/libxml/include/libxml/xmlmemory.h:218,
==> default:                  from ../deps/libxslt/libxslt/extensions.c:18:
==> default: /vagrant/node_modules/libxslt/node_modules/libxmljs-mt/vendor/libxml/include/libxml/xmlstring.h:35:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
==> default:  #define BAD_CAST (xmlChar *)
==> default:                   ^
==> default: ../deps/libxslt/libxslt/extensions.c:377:25: note: in expansion of macro ‘BAD_CAST’
==> default:          ext_directory = BAD_CAST LIBXSLT_DEFAULT_PLUGINS_PATH();
==> default:                          ^
==> default: ../deps/libxslt/libxslt/extensions.c: In function ‘xsltRegisterExtModuleElement’:
==> default: ../deps/libxslt/libxslt/extensions.c:1625:9: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
==> default:      int ret;
==> default:          ^

If the above output is missing the issue does occur.

It occurs in the default Travis test environment (Ubuntu 12.04, 64 bit). Do you want a PR that simply adds a test for something like:

it('is loadable with require()', function(){
  require('libxslt').should.be.type('object');
});

@MartijnR
Copy link
Author

MartijnR commented Sep 2, 2015

update:

Even if require('libxslt') doesn't fail, actually using the module will still show an error:

dyld: lazy symbol binding failed: Symbol not found: _LIBXSLT_DEFAULT_PLUGINS_PATH
  Referenced from: /Users/martijnvanderijdt/Dropbox/enketo-transformer/node_modules/libxslt/build/Release/node-libxslt.node
  Expected in: dynamic lookup

dyld: Symbol not found: _LIBXSLT_DEFAULT_PLUGINS_PATH
  Referenced from: /Users/martijnvanderijdt/Dropbox/enketo-transformer/node_modules/libxslt/build/Release/node-libxslt.node
  Expected in: dynamic lookup

Trace/BPT trap: 5

@albanm
Copy link
Owner

albanm commented Sep 3, 2015

Ok, sorry for the delay, I will have a look soon. Last items are interesting, I do not reproduce the failure, but I do see the warning. So fixing the latter might do the trick.

Unfortunately I can't take time at work, and my home internet connection is broken right now. So it won't be before a few days.

@albanm
Copy link
Owner

albanm commented Sep 8, 2015

Can you try with the latest release (0.5.4) please ?

@MartijnR
Copy link
Author

MartijnR commented Sep 8, 2015

This fixed it! 👍 Fantastic! Thanks a lot. Successfully tested in Ubuntu 14.04 (node 0.10 and 0.12)

(I'm getting a segmentation fault in OS X (node 0.10 and 0.12) but that seems to be entirely different (somewhat known) libxmljs issue.)

@MartijnR MartijnR closed this as completed Sep 8, 2015
albanm added a commit that referenced this issue Nov 16, 2015
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

2 participants