sindresorhus / Gifski

🌈 Convert videos to high-quality GIFs on your Mac
https://sindresorhus.com/gifski
MIT License
7.72k stars 290 forks source link

Crash in gif.ski #266

Closed sindresorhus closed 1 year ago

sindresorhus commented 2 years ago

https://console.firebase.google.com/project/gifski/crashlytics/app/ios:com.sindresorhus.Gifski/issues/c2da0bdd2b7fae3c734166dbf7d61d60?time=last-seven-days&sessionEventKey=a6fc7bdec398422caf43bda02b3a0a44_1631347088885649806

Gifski 2.20.0 on macOS 12.1.0

Crashed: remap
0  libsystem_kernel.dylib         0x7112 __pthread_kill + 10
1  libsystem_pthread.dylib        0x6214 pthread_kill + 263
2  libsystem_c.dylib              0x81d10 abort + 123
3  Gifski                         0x1f91a9 panic_abort::__rust_start_panic::abort::h0472f302e563a8aa + 44 (lib.rs:44)
4  Gifski                         0x1f9189 __rust_start_panic + 39 (lib.rs:39)
5  Gifski                         0x1e6ebc rust_panic + 672 (panicking.rs:672)
6  Gifski                         0x1e6d87 std::panicking::rust_panic_with_hook::h151f3b3bf37b4f17 + 642 (panicking.rs:642)
7  Gifski                         0x1e676e std::panicking::begin_panic_handler::_$u7b$$u7b$closure$u7d$$u7d$::hf6660086d9ebd48c + 521 (panicking.rs:521)
8  Gifski                         0x1e36c7 std::sys_common::backtrace::__rust_end_short_backtrace::h34152178ea368a9a + 139 (backtrace.rs:139)
9  Gifski                         0x1e66da rust_begin_unwind + 517 (panicking.rs:517)
10 Gifski                         0x26129f core::panicking::panic_fmt::hb64a2db862b4aca0 + 100 (panicking.rs:100)
11 Gifski                         0x261266 core::panicking::panic_bounds_check::h66e87d7dddc1fcf1 + 76 (panicking.rs:76)
12 Gifski                         0x194234 imagequant::nearest::vp_create_node::h0050854bedfa38a8 + 4443869748
13 Gifski                         0x193b47 imagequant::nearest::Nearest::new::hebd087adfd5d7100 + 4443867975
14 Gifski                         0x178d5b imagequant::remap::remap_to_palette::h27a706f375d4f316 + 4443757915
15 Gifski                         0x17a904 imagequant::remap::Remapped::new::h19be884fa7a478ff + 4443764996
16 Gifski                         0x182126 imagequant::quant::QuantizationResult::write_remapped_image_rows_internal::h7072d7edc41f770b + 4443795750
17 Gifski                         0x182812 imagequant::quant::QuantizationResult::remapped::he094208227a7a372 + 4443797522
18 Gifski                         0xf88e2 gifski::Writer::remap_frames::h1039ad7759580a08 + 4443232482
19 Gifski                         0xe54fb std::sys_common::backtrace::__rust_begin_short_backtrace::h50656718550521db + 4443153659
20 Gifski                         0x1028c8 core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h11d7a08a62b898fa + 4443273416
21 Gifski                         0x1f0ad7 std::sys::unix::thread::Thread::new::thread_start::h1ebadf8a3a1817e4 + 330 (alloc.rs:330)
22 libsystem_pthread.dylib        0x64f4 _pthread_start + 125
23 libsystem_pthread.dylib        0x200f thread_start + 15

// @kornelski

kornelski commented 2 years ago

Are you able to capture stderr? That would be helpful, since it lacks the error message.

sindresorhus commented 2 years ago

The error is from a random user, not me. The Crashlytics report does not include stderr.

sindresorhus commented 2 years ago

Is there anything we can do to ensure the error message is included in the future?

kornelski commented 2 years ago

Yeah, I could capture panics and return them from the API as errors + strings.

sindresorhus commented 2 years ago

Isn't that unsafe? Panic is by definition for unrecoverable errors, so if it's actually recoverable, shouldn't the API panicking use Result or something instead? I have no idea how Rust works though.

kornelski commented 2 years ago

It's safe. Panic is equivalent to ObjC exception. It's thrown before something unsafe happens.

sindresorhus commented 1 year ago

Closing as I haven't seen any more crashes like this.