-
Notifications
You must be signed in to change notification settings - Fork 791
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
PROJ core dumps when setting data directory on specific context and it is not set on global context #1574
Comments
The tricky part is to have the data directory in a place where PROJ cannot find it and then use |
Note: This issue began in PROJ 6.1 and still persists in 6.2 |
This is also problematic for pyproj wheels when the PROJ_LIB is set to an old PROJ data directory. The global context finds the old data directory without the |
I tried to reproduce, but couldn't manage. A bit confused by your explanations. Could you give an exact way to reproduce (possibly with a standalone C file) or perhaps display the stack trace where it crashes ?
|
As a side note, I generally find it quite difficult to debug problems presented in the form of pyproj code. If the problem can be reproduced using PROJ apps or a bit of C code that it is preferable. |
I definitely see that the explanation is confusing. Code is definitely a good way to communicate. Hopefully this will help: Step 1:Move the PROJ data directory to a non-standard location where it cannot be auto detected and is not set by PROJ_LIB. Step 2:Create a new context and set the search paths without setting it in the global context. Then, attempt to create a CRS using the
Updated to allow init rules ^^ |
I've tested your above (updated) script, and can't make it crash
The hardcoded data path is (/home/even/proj/install-proj-master/share/proj and I renamted it to (/home/even/proj/install-proj-master/share/proj.disabed |
One step closer. Can you try with:
The reason is that the new context needs the path to the PROJ data directory in its moved form while the main/global PROJ context cannot find it. |
Still no crash. New output is
|
Hmmm, strange. Wonder what the difference is on my end. That's where it core dumps in the pyproj code. I wonder if running as a C program instead of Cpp makes any difference? |
I doubt so. Why not running your python code under gdb and displaying the stack trace when it crashes as I suggested above in #1574 (comment) ? |
The output is here: pyproj4/pyproj#368 (comment) |
Another one is here: pyproj4/pyproj#351 |
In pyproj4/pyproj#368, there's not the full backtrace and no line number, so hard to do something with it. |
Makes sense. I will see if I can get better debugging information later. |
|
Seems to be the infinite loop problem. |
oh! I can finally reproduce with your procedure #1574 (comment) + #1574 (comment) . The extra needed step is to have a 'epsg' file coming from PROJ 5.2 in the default PROJ resource directory. Or equivalently have PROJ_LIB pointing to the resource directory of PROJ 5.2 |
PROJStringParser::createFromPROJString(): avoid potential infinite recursion (fixes #1574)
…cursion (fixes #1574) The exact circumstances are a bit difficult to explain, but they involve using a non-default context, enabling proj_context_use_proj4_init_rules() on it, using proj_create(ctxt, "+init=epsg:XXXX +type=crs"), whereas PROJ_LIB is defined to a directory that has a 'epsg' file in it.
[Backport 6.2] PROJStringParser::createFromPROJString(): avoid potential infinite recursion (fixes #1574)
pyproj4/pyproj#419
This is a wierd edge case that has taken me some time to track down as the cause has been elusive for quite some time due to the core dumping. However, I believe the symptoms and the solution should help find a solution in PROJ I believe.
In the case where the data directory is not able to be determined by PROJ in the default locations on the global context, it will core dump when attempting to use
proj_create
with a perfectly valid custom context that has the proper data directory set. However, this does not happen in all instances. It only happens when using the+init=
syntax.For example:
My guess is it has to do with:
PROJ/src/iso19111/c_api.cpp
Lines 437 to 440 in f059b90
The fix I applied in pyproj was to set the data directory for the global PROJ context along with the custom context.
The text was updated successfully, but these errors were encountered: