[PROJ] Odd 6.3.0RC1 issue

Roger Bivand Roger.Bivand at nhh.no
Mon Dec 30 09:59:34 PST 2019


On Mon, 30 Dec 2019, Even Rouault wrote:

>> Here I'm just reporting a very puzzling issue. Checking across some other
>> EPSG, it seems to affect EPSG:27700
>
> Looking a bit at
> https://r-forge.r-project.org/scm/viewvc.php/pkg/src/ogr_proj.cpp?annotate=906&root=rgdal
> I see several issues, but I don't think they explain the issue you get:
>
> - memory leak: papszOptions set at lines 381 and 382 is not freed with
>   CSLDestroy()

OK

>
> - use after free: ToWGS84 and Datum are used at lines 427 and 42. But
>   they are owned by hSRS, which is itself owned by poLayer which is
>   itself owned by poDS, which is freed at line 423.  Furthermore, even
>   if that issue is fixed, values returned by GetAttrValue() should be
>   considered as short-lived, and valid only until the next call to the
>   OSR API (some methods might modify the internal WKT representation and
>   invalidate them)
>

They have seemed robust so far - they are used to see whether a DATUM or 
TOWGS84 is present in the instantiated object, and then check after 
exportToProj4() to see if they vanished. I'll see whether I shouldn't copy 
them to SEXP straight away.

> - the call to morphFromESRI() at line 412 is no longer needed with GDAL
>   3.

OK

>
> I'd suggest you run this code under Valgrind.

Thanks, I'm just trying to avoid falling too far behind, valgrind is lower 
down the to-do list.

Code example sent crossing your reply - conclusion there that this is in 
my code but has surfaced through something changing between 6.2.1 and 
6.3.0.

Roger

>
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: Roger.Bivand at nhh.no
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en


More information about the PROJ mailing list