GNOME Bugzilla – Bug 792580
Segfault with nested exslt function calls
Last modified: 2018-01-17 13:59:36 UTC
Created attachment 366888 [details] last.xsl Since commit 470b17346163ba3deceb29eb4149ae140b595cdd (Rewrite memory management of local RVTs) the attached code results in a segmentation fault. (used git bisect to find it) Versions affected: 1.1.30, 1.1.31, 1.1.32 The transformation works fine with 1.1.29 /usr/local/libxslt-1.1.32/bin/xsltproc --verbose last.xsl last.xml creating dictionary for stylesheet reusing dictionary from last.xsl for stylesheet xsltParseStylesheetProcess : found stylesheet add extension prefix func Registering extension namespace 'http://exslt.org/functions'. Initializing module with callback: http://exslt.org/functions xsltPreprocessStylesheet: removing ignorable blank node xsltCompilePattern : parsing 'site' xsltCompilePattern : parsed site, default priority 0.000000 added pattern : 'site' priority 0.000000 exsltFuncFunctionComp: register {http://exslt.org/functions}a xsltParseStylesheetTop : found foreign element function exsltFuncFunctionComp: register {http://exslt.org/functions}string-clear xsltParseStylesheetTop : found foreign element function exsltFuncFunctionComp: register {http://exslt.org/functions}string-clear-char xsltParseStylesheetTop : found foreign element function parsed 1 templates Resolving attribute sets references Creating sub-dictionary from stylesheet for transformation exsltFuncRegisterFunc: register {http://exslt.org/functions}a exsltFuncRegisterFunc: register {http://exslt.org/functions}string-clear exsltFuncRegisterFunc: register {http://exslt.org/functions}string-clear-char Registered module http://exslt.org/functions Registered 1 modules reusing transformation dict for output Registering global variables Registering global variables from last.xsl xsltProcessOneNode: no template found for / xsltProcessOneNode: applying template 'site' for site xsltValueOf: select func:a(1) Lookup function {http://exslt.org/functions}a found function a Handling xsl:with-param depth Building variable depth Evaluating variable 'depth' xsltApplySequenceConstructor: copy text 0 xsltCopyText: copy text 0 Object is an XSLT value tree : 1 TEXT [....] xsltFreeStackElem: Unexpected RVT flag 0 xsltFreeStackElem: Unexpected RVT flag 0 xsltFreeStackElem: Unexpected RVT flag 0 xsltFreeStackElem: Unexpected RVT flag 0 xsltFreeStackElem: Unexpected RVT flag 0 xsltFreeStackElem: Unexpected RVT flag 0 xsltFreeStackElem: Unexpected RVT flag 0 xsltFreeStackElem: Unexpected RVT flag 0 Flagging RVT 0x55e29f770620: 0x3 -> 0x1 xsltCopyTextString: copy text 12 xsltValueOf: result '12' Segmentation fault Dist: Alpine Linux, musl Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7d95b0d in free () from /lib/ld-musl-x86_64.so.1 (gdb) bt
+ Trace 238339
Created attachment 366889 [details] last.xml
Fixed here: https://git.gnome.org/browse/libxslt/commit/?id=8bd32f7753ac253a54279a0b6a88d15a57076bb0 Thanks for the report!
Thanks for the fast fix, i can confirm that it works now!