Skip to main content

Hello,

When we set XML-CODE to -1 (to handle functionnal parsing error) in the procedure calld by XML PARSE, the program fail with error : 114     Attempt to access item beyond bounds of memory (Signal 11). Traces show that it is the instruction 'XML PARSE' which cause the error.

Do you have any idea of what can cause this error ?

We are using :

version @(#)cob.c       5.1.1.0
PRN=R9CAO/AAG:9n.K4.51.04
PTI=WrapPack 3
PTI=ES

 

Regards,

Raphaël RABU

Hello,

When we set XML-CODE to -1 (to handle functionnal parsing error) in the procedure calld by XML PARSE, the program fail with error : 114     Attempt to access item beyond bounds of memory (Signal 11). Traces show that it is the instruction 'XML PARSE' which cause the error.

Do you have any idea of what can cause this error ?

We are using :

version @(#)cob.c       5.1.1.0
PRN=R9CAO/AAG:9n.K4.51.04
PTI=WrapPack 3
PTI=ES

 

Regards,

Raphaël RABU

Are you specifying an ON EXCEPTION clause in the XML PARSE statement?

I would expect that you will need to create a support incident for this problem so that we can get a reproducable demo from you.

Please try the following demo and see if you get the 114 error when -1 is moved to xml-code in the START-OF-DOCUMENT event.

     $set mf 
      id division.                                                    
      program-id.   testparse.                                        
      data division.                                                  
      working-storage section.                                        
      01  xml-document.                                                
          05 pic x(36) value '<?xml version="1.0" encoding="UTF-8"'.  
          05 pic x(19) value ' standalone="yes"?>'.                    
          05 pic x(39) value '<!--This document is just an example-->'.
          05 pic x(10) value '<sandwich>'.                            
          05 pic x(35) value ' <bread type="baker's best"/>'.    
          05 pic x(41) value ' <?spread please use real mayonnaise ?>'.
          05 pic x(31) value ' <meat>Ham & turkey</meat>'.        
          05 pic x(40) value ' <filling>Cheese, lettuce, tomato, etc.'.
          05 pic x(10) value '</filling>'.                            
          05 pic x(35) value ' <![CDATA[We should add a <relish>'.    
          05 pic x(22) value ' element in future!]]>'.                
          05 pic x(31) value ' <listprice>$4.99 </listprice>'.        
          05 pic x(27) value ' <discount>0.10</discount>'.            
          05 pic x(11) value '</sandwich>'.                            
      01  xml-document-length         pic 9(3) comp-5.                
      01  current-element             pic x(30).                      
      01  xfr-ed                      pic x(9) justified.              
      01  list-price                  pic 9v99     value 0.            
      01  discount                    pic 9v99     value 0.            
      01  display-price               pic $$9.99.                      
      01  any-key                     pic x.                          
      procedure division.                                              
      000-begin.                                                      
          XML PARSE xml-document PROCESSING PROCEDURE 100-xml-handler  
             ON EXCEPTION                                              
                display 'XML document error ' XML-CODE                
             NOT ON EXCEPTION                                          
                display 'XML document successfully parsed'            
          END-XML                                                      
          display ' '                                                  
          display ' Using information from XML '                      
          display ' '                                                  
          move list-price to display-price                            
          display ' Sandwich list price: ' display-price              
          compute display-price = list-price * (1 - discount)          
          display ' Promotional price: ' display-price                
          display ' Get one today!'                                    
          accept any-key                                              
          stop run.                                                    
     *----------------------------------------------------------------*
      100-xml-handler.                                                
          evaluate XML-EVENT                                          
     *==> Order XML events mostfrequentfirst                          
             when 'START-OF-ELEMENT'                                  
                display 'Start element tag: <' XML-TEXT '>'            
                move XML-TEXT to current-element                      
             when 'CONTENT-CHARACTERS'                                
                display 'Content characters: <' XML-TEXT '>'          
     *==> Transform XML content to operational COBOL data item...      
                evaluate current-element                              
                   when 'listprice'                                    
     *==> Using function NUMVAL-C...                                  
                      compute list-price = function numval-c(XML-TEXT)
                   when 'discount'                                    
     *==> Using de-editing of a numeric edited item...                
                      compute discount = function numval-c(XML-TEXT)  
                end-evaluate                                          
             when 'END-OF-ELEMENT'                                    
                display 'End element tag: <' XML-TEXT '>'              
                move spaces to current-element                        
             when 'START-OF-DOCUMENT'                                  
                compute xml-document-length = function length(XML-TEXT)
                display 'Start of document: length= '                  
                   xml-document-length ' characters.'                  
                move -1 to xml-code                                
             when 'END-OF-DOCUMENT'                                    
                display 'End of document.'                            
             when 'VERSION-INFORMATION'                                
                display 'Version: <' XML-TEXT '>'                      
             when 'ENCODING-DECLARATION'                              
                display 'Encoding: <' XML-TEXT '>'                    
             when 'STANDALONE-DECLARATION'                            
                display 'Standalone: <' XML-TEXT '>'                  
             when 'ATTRIBUTE-NAME'                                    
                display 'Attribute name: <' XML-TEXT '>'              
             when 'ATTRIBUTE-CHARACTERS'                              
                display 'Attribute value characters: <' XML-TEXT '>'  
             when 'ATTRIBUTE-CHARACTER'                                
                display 'Attribute value character: <' XML-TEXT '>'    
             when 'START-OF-CDATA-SECTION'                            
                display 'Start of CData: <' XML-TEXT '>'              
             when 'END-OF-CDATA-SECTION'                              
                display 'End of CData: <' XML-TEXT '>'                
             when 'CONTENT-CHARACTER'                                  
                display 'Content character: <' XML-TEXT '>'            
             when 'PROCESSING-INSTRUCTION-TARGET'                      
                display 'PI target: <' XML-TEXT '>'                    
             when 'PROCESSING-INSTRUCTION-DATA'                        
                display 'PI data: <' XML-TEXT '>'                      
             when 'COMMENT'                                            
                display 'Comment: <' XML-TEXT '>'                      
             when 'EXCEPTION'                                          
                compute xml-document-length = function length(XML-TEXT)
                display 'Exception ' XML-CODE ' at offset'            
                   xml-document-length '.'                            
             when other                                                
                display 'Unexpected XML event: ' XML-EVENT '.'        
          end-evaluate.                                                


Hello,

When we set XML-CODE to -1 (to handle functionnal parsing error) in the procedure calld by XML PARSE, the program fail with error : 114     Attempt to access item beyond bounds of memory (Signal 11). Traces show that it is the instruction 'XML PARSE' which cause the error.

Do you have any idea of what can cause this error ?

We are using :

version @(#)cob.c       5.1.1.0
PRN=R9CAO/AAG:9n.K4.51.04
PTI=WrapPack 3
PTI=ES

 

Regards,

Raphaël RABU

Hello,

The sample is working. After several tests, it seems that error occurs when the xml document zone (xml-document in your sample) is in local storage and its size is greater than 2864 and XML-CODE is set to -1. If the zone is declared in working storage section, or its size is less or equals to 2864, or the XML-CODE is not set to -1 then it works.

a bit ***, isn't it ??

Regards,

Raphaël


Hello,

When we set XML-CODE to -1 (to handle functionnal parsing error) in the procedure calld by XML PARSE, the program fail with error : 114     Attempt to access item beyond bounds of memory (Signal 11). Traces show that it is the instruction 'XML PARSE' which cause the error.

Do you have any idea of what can cause this error ?

We are using :

version @(#)cob.c       5.1.1.0
PRN=R9CAO/AAG:9n.K4.51.04
PTI=WrapPack 3
PTI=ES

 

Regards,

Raphaël RABU

If you wish to report this as a bug then you should open up a support incident with Micro Focus Supportline so that we can document the problem and have Development take a closer look.

Thanks.