Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#5775 closed defect (fixed)

Segmentation fault with OGR_SKIP and LIBKML

Reported by: juliomalegria Owned by: warmerdam
Priority: normal Milestone: 1.11.2
Component: OGR_SF Version: 1.11.1
Severity: normal Keywords: libkml, segmentation fault, crash
Cc:

Description (last modified by juliomalegria)

Hey guys,

This is how you can repro this (you need to have LIBKML compiled):

$ ogrinfo --version
GDAL 1.11.1, released 2014/09/24

$ ogrinfo --formats | grep KML
  -> "LIBKML" (read/write)
  -> "KML" (read/write)

$python
from osgeo import ogr
ogr.RegisterAll()
ogr.RegisterAll()
# This works ...

$python
import os
os.environ['OGR_SKIP'] = 'LIBKML'
from osgeo import ogr
ogr.RegisterAll()
ogr.RegisterAll()
Segmentation fault

I works if I skip any other library

$python
import os
os.environ['OGR_SKIP'] = 'GeoJSON'
from osgeo import ogr
ogr.RegisterAll()
ogr.RegisterAll()
# This also works ..

Change History (3)

comment:1 Changed 7 years ago by juliomalegria

Description: modified (diff)

comment:2 Changed 7 years ago by Even Rouault

Milestone: 1.11.2
Resolution: fixed
Status: newclosed

branches/1.11 r28157 "LIBKML: when skipped, fix segfault on second OGRRegisterAll() call (#5775)"

Was fixed in trunk with RFC 46 works

comment:3 Changed 7 years ago by Even Rouault

branches/1.11 r28162, trunk r28163 "LIBKML: do not delete the libkml singleton factory. Causes weird issues (sometimes...) with Python autotest suite when it explicitely tries to call OGRCleanupAll(). And on Windows there might be cross-heap issues in using delete on the factory pointer (linked to #5775)"

Note: See TracTickets for help on using tickets.