`rust future panicked: unknown error` when opening TIFF files

Open
#97 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python, rust

Research direction

Start by running the supplied Python MVCE with async_tiff.TIFF.open and LocalStore, changing file_id across the listed GDAL TIFFs to identify the panic pattern. Trace the Rust error path reached by these inputs and verify that each case returns normally or a regular error instead of rust future panicked: unknown error.

Written by the indexing model from the issue text.

Description

Here is an MVCE for rust panics I encountered when building virtual_tiff. The TIFFs are from GDAL's test suite. You can change file_id to switch which TIFF is being opened.

import obstore as obs
from async_tiff import TIFF
from async_tiff.store import LocalStore
import os
import asyncio


# Set which file to run the test on
file_id = 0

# Download file
store = obs.store.HTTPStore.from_url("https://dagshub.com")

panics = [
    ("gdal_gcore", "huge-number-strips.tif"),
    ("gdal_gcore", "byte_user_defined_geokeys.tif"),
    ("gdal_gcore", "minimum_tiff_tags_no_warning.tif"),
    ("gdal_gcore", "uint16_sgilog.tif"),
    ("gdal_gcore", "corrupted_gtiff_tags.tif"),
    ("gdal_gcore", "gtiff_towgs84_override.tif"),
    ("gdal_gcore", "minimum_tiff_tags_with_warning.tif"),
    ("gdal_gcore", "bigtiff_header_extract.tif"),
    ("gdal_gcore", "spaf27_markedcorrect.tif"),
    ("gdal_gcore", "huge-implied-number-strips.tif"),
    ("gdal_gcore", "excessive-memory-TIFFFillStrip2.tif"),
    ("gdal_gcore", "packbits-not-enough-data.tif"),
    ("gdal_gcore", "excessive-memory-TIFFFillStrip.tif"),
    ("gdal_gcore", "byte_bigtiff_invalid_slong8_for_stripoffsets.tif"),
    ("gdal_gcore", "weird_mercator_2sp.tif"),
    ("gdal_gcore", "many_blocks_truncated.tif"),
    ("gdal_autotest", "epsg_27563_allgeokeys.tif"),
    ("gdal_autotest", "nodata_precision_issue_float32.tif"),
    ("gdal_autotest", "byte_coord_epoch.tif"),
    ("gdal_autotest", "projected_GTCitationGeoKey_with_underscore_and_GeogTOWGS84GeoKey.tif"),
    ("gdal_autotest", "nodata_precision_issue_float32.tif"),
    ("gdal_autotest", "missing_tilebytecounts_and_offsets.tif"),
]
path = f"maxrjones/virtual-tiff/raw/73934fbfb31cd5bb099f225a47ac8ea34298f3ea/tests/dvc/{panics[file_id][0]}/{panics[file_id][1]}"


resp = obs.get(store, path)
with open(panics[file_id][1], "wb") as f:
    for chunk in resp:
        f.write(chunk)

# Attempt to open file using async_tiff
async def open_tiff(*, store, path):
    return await TIFF.open(path, store=store)

store = LocalStore()
filepath = f"{os.getcwd()}/{panics[file_id][1]}"


tiff = asyncio.run(open_tiff(store=store, path=filepath))
print(tiff)

Dominant language
Rust
Stars
125
Forks
17
Avg merge
7h 33m
Merged PRs (30d)
8

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from developmentseed/async-tiff

All issues in developmentseed/async-tiff

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.