ThinkGeo.com    |     Documentation    |     Premium Support

Crash with v14.5.1 and Win10

Hi,

It seems that from some reason using GDAL on v14.5.1 causes a crash with Win10 (x64) but works properly with Win11 (x64). I was able to re-produce this problem simply by creating empty gdal converter:

    private async void MapView_Loaded(object sender, RoutedEventArgs e)
    {
        GdalProjectionConverter converter = new GdalProjectionConverter();           
    } 

When such app is run on Win10 it will crash with following exception:

The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at OSGeo.OSR.OsrPINVOKE.SetPROJSearchPaths(IntPtr[])
at OSGeo.OSR.Osr.SetPROJSearchPaths(System.String[])
at ThinkGeo.Core.GdalManager.8EE=(System.String)
at ThinkGeo.Core.GdalManager.7UE=()
at ThinkGeo.Core.GdalManager.60E=()
at ThinkGeo.Core.GdalManager…cctor()

Exception Info: System.TypeInitializationException
at ThinkGeo.Core.GdalManager.ConfigureGdal()
at ThinkGeo.Core.GdalProjectionConverter…cctor()

Exception Info: System.TypeInitializationException
at ThinkGeo.Core.GdalProjectionConverter…ctor()
at TestApp.MainWindow+<MapView_Loaded>d__17.MoveNext() at

On Win11 it works fine. Please check what’s the problem.

Br, Simo

Hi Simo,

Not very sure why Win10 doesn’t like this method: SetPROJSearchPaths(). We walked it around anyway. Please pull the latest beta026 and have a try.

Thanks,
Ben

Hi,

Tested with beta026 and it crashed now like this:

Exception Info: System.AccessViolationException
at OSGeo.GDAL.GdalPINVOKE.AllRegister()
at OSGeo.GDAL.Gdal.AllRegister()
at ThinkGeo.Core.GdalManager.ConfigureGdal()
at ThinkGeo.Core.GdalProjectionConverter…cctor()

Exception Info: System.TypeInitializationException
at ThinkGeo.Core.GdalProjectionConverter…ctor()
at TestApp.MainWindow+<MapView_Loaded>d__17.MoveNext()

Br,Simo

Hi Simo,

At this point, it doesn’t look like a general Windows 10 issue. It seems more likely to be a machine-specific GDAL initialization or dependency-loading issue.

I’ve attached a small diagnostic project. Please compile it, run it on that Win10 machine, and send me the generated gdal-diagnostic-report.txt.

post12402.GdalDiagnostic.zip (5.0 KB)

Thanks,
Ben