Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Prevent a crash when the data is released to early #124

Merged
merged 5 commits into from Aug 15, 2019
Merged

Prevent a crash when the data is released to early #124

merged 5 commits into from Aug 15, 2019

Conversation

ghost
Copy link

@ghost ghost commented Aug 15, 2019

Increase retain count so not released too early.

Closes #118

@sindresorhus sindresorhus changed the title Increase retain count so not released too early. Prevent a crash when the data is released to early Aug 15, 2019
@sindresorhus sindresorhus merged commit 2ec78f3 into sindresorhus:master Aug 15, 2019
@sindresorhus
Copy link
Owner

Thanks for figuring this out @BowdusBrown 🙌

@ghost ghost mentioned this pull request Aug 16, 2019
@sindresorhus
Copy link
Owner

This unfortunately didn't completely fix the issue. We got crash on 2.0.1 too:

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x7fff37320dd5 (Missing)
1  libobjc.A.dylib                0x7fff633e8720 (Missing)
2  CoreFoundation                 0x7fff3739e195 (Missing)
3  CoreFoundation                 0x7fff372c2a60 (Missing)
4  CoreFoundation                 0x7fff372c2408 (Missing)
5  Gifski                         0x106f6e01c @objc closure #2 in static Gifski.run(_:completionHandler:) + 89 (Gifski.swift:89)
6  Gifski                         0x106fb16cd _$LT$gifski..progress..ProgressCallback$u20$as$u20$gifski..progress..ProgressReporter$GT$::increase::h38ffd2e7bb6b7e57
7  Gifski                         0x106fa710a gifski::Writer::write::h1eb5ab514f9fa4f5
8  Gifski                         0x106f9e9cb gifski::c_api::gifski_write_sync_internal::h1a54fe83339af658
9  Gifski                         0x106fae677 std::sys_common::backtrace::__rust_begin_short_backtrace::h28370955d1d61629
10 Gifski                         0x106fa294c std::panicking::try::do_call::h578df899fd17ea4e (.llvm.11735245384841396633)
11 Gifski                         0x107036f2c __rust_maybe_catch_panic + 31 (lib.rs:31)
12 Gifski                         0x106fafce0 core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hba4f2f753a7ab554
13 Gifski                         0x1070094ee _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h184cdfe19b856bb1 + 219 (alloc.rs:219)
14 Gifski                         0x107035fbe std::sys::unix::thread::Thread::new::thread_start::he418bbb505b1b1b9 + 103 (alloc.rs:103)
15 libsystem_pthread.dylib        0x7fff646aa305 (Missing)
16 libsystem_pthread.dylib        0x7fff646ad26f (Missing)
17 libsystem_pthread.dylib        0x7fff646a9415 (Missing)

Maybe we need to move the progress variable out into a static variable too?

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

Successfully merging this pull request may close these issues.

Crash: "Gifski.run(_:completionHandler:)"
2 participants