duckdb-rs icon indicating copy to clipboard operation
duckdb-rs copied to clipboard

Crash on any DuckDB error while also using skia-safe

Open rory-orennia opened this issue 1 year ago • 2 comments

Getting weird behaviour when any error is returned while also using the skia-safe (https://crates.io/crates/skia-safe) crate. I'm on a Mac with a M3 chip so that might be the only way to reproduce this, but I created a repo that instantly reproduces this for me: https://github.com/rory-orennia/duckdb-bug

If you run that, it will run the most basic examples from duckdb-rs and skia-safe's codebases and will crash on an error when it tries to select a column that doesn't exist (I changed SELECT name to SELECT named).

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.91s
     Running `target/debug/duckdb-bug`
fatal runtime error: Rust cannot catch foreign exceptions
zsh: abort      cargo run

If you comment out the lines listed in the main.rs to stop using skia, suddenly the nice error is returned:

Error: DuckDBFailure(Error { code: Unknown, extended_code: 1 }, 
Some("Binder Error: Referenced column \"named\" not found in FROM clause!\nCandidate bindings: \"person.name\"\n
LINE 1: SELECT id, named, data FROM person\n^"))

I'm stuck on the bundled version of duckdb-rs because nothing else seems to run on the M series mac's. Not sure if that's the issue? Not sure how to progress here since the entire point of this app was to read some data from DuckDB and then draw the results into a png.

Thanks for any help you can provide!

rory-orennia avatar Nov 14 '24 06:11 rory-orennia