Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3846 closed defect (fixed)

georaster - ORA-31011: XML parsing failed

Reported by: ilucena Owned by: ilucena
Priority: normal Milestone: 1.8.0
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: georaster
Cc: warmerdam

Description

GDAL/GeoRaster crashs while loading images to Oracle.

The debugger log is showing that the XML string is getting corrupted after a call to CPLString::Printf().

"""
  GR1.metadata := XMLTYPE('<georasterMetadata xmlns="http://xmlns.oracle.com/spatial/georaster">
<objectInfo>
<rasterType>21001</rasterType>
<isBlank>false</isBlank>
<defaultRed>1</defaultRed>
<defaultGreen>2</defaultGreen>
<defaultBlue>3</defaultBlue>
</objectInfo>
<rasterInfo>
<cellRepresentation>UNDEFINED</cellRepresentation>
<cellDepth>8BIT_U</cellDepth>
<totalDimensions>3</totalDimensions>
<dimensionSize type="ROW">
<size>8000</size>
</dimensionSize>
<dimensionSize type="COLUMN">
<size>8000</size>
</dimensionSize>
<dimensionSize type="BAND">
<size>3</size>
</dimensionSize>
<ULTCoordinate>
<row>0</row>
<column>0</column>
<band>0</band>
</ULTCoordinate>
<blocking>
<type>REGULAR</type>
<totalRowBlocks>16</totalRowBlocks>
<totalColumnBlocks>16</totalColumnBlocks>
<totalBandBlocks>1</totalBandBlocks>
<rowBlockSize>512</rowBlockSize>
<columnBlockSize>512</columnBlockSize>
<bandBlockSize>3</bandBlockSize>
</blocking>
<interleaving>BSQ</interleaving>
<pyramid>
<type>NONE</type>
</pyramid>
<compression>
<type>NONE</type>
</compression>
</rasterInfo>
<layerInfo>
<layerDimension>BAND</layerDimension>
</layerInfo>
</georasterMetadata>
O   :wktext, :author');
"""

That final portion of the XML ("O :wktext, :author") is part of pre-disposed memory content.

The malformed PL/SQL statement returns that error:

Resulting in:

ERROR 1: ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00245: extra data after end of document

Change History (8)

comment:1 by ilucena, 13 years ago

On r21153 the CPLString.Printf() commands are replace by CPLSPrintf() to avoid reaching some limitation.

Since that error only occurs on user locale, we will wait for their tests to conform if that solve their problem or not. On gdal_autotest it's running fine either way.

comment:2 by ilucena, 13 years ago

Owner: changed from warmerdam to ilucena

comment:3 by ilucena, 13 years ago

revert changes. CPLSPrintf() can't handle the XML even on my system. Current revision r21154

comment:4 by ilucena, 13 years ago

What seems to be happening is that the XML buffer is been handled as ASCII but the rest of the string in CPLString::Printf() is not and that is what makes the final product corrupted. That is an hypotheses.

The option of using CPLSPrintf() is not feasible because that functions currently can't handle string sizes large enough. But even if it could, maybe it would have the same locale problem.

The XML metada size depend on data itself. Color tables, for example, cam make it very large. The solution would be to reduce the size of PL/SQL command to a small and static size and pass the XML portion to as a CLOB update.

That is what the r21157 does. The changes has passed on gdal_autotest but we are going to need to wait for the user to test in his locale to make sure that the problem is solved.

comment:5 by ilucena, 13 years ago

Revision r21222 implements an workaround the problem:

http://trac.osgeo.org/gdal/changeset/21222/trunk/gdal/frmts/georaster

comment:6 by ilucena, 13 years ago

Cc: warmerdam added; yong.zhao@… removed
Resolution: fixed
Status: newclosed

Frank,

Could you please include that revision on the 1.8 RC.

The user in China has reported that everything is working fine with that fix.

Thanks.

comment:7 by warmerdam, 13 years ago

Ivan,

I believe r21222 is already included in the 1.8.0beta1. I won't split off a separate 1.8 branch until we reach the first release candidate.

comment:8 by warmerdam, 13 years ago

Ah, skimming the timeline I see you just made a final fix - r21324. That will be in the beta2 release and in the final 1.8 release.

Note: See TracTickets for help on using tickets.