e2ebridge / xslt4node

A XSLT package wrapping the XSLT interface of the Java API for XML Processing (JAXP)
Other
11 stars 4 forks source link

Segmentation fault: 11 #4

Open codan84 opened 9 years ago

codan84 commented 9 years ago

code in my own node.js module (copied it from 1 of your tests as a starting point):

var ORDER = '<order><book ISBN="10-861003-324"><title>The Handmaid\'s Tale</title><price>19.95</price></book><cd ISBN="2-3631-4"><title>Americana</title><price>16.95</price></cd></order>';
var DISCOUNT = '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:param name="discount"/><xsl:template match="/"><order><xsl:variable name="sub-total" select="sum(//price)"/><total><xsl:value-of select="$sub-total"/></total>15% discount if paid by: <xsl:value-of select="$discount"/></order></xsl:template></xsl:stylesheet>';
var RESULT = '<?xml version="1.0" encoding="UTF-8"?><order><total>36.9</total>15% discount if paid by: 1972/01/01</order>';

var config = {
    xslt: DISCOUNT,
    source: ORDER,
    result: String,
    params: {
        discount: '1972/01/01'
    }
};
xslt4node.transform(config, function (err, result) {
    if (!err) {
        console.log(">>RESULT:");
        console.log(result);
    }else{
        console.log(">>ERROR:");
        console.log(err);
    }
});

On execution of this code I will get in the console:

Segmentation fault: 11

And the node app stops running. No line with >>ERROR: either so it didn't go into callback. Memory access violation issue? OSX 10.9.5 Java 1.8.0_45 Python 2.7.5

p-muessig commented 9 years ago

Unfortunately I do not have access to an OSX system. I tried your example successfully on Ubuntu with node.js 0.10.39 and 0.12.6, gcc 4.84, Java 1.8.0_45 and Python 2.7.6.

kildem commented 9 years ago

I have OSX 10.10 see my test result: https://github.com/e2ebridge/xslt4node/issues/3#issuecomment-103597344

codan84 commented 9 years ago

When I run tests:

$ nodeunit test
test
✔ configuration - ambiguous xslt
✔ configuration - ambiguous source
✔ configuration - source missing
✔ configuration - result missing
Segmentation fault: 11

I would really love to use this library as I can't find any viable alternatives. But I would need to find out what is causing this segmentation fault...