Opened 14 years ago

Last modified 14 years ago

#3711 closed defect

EXCEPTION_ACCESS_VIOLATION, when using GDAL Java API — at Initial Version

Reported by: jimmyzhao Owned by: Even Rouault
Priority: highest Milestone:
Component: JavaBindings Version: 1.7.1
Severity: critical Keywords: GDAL, GeoRaster
Cc: warmerdam

Description

I use GDAL Java API to write raster data to Oracle Spatial GeoRaster Object, and encouter a strange problem: " # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0afa0770, pid=5904, tid=5548 # # JRE version: 6.0_15-b03 # Java VM: Java HotSpot(TM) Client VM (14.1-b02 mixed mode windows-x86 ) # Problematic frame: # C [gdal17.dll+0x190770] # # An error report file with more information is saved as: # D:\workspace\GDALTest\hs_err_pid5904.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. " This is my Java codes: import org.gdal.gdal.gdal; import org.gdal.gdalconst.gdalconstConstants; import org.gdal.gdal.Band; import org.gdal.gdal.Dataset; import org.gdal.gdal.Driver;

import java.nio.ByteBuffer;

public class GDALTest1 {

/

  • @param args */

public static void main(String[] args) {

Dataset Dataset1; Dataset Dataset2; Band Band1; Band Band2; gdal.AllRegister(); Dataset1 = gdal.Open("georaster:georaster/georaster@localhost:1521/orcl,rdt_2,0"); Dataset2 = gdal.Open("georaster:georaster/georaster@localhost:1521/orcl,rdt_2,0", gdalconstConstants.GA_Update); Band1 = Dataset1.GetRasterBand(1); Band2 = Dataset2.GetRasterBand(1); Dataset2.SetProjection(Dataset1.GetProjection()); Dataset2.SetGeoTransform(Dataset1.GetGeoTransform()); System.out.println("Passing information from input dataset to output dataset"); int XSize = 100; ByteBuffer buffer = ByteBuffer.allocateDirect(XSize); buffer = Band1.ReadRaster_Direct(0,0,XSize,1); Band2.WriteRaster_Direct(0,0,XSize,1,buffer); Dataset2.FlushCache(); System.out.println(buffer.getLong()); Dataset1.delete(); Dataset2.delete();

}

}

When executing the sentence "Dataset2.FlushCache();", the above problem rises.

The exact error report is attached.

Change History (2)

by jimmyzhao, 14 years ago

Attachment: hs_err_pid5904.log added

error report

by jimmyzhao, 14 years ago

Attachment: hs_err_pid1464.log added
Note: See TracTickets for help on using tickets.