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

GDALRasterSource gives segmentation fault when reading rasters with NBITS=1 #3300

Closed
jterry64 opened this issue Oct 29, 2020 · 4 comments · Fixed by #3368
Closed

GDALRasterSource gives segmentation fault when reading rasters with NBITS=1 #3300

jterry64 opened this issue Oct 29, 2020 · 4 comments · Fixed by #3368
Assignees
Labels

Comments

@jterry64
Copy link

Describe the bug

When trying to read rasters using GDALRasterSource that have nbits=1 and CCITTFAX4 compression GDAL options, I get the following error:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f5618facf8a, pid=13276, tid=0x00007f55e9371700
#
# JRE version: OpenJDK Runtime Environment (8.0_252-b09) (build 1.8.0_252-b09)
# Java VM: OpenJDK 64-Bit Server VM (25.252-b09 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libc.so.6+0x9af8a]  __memcpy_sse2_unaligned_erms+0x1fa

If I change to the same raster but without any special GDAL options, it works fine.

To Reproduce

Here's a sample of a raster file that causes the issue: is__umd_tree_cover_gain_20N_100E.tif.zip

This how I'm using the GDALRasterSource and LayoutTileSource in my code:

https://github.com/wri/gfw_forest_loss_geotrellis/blob/3947899c4b985e9fad4f57bb7cf18bfc8fb279af/src/main/scala/org/globalforestwatch/layers/Layer.scala#L166

https://github.com/wri/gfw_forest_loss_geotrellis/blob/3947899c4b985e9fad4f57bb7cf18bfc8fb279af/src/main/scala/org/globalforestwatch/layers/Layer.scala#L314

I'm reading raster tiles from S3.

Expected behavior

No segmentation fault.

Environment

  • Java version: 8
  • Scala version: 2.12.6
  • GeoTrellis version: 3.5.0
  • GDAL version: 3.1.2

Additional context

Discussed with @pomadchin in gitter for context

@jterry64
Copy link
Author

Hey @pomadchin, just checking in since it's been a few months - is there a plan to fix this at some point in the future?

@pomadchin
Copy link
Member

Hi @jterry64 unfortunately we didn't have a chance to look into it. I can confirm that this bug is not present in Py bindings though, so that should be smth very specific to our bindings.

@pomadchin pomadchin changed the title GDALRasterSource gives segmentation fault when reading rasters with NBITS=1 and CCITTFAX4 compression GDAL options GDALRasterSource gives segmentation fault when reading rasters with NBITS=1 Mar 26, 2021
@pomadchin pomadchin self-assigned this Mar 26, 2021
@pomadchin
Copy link
Member

Hey @jterry64, could you verify that #3368 solves your issue?

Be careful with its testing though. The demo file size is only 8.4M, however, it is a 40000 x 40000 raster. Meaning that it would require a 40000 x 40000 Byte array allocation in JVM.

@pomadchin
Copy link
Member

This issue was closed, but feel free to reopen if it is still an issue. Shortly the new 3.5.3-SNAPSHOT release would be available in our eclipse snapshots repo. That would simplify testing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants