Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: address issue where PROJ core dumps on proj_create with +init= when global context does not have data directory set #419

Merged
merged 1 commit into from
Aug 31, 2019

Conversation

snowman2
Copy link
Member

@snowman2
Copy link
Member Author

Before:

>>> from pyproj import CRS
>>> cc = CRS("+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
>>> cc = CRS(init="epsg:4326")
Segmentation fault (core dumped)

After:

>>> from pyproj import CRS
>>> cc = CRS(init="epsg:3857")
>>> cc
<Projected CRS: EPSG:3857>
Name: WGS 84 / Pseudo-Mercator
Axis Info [cartesian]:
- E[east]: Easting (metre)
- N[north]: Northing (metre)
Area of Use:
- name: World - 85°S to 85°N
- bounds: (-180.0, -85.06, 180.0, 85.06)
Coordinate Operation:
- name: Popular Visualisation Pseudo-Mercator
- method: Popular Visualisation Pseudo Mercator
Datum: World Geodetic System 1984
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich

@@ -42,6 +41,7 @@ cdef class ContextManager:
for iii in range(len(data_dir_list)):
b_data_dir = cstrencode(data_dir_list[iii])
c_data_dir[iii] = b_data_dir
proj_context_set_search_paths(NULL, len(data_dir_list), c_data_dir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small remark here: it might be useful to add a comment on why this line is here (maybe linking to one of the issue explaining it).

I was actually reading this code in one of the other PRs and already wondering why the search paths were set twice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea. I would like to change this solution in 2.4 as I don't want to reset the global context each time. It's okay in this context as it is only set once.

@snowman2 snowman2 deleted the no_proj_lib_core_dump_fix branch September 2, 2019 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2.3.0 seg faults under Ubuntu PROJ 6.1+ (pyproj 2.2+ wheels) incompatible with previous versions
2 participants