Public bug reported:

Zorba destroys input stream produced by fetch:content too early if
optimization is on.

example query:

import module namespace fetch = "http://www.zorba-xquery.com/modules/fetch";;    
   
import module namespace parse-xml = "http://www.zorba-xquery.com/modules/xml";;  
import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";;
                                                                                
   
  let $xmlcontent := fetch:content("file.xml")                                  
   
  let $contents := parse-xml:parse(                                             
   
        $xmlcontent,                                                            
   
        <opt:options>                                                           
   
          <opt:parse-external-parsed-entity />                                  
   
        </opt:options>)                                                         
   
  return $contents       

file:xml:
any random xml file

executions:
$ ~/zorba/build/bin/zorba -q test.xq -f --optimization-level O0
<?xml version="1.0" encoding="UTF-8"?>
<a/>
$ ~/zorba/build/bin/zorba -q test.xq -f --optimization-level O1
<?xml version="1.0" encoding="UTF-8"?>
Segmentation fault (core dumped)

** Affects: zorba
     Importance: Undecided
     Assignee: Matthias Brantner (matthias-brantner)
         Status: New

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/1015560

Title:
  segmentation fault when using fetch and parse in one flwor

Status in Zorba - The XQuery Processor:
  New

Bug description:
  Zorba destroys input stream produced by fetch:content too early if
  optimization is on.

  example query:

  import module namespace fetch = "http://www.zorba-xquery.com/modules/fetch";;  
     
  import module namespace parse-xml = 
"http://www.zorba-xquery.com/modules/xml";;  
  import schema namespace opt = 
"http://www.zorba-xquery.com/modules/xml-options";;
                                                                                
     
    let $xmlcontent := fetch:content("file.xml")                                
     
    let $contents := parse-xml:parse(                                           
     
          $xmlcontent,                                                          
     
          <opt:options>                                                         
     
            <opt:parse-external-parsed-entity />                                
     
          </opt:options>)                                                       
     
    return $contents       

  file:xml:
  any random xml file

  executions:
  $ ~/zorba/build/bin/zorba -q test.xq -f --optimization-level O0
  <?xml version="1.0" encoding="UTF-8"?>
  <a/>
  $ ~/zorba/build/bin/zorba -q test.xq -f --optimization-level O1
  <?xml version="1.0" encoding="UTF-8"?>
  Segmentation fault (core dumped)

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/1015560/+subscriptions

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to