-
Notifications
You must be signed in to change notification settings - Fork 293
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
read_sf GeoPackage crashes R #1606
Comments
is this a binary or a source install? |
From source. I've also rebuilt from source |
Have you tried binary installs? |
No, I built R from source to get OpenBLAS support and so AFAIK I can't install binaries, am I right? Is there a way I could extract some debug information more than the Traceback? PS: I've also installed everything from scratch in a new R installation, but I get the same outcome. |
Yes, but I'm not a mac user so can't help you with that. I guess you're using dynamic linking; a common source of problems is that you have more than one version of GDAL, GEOS and or PROJ installed on your system. |
I'll check it out and I'll also recompile them from source. I'll close the ticket in the meantime. |
Solved? |
Not really. I've rebuilt from source GDAL and R packages |
I've just tried to rebuilt R from source and install the packages from scratch with no luck neither. |
Did you make 100% sure there is one and only one of the GEOS, GDAL and PROJ libraries on your system? |
I apologise for closing and reopening the issue. I get the same issue using
So I guess it's exceed
My session info:
|
Yes. I only install them using Homebrew and there is only one version for each. I don't have any installation from a third repository. |
Did you compile the command line tool |
I first used a binary downloaded from Homebrew and then I compiled it from source, in both cases I could read the GeoPackage without issues. |
Since this happens both with rgdal and sf, it seems like a problem with your GDAL setup. I suggest to close here. |
Thank you for the support. |
@edzer I solved it with a workaround: creating a connection as a SQLite file and then reading it.
|
Facing the same issue macOS 11.2.1 library(sf)
st_read(system.file("gpkg/nc.gpkg", package="sf"), quiet = TRUE)
Linking to GEOS 3.9.1, GDAL 3.2.1, PROJ 7.2.1
*** caught segfault ***
address 0x100000000, cause 'memory not mapped'
Traceback:
1: CPL_read_ogr(dsn, layer, query, as.character(options), quiet, type, fid_column_name, drivers, wkt_filter, promote_to_multi, int64_as_string, dsn_exists, dsn_isdb)
2: st_read.character(system.file("gpkg/nc.gpkg", package = "sf"), quiet = TRUE)
3: st_read(system.file("gpkg/nc.gpkg", package = "sf"), quiet = TRUE) |
Please consider running R -d gdb and reporting the output. |
Hi @rsbivand , this is my output:
|
Try (untried) |
Then, I could type text but not R commands. |
(if this works like |
Thanks for the clue @edzer . Now, it works like a charm.
If I run it like usual without the flag |
Oh, that is nasty! Could you try running the script with valgrind, i.e. within |
Ok! Unfortunately, I get the same output than with
I'm not sure if I needed to add something at the end to run it or similar:
But it outputs the same error. |
You'd need to install |
It will take a bit of time, cause it's not available in Homebrew for macOS. I'll let you know as soon as I get it. |
Unfortunately, it's not available for macOS 11.x
Is there another alternative that we could try? |
I am having the same problem. Reading geopackage files crushes R I am using macOS Big Sur 11.2.3
Matrix products: default locale: attached base packages: other attached packages: loaded via a namespace (and not attached): |
Same question on https://stat.ethz.ch/pipermail/r-sig-geo/2021-March/028632.html. I relied there:
|
Further, with R 4.0.4 on Rosetta but with CRAN binary packages, there is no problem. It is most likely that the problem is caused by user-installed upstream software components, and sf or rgdal installed from source, possibly with |
GPKG read and write work again flawlessly with the latest commits of sf (370f934) and the latest release of GDAL (3.2.2_1) in Homebrew. Thank you a lot for your support! |
OK, for your installation, the GDAL 3.2.1 binary was broken but 3.2.2 is not, or your source GDAL 3.2.1 was broken for reasons unknown, but 3.2.2 is not. These systems are deterministic, so it would have helped (others, later on) to establish and reproduce what was broken. However, good to hear that 3.2.2 appears to work. |
Thank you very much Roger and Alberto.
It works after updating GDAL 3.2.2
Manuel
El sáb, 3 abr 2021 a las 7:27, Roger Bivand ***@***.***>)
escribió:
… OK, for your installation, the GDAL 3.2.1 binary was broken but 3.2.2 is
not, or your source GDAL 3.2.1 was broken for reasons unknown, but 3.2.2 is
not. These systems are deterministic, so it would have helped (others,
later on) to establish and reproduce what was broken. However, good to hear
that 3.2.2 appears to work.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1606 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFI3FB6MKTSPKQENYS4QKMTTG4JUHANCNFSM4X45562A>
.
--
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
***@***.*** ***@***.***>
***@***.***
Teléfono: (506) 8706 - 4662
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
|
@rsbivand I wouldn't say GDAL was broken at that point, since it was working properly and it was reading GPKG files in version 3.2.1. Many things have been upgraded since then, including GDAL version (not the way it was built in Homebrew) but also the sf R package (I haven't checked all the commits since the issue was opened). That's way I couldn't determine the reason, although I agree with you that it would have been interested to know it. Thank you for your support. |
I'm sporadically getting this issue (caught segfault, memory not mapped) on Ubuntu, with GDAL 3.0.2. Seems to normally happen with larger geopackages. It seems the solution is to update GDAL to > 3.2.2 ? Or is it more complex than that? Thanks |
reinstall |
Cheers |
Hi,
I've just installed
sf
from GitHub (0.9-8) on macOS Big Sur (11.2.1).There is no error when building the package, but when I try to read a GeoPackage, R crashes.
I don't get any clue from the Traceback in order to fix it.
I'm able to read the GeoPackage with
ogrinfo
tough, so I guess it's not a problem with GDAL installation.Moreover, I'm able to read a SHP file with
sf
.Could it be a problem with my
sf
installation or perhaps a bug with GeoPackage in sf?I was able to read the file before upgrading to latest version of GDAL, GEOS, Proj and sf.
Thank you in advance.
The text was updated successfully, but these errors were encountered: