Skip to content

Crash: Double-free in AnimationContext when removing animations (Core Animation engine) #2628

@ed-huang-jp

Description

@ed-huang-jp

Summary

App crashes with ___BUG_IN_CLIENT_OF_LIBMALLOC_POINTER_BEING_FREED_WAS_NOT_ALLOCATED when AnimationContext is deallocated. This occurs due to a race condition between Swift ARC and Core Animation's memory management when removing animations.

Crash Stack Trace

Crashed: com.apple.main-thread

0  libsystem_kernel.dylib         0xb1dc __pthread_kill + 8
1  libsystem_pthread.dylib        0x7c60 pthread_kill + 268
2  libsystem_c.dylib              0x770ac abort + 124
3  libsystem_malloc.dylib         0x16d70 malloc_vreport + 892
4  libsystem_malloc.dylib         0x169e8 malloc_report + 64
5  libsystem_malloc.dylib         0x11594 ___BUG_IN_CLIENT_OF_LIBMALLOC_POINTER_BEING_FREED_WAS_NOT_ALLOCATED + 32
6  libswiftCore.dylib             0x39978c _swift_release_dealloc + 56
7  libswiftCore.dylib             0x39a700 bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1>>::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 152
8  App                            0x241498 destroy for AnimationContext + 4338406552

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions