Closed AndrewAnnex closed 1 year ago
To add internal PROJ debugging: https://pyproj4.github.io/pyproj/stable/advanced_examples.html#debugging-internal-proj
@snowman2 didn't seem to help, I see a debug call to fopen for proj.ini which succeeds before the segfault
$ python debug.py
Segmentation fault (core dumped)
$ gdb python
...
(gdb) run debug.py
Starting program:~/bin/python debug.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6d90b90 in osgeo::proj::crs::GeographicCRS::coordinateSystem() const () from ~/lib/libproj.so.25
projinfo 'PROJCRS["Earth (2015) / Ocentric/ Equirectangular, clon = 0",BASEGEODCRS["Earth (2015) / Ocentric", DATUM["Earth (2015)", ELLIPSOID["Earth (2015)", 6378136.6, 298.25700617732406,LENGTHUNIT["metre", 1, ID["EPSG", 9001]]], ANCHOR["Greenwich : 0"]],PRIMEM["Reference Meridian", 0, ANGLEUNIT["degree", 0.0174532925199433, ID["EPSG", 9122]]], ID["IAU", 39902, 2015]],CONVERSION["Equirectangular, clon = 0", METHOD["Equidistant Cylindrical", ID["EPSG", 1028]], PARAMETER["Latitude of 1st standard parallel", 0, ANGLEUNIT["degree",0.0174532925199433,ID["EPSG", 9122]], ID["EPSG", 8823]], PARAMETER["Longitude of natural origin", 0, ANGLEUNIT["degree",0.0174532925199433,ID["EPSG", 9122]], ID["EPSG", 8802]], PARAMETER["False easting", 0, LENGTHUNIT["metre",1,ID["EPSG", 9001]], ID["EPSG", 8806]],PARAMETER["False northing", 0, LENGTHUNIT["metre",1,ID["EPSG", 9001]], ID["EPSG", 8807]]],CS[Cartesian, 2], AXIS["Easting (E)", east, ORDER[1], LENGTHUNIT["metre", 1]], AXIS["Northing (N)", north, ORDER[2], LENGTHUNIT["metre", 1]],ID["IAU", 39912, 2015]]' --identify -o PROJ
PROJ.4 string:
+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +a=6378136.6 +rf=298.257006177324 +units=m +no_defs +type=crs
Segmentation fault (core dumped)
Forwarded: https://github.com/OSGeo/PROJ/issues/3828
Nice that you found more, I thought I was following the instructions well enough but didn’t know gdb would just work.- Dr. Andrew AnnexOn Jul 17, 2023, at 2:31 PM, Alan D. Snow @.***> wrote: Forwarded: OSGeo/PROJ#3828
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
Code Sample, a copy-pastable example if possible
note it's easier to copy/paste the following into ipython
Problem description
Pyproj (or more realistically proj underneath) seg faults when
to_authority
is called for some, but not all, IAU CRSs.In the above code, the crs object is created but calling to_authority (or seemingly repr) causes a segmentation fault and termination of the python process.
Although the information I pasted below was for my m1 mac where I am developing, this issue is also happening in CI builds in ubuntu-latest: https://github.com/AndrewAnnex/planetcantile/actions/runs/5576629154/jobs/10188207849
So it looks like this is probably a relatively recently introduced issue as builds 2-3 months ago were working prior to the recent releases of PyProj/Proj.
Hopefully the call to to_authority is granular enough, due to the segfault it gets annoying to try to see if there is a more diagnostic function that could be used to debug proj from python-land so I haven't dug as deeply as may be possible.
Expected Output
not a seg fault
Environment Information
pyproj info: pyproj: 3.6.0 PROJ: 9.2.1 data dir: /Users/andrew/mambaforge/envs/morecantile/share/proj user_data_dir: /Users/andrew/Library/Application Support/proj PROJ DATA (recommended version): 1.14 PROJ Database: 1.2 EPSG Database: v10.088 [2023-05-13] ESRI Database: ArcGIS Pro 3.1 [2023-19-01] IGNF Database: 3.1.0 [2019-05-24]
System: python: 3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 18:08:41) [Clang 15.0.7 ] executable: /Users/andrew/mambaforge/envs/morecantile/bin/python machine: macOS-13.4.1-arm64-arm-64bit
Python deps: certifi: 2023.5.7 Cython: None setuptools: 68.0.0 pip: 23.2
Installation method
conda (via mamba)
Conda environment information (if you installed with conda):
Details about
conda
and system (conda info
):