Skip to content

segmentation fault #11

Open
webr3 opened this Issue Nov 22, 2010 · 17 comments

7 participants

@webr3
webr3 commented Nov 22, 2010

node 3.1 on ubuntu 10.10, 32 bit - that's as much info as I've got, seg faults as soon as you require

@javruben
Ajax.org B.V. member

The module is compiled for node 0.2.x. You could recompile o3 yourself for node 0.3. The source is here: https://github.com/ajaxorg/o3

@webr3
webr3 commented Nov 22, 2010

cheers, will give it a got and let you know :)

@webr3
webr3 commented Nov 26, 2010

cool - the rebuild worked.. but failing on 'no method getAttributeNodeNS' - are namespaces not supported?

@curtisc
curtisc commented Feb 14, 2011

Now that the new stable version of node.js is 0.4, can you post new binaries for that version?

@jbeard4
jbeard4 commented Jun 4, 2011

+1 to request for up-to-date binaries

@jbeard4
jbeard4 commented Jun 4, 2011

Are there instructions anywhere for building o3-xml? It doesn't come with a makefile or anything I recognize as a standard build script.

@jbeard4
jbeard4 commented Jun 4, 2011

I'm getting a segfault on Ubuntu 10.04 with node 0.4.7, even after building the module using the node_modules_build script. Any help would be appreciated.

@curtisc
curtisc commented Jun 4, 2011

@jbeard4 after some load testing I found that the o3-xml library has a memory leak, so I've since switched to xml2js, which is very lightweight and fast

@jbeard4
@curtisc
curtisc commented Jun 4, 2011

@jbeard4 looks like there hasn't been a commit to o3 or node-o3-xml since February. Not sure what the official status of it is, but that's certainly a long time between commits

@jbeard4
jbeard4 commented Jun 5, 2011

For completeness, here's a link to the question I've posted on stack overflow: http://stackoverflow.com/questions/6240577/node-js-library-implementing-w3c-xml-dom

@jbeard4
jbeard4 commented Jun 5, 2011

After building a binary myself, it looks like segfault might only be occurring in the node REPL. Here is a reduced test case:

fs = require("fs")
xml = require("../lib/o3-xml");
s = fs.readFileSync("test01.xml", "utf8")
d = xml.parseFromString(s)

test01.xml:

<?xml version="1.0"?><catalog></catalog>

Segfaults in node REPL, but works otherwise. It looks like this might be distinct from the issue mentioned in the original bug report, so I may open a new one.

@intool
intool commented Jun 5, 2011

@curtisc thanks for the insight into the memory leak issue with o3-xml. shame.
is there a decent tutorial/example for using xml2js you can point us to?
Thanks.

@curtisc
curtisc commented Jun 5, 2011

@grpwnd the docs on the xml2js repo are small but solid. The one thing you have to do when switching from a library like o3 to xml2js is to switch from a synchronous to asynchronous mindset (which you're probably already used to since you're using node).

Basically, the parse function fires an end event once it's done parsing, and you can play with the data from there. The example in the tests folder of the repo has a good example: https://github.com/Leonidas-from-XIV/node-xml2js/blob/master/test/xml2js.test.js

@intool
intool commented Jun 6, 2011

@curtisc thanks for speedy reply.
assert.equal(@curstic, "Hero!"); // :-)
Was being lazy. but now read thru the tests + fixture and it all makes perfect sense.
Will be using xml2js for sure. no-brainer for simple projects!

@NV
NV commented Jun 14, 2011

Are there instructions anywhere for building o3-xml?

I'm still interested.

@simonster

A little birdie told me that there are binaries for newer node versions at https://github.com/ajaxorg/node-o3-xml-v4. Not sure if they work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.