Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Crash on "func delayForImageAtIndex(_ index: Int, source: CGImageSource!) -> Double" #87

Open
ThePredators opened this issue Aug 27, 2019 · 3 comments

Comments

@ThePredators
Copy link

The library was working good for a while, and today for no reason it crashed while loading the Gif from assets.

The given error is :

==319==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x0001625a04e0 at pc 0x000103eeb7ac bp 0x00016f8b0b10 sp 0x00016f8b0b08
READ of size 8 at 0x0001625a04e0 thread T1
    #0 0x103eeb7a8 in $sSo7UIImageC14SwiftGifOriginE20delayForImageAtIndex_6sourceSdSi_So16CGImageSourceRefaSgtFZ (/private/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xf7a8)
    #1 0x103ee8a98 in $sSo7UIImageC14SwiftGifOriginE23animatedImageWithSourceyABSgSo07CGImageH3RefaFZ (/private/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xca98)
    #2 0x103ee7b78 in $sSo7UIImageC14SwiftGifOriginE3gif4dataABSg10Foundation4DataV_tFZ (/private/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xbb78)
    #3 0x103ee730c in $sSo7UIImageC14SwiftGifOriginE3gif5assetABSgSS_tFZ (/private/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xb30c)
    #4 0x103ee6c44 in $sSo11UIImageViewC14SwiftGifOriginE04loadD05assetySS_tFyycfU_ (/private/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xac44)
    #5 0x103ee5c5c in $sIeg_IeyB_TR (/private/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0x9c5c)
    #6 0x1010557c4 in __wrap_dispatch_async_block_invoke (/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64+0x517c4)
    #7 0x10421f6ec in _dispatch_call_block_and_release (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x36ec)
    #8 0x104220c70 in _dispatch_client_callout (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x4c70)
    #9 0x104223ad0 in _dispatch_queue_override_invoke (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x7ad0)
    #10 0x104231dc4 in _dispatch_root_queue_drain (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x15dc4)
    #11 0x1042327a8 in _dispatch_worker_thread2 (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x167a8)
    #12 0x1f6ba41b0 in _pthread_wqthread (/usr/lib/system/libsystem_pthread.dylib:arm64+0xc1b0)

0x0001625a04e1 is located 0 bytes to the right of 1-byte region [0x0001625a04e0,0x0001625a04e1)
allocated by thread T1 here:
    #0 0x101057160 in wrap_posix_memalign (/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64+0x53160)
    #1 0x22487b87c in swift_slowAlloc (/usr/lib/swift/libswiftCore.dylib:arm64+0x28987c)
    #2 0x103eeb608 in $sSo7UIImageC14SwiftGifOriginE20delayForImageAtIndex_6sourceSdSi_So16CGImageSourceRefaSgtFZ (/private/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xf608)
    #3 0x103ee8a98 in $sSo7UIImageC14SwiftGifOriginE23animatedImageWithSourceyABSgSo07CGImageH3RefaFZ (/private/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xca98)
    #4 0x103ee7b78 in $sSo7UIImageC14SwiftGifOriginE3gif4dataABSg10Foundation4DataV_tFZ (/private/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xbb78)
    #5 0x103ee730c in $sSo7UIImageC14SwiftGifOriginE3gif5assetABSgSS_tFZ (/private/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xb30c)
    #6 0x103ee6c44 in $sSo11UIImageViewC14SwiftGifOriginE04loadD05assetySS_tFyycfU_ (/private/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xac44)
    #7 0x103ee5c5c in $sIeg_IeyB_TR (/private/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0x9c5c)
    #8 0x1010557c4 in __wrap_dispatch_async_block_invoke (/var/containers/Bundle/Application/28B9D6D0-2AE8-4362-A106-57DEE6F810F2/ecb.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64+0x517c4)
    #9 0x10421f6ec in _dispatch_call_block_and_release (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x36ec)
    #10 0x104220c70 in _dispatch_client_callout (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x4c70)
    #11 0x104223ad0 in _dispatch_queue_override_invoke (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x7ad0)
    #12 0x104231dc4 in _dispatch_root_queue_drain (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x15dc4)
    #13 0x1042327a8 in _dispatch_worker_thread2 (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x167a8)
    #14 0x1f6ba41b0 in _pthread_wqthread (/usr/lib/system/libsystem_pthread.dylib:arm64+0xc1b0)

Thread T1 created by T0 here:
    <empty stack>

Thanks.

@StasanTelnov
Copy link

Hello, I have a same problem.
My log is:

=================================================================
==2388==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x0002828ae850 at pc 0x000108d23340 bp 0x000170760c30 sp 0x000170760c28
READ of size 8 at 0x0002828ae850 thread T6
    #0 0x108d2333c in $sSo7UIImageC14SwiftGifOriginE20delayForImageAtIndex_6sourceSdSi_So16CGImageSourceRefaSgtFZ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xf33c)
    #1 0x108d1ffcc in $sSo7UIImageC14SwiftGifOriginE23animatedImageWithSourceyABSgSo07CGImageH3RefaFZ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xbfcc)
    #2 0x108d1f29c in $sSo7UIImageC14SwiftGifOriginE3gif4dataABSg10Foundation4DataV_tFZ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xb29c)
    #3 0x10443b4a0 in $s0016Redmond__bAgEypb27DishHowCookingContainerViewC8fillData_5indexyAA23RecipeStepResponseModelC_SitFyycfU_ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Redmond.Еда:arm64+0x1001134a0)
    #4 0x10433a7e4 in $sIeg_IeyB_TR (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Redmond.Еда:arm64+0x1000127e4)
    #5 0x105ed5380 in __wrap_dispatch_async_block_invoke (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64+0x3d380)
    #6 0x10929e334 in _dispatch_call_block_and_release (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x2334)
    #7 0x10929f72c in _dispatch_client_callout (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x372c)
    #8 0x1092b0ec4 in _dispatch_root_queue_drain (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x14ec4)
    #9 0x1092b1694 in _dispatch_worker_thread2 (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x15694)
    #10 0x1a2b28b34 in _pthread_wqthread (/usr/lib/system/libsystem_pthread.dylib:arm64+0xbb34)
    #11 0x1a2b2b73c in start_wqthread (/usr/lib/system/libsystem_pthread.dylib:arm64+0xe73c)

0x0002828ae851 is located 0 bytes to the right of 1-byte region [0x0002828ae850,0x0002828ae851)
allocated by thread T6 here:
    #0 0x105ed6830 in wrap_posix_memalign (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64+0x3e830)
    #1 0x1b057f69c in swift_slowAlloc (/usr/lib/swift/libswiftCore.dylib:arm64+0x2d169c)
    #2 0x108d22aa8 in $sSo7UIImageC14SwiftGifOriginE20delayForImageAtIndex_6sourceSdSi_So16CGImageSourceRefaSgtFZ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xeaa8)
    #3 0x108d1ffcc in $sSo7UIImageC14SwiftGifOriginE23animatedImageWithSourceyABSgSo07CGImageH3RefaFZ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xbfcc)
    #4 0x108d1f29c in $sSo7UIImageC14SwiftGifOriginE3gif4dataABSg10Foundation4DataV_tFZ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xb29c)
    #5 0x10443b4a0 in $s0016Redmond__bAgEypb27DishHowCookingContainerViewC8fillData_5indexyAA23RecipeStepResponseModelC_SitFyycfU_ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Redmond.Еда:arm64+0x1001134a0)
    #6 0x10433a7e4 in $sIeg_IeyB_TR (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Redmond.Еда:arm64+0x1000127e4)
    #7 0x105ed5380 in __wrap_dispatch_async_block_invoke (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64+0x3d380)
    #8 0x10929e334 in _dispatch_call_block_and_release (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x2334)
    #9 0x10929f72c in _dispatch_client_callout (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x372c)
    #10 0x1092b0ec4 in _dispatch_root_queue_drain (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x14ec4)
    #11 0x1092b1694 in _dispatch_worker_thread2 (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x15694)
    #12 0x1a2b28b34 in _pthread_wqthread (/usr/lib/system/libsystem_pthread.dylib:arm64+0xbb34)
    #13 0x1a2b2b73c in start_wqthread (/usr/lib/system/libsystem_pthread.dylib:arm64+0xe73c)

Thread T6 created by T0 here:
    <empty stack>

SUMMARY: AddressSanitizer: heap-buffer-overflow (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xf33c) in $sSo7UIImageC14SwiftGifOriginE20delayForImageAtIndex_6sourceSdSi_So16CGImageSourceRefaSgtFZ
Shadow bytes around the buggy address:
  0x000159c35cb0: 00 00 00 00 fa fa 00 00 00 00 fa fa 00 00 00 00
  0x000159c35cc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x000159c35cd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x000159c35ce0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x000159c35cf0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x000159c35d00: fa fa fa fa fa fa fa fa fa fa[01]fa fa fa fa fa
  0x000159c35d10: 00 00 00 00 fa fa fd fd fd fd fa fa fd fd fd fa
  0x000159c35d20: fa fa fd fd fd fd fa fa fd fd fd fd fa fa 00 00
  0x000159c35d30: 00 fa fa fa 00 00 00 00 fa fa 00 00 00 00 fa fa
  0x000159c35d40: 00 00 00 00 fa fa 00 00 00 00 fa fa 00 00 00 00
  0x000159c35d50: fa fa 00 00 00 00 fa fa 00 00 00 00 fa fa fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
2020-08-18 21:41:15.108209+0300 Redmond.Еда[2388:1693639] =================================================================
2020-08-18 21:41:15.108333+0300 Redmond.Еда[2388:1693639] ==2388==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x0002828ae850 at pc 0x000108d23340 bp 0x000170760c30 sp 0x000170760c28
2020-08-18 21:41:15.108409+0300 Redmond.Еда[2388:1693639] READ of size 8 at 0x0002828ae850 thread T6
2020-08-18 21:41:15.108598+0300 Redmond.Еда[2388:1693639]     #0 0x108d2333c in $sSo7UIImageC14SwiftGifOriginE20delayForImageAtIndex_6sourceSdSi_So16CGImageSourceRefaSgtFZ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xf33c)
2020-08-18 21:41:15.108689+0300 Redmond.Еда[2388:1693639]     #1 0x108d1ffcc in $sSo7UIImageC14SwiftGifOriginE23animatedImageWithSourceyABSgSo07CGImageH3RefaFZ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xbfcc)
2020-08-18 21:41:15.108782+0300 Redmond.Еда[2388:1693639]     #2 0x108d1f29c in $sSo7UIImageC14SwiftGifOriginE3gif4dataABSg10Foundation4DataV_tFZ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xb29c)
2020-08-18 21:41:15.108856+0300 Redmond.Еда[2388:1693639]     #3 0x10443b4a0 in $s0016Redmond__bAgEypb27DishHowCookingContainerViewC8fillData_5indexyAA23RecipeStepResponseModelC_SitFyycfU_ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Redmond.Еда:arm64+0x1001134a0)
2020-08-18 21:41:15.108932+0300 Redmond.Еда[2388:1693639]     #4 0x10433a7e4 in $sIeg_IeyB_TR (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Redmond.Еда:arm64+0x1000127e4)
2020-08-18 21:41:15.109008+0300 Redmond.Еда[2388:1693639]     #5 0x105ed5380 in __wrap_dispatch_async_block_invoke (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64+0x3d380)
2020-08-18 21:41:15.109080+0300 Redmond.Еда[2388:1693639]     #6 0x10929e334 in _dispatch_call_block_and_release (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x2334)
2020-08-18 21:41:15.109151+0300 Redmond.Еда[2388:1693639]     #7 0x10929f72c in _dispatch_client_callout (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x372c)
2020-08-18 21:41:15.109219+0300 Redmond.Еда[2388:1693639]     #8 0x1092b0ec4 in _dispatch_root_queue_drain (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x14ec4)
2020-08-18 21:41:15.109289+0300 Redmond.Еда[2388:1693639]     #9 0x1092b1694 in _dispatch_worker_thread2 (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x15694)
2020-08-18 21:41:15.109359+0300 Redmond.Еда[2388:1693639]     #10 0x1a2b28b34 in _pthread_wqthread (/usr/lib/system/libsystem_pthread.dylib:arm64+0xbb34)
2020-08-18 21:41:15.109429+0300 Redmond.Еда[2388:1693639]     #11 0x1a2b2b73c in start_wqthread (/usr/lib/system/libsystem_pthread.dylib:arm64+0xe73c)
2020-08-18 21:41:15.109495+0300 Redmond.Еда[2388:1693639] 
2020-08-18 21:41:15.109563+0300 Redmond.Еда[2388:1693639] 0x0002828ae851 is located 0 bytes to the right of 1-byte region [0x0002828ae850,0x0002828ae851)
2020-08-18 21:41:15.109630+0300 Redmond.Еда[2388:1693639] allocated by thread T6 here:
2020-08-18 21:41:15.109699+0300 Redmond.Еда[2388:1693639]     #0 0x105ed6830 in wrap_posix_memalign (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64+0x3e830)
2020-08-18 21:41:15.109771+0300 Redmond.Еда[2388:1693639]     #1 0x1b057f69c in swift_slowAlloc (/usr/lib/swift/libswiftCore.dylib:arm64+0x2d169c)
2020-08-18 21:41:15.109841+0300 Redmond.Еда[2388:1693639]     #2 0x108d22aa8 in $sSo7UIImageC14SwiftGifOriginE20delayForImageAtIndex_6sourceSdSi_So16CGImageSourceRefaSgtFZ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xeaa8)
2020-08-18 21:41:15.109916+0300 Redmond.Еда[2388:1693639]     #3 0x108d1ffcc in $sSo7UIImageC14SwiftGifOriginE23animatedImageWithSourceyABSgSo07CGImageH3RefaFZ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xbfcc)
2020-08-18 21:41:15.109989+0300 Redmond.Еда[2388:1693639]     #4 0x108d1f29c in $sSo7UIImageC14SwiftGifOriginE3gif4dataABSg10Foundation4DataV_tFZ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xb29c)
2020-08-18 21:41:15.110073+0300 Redmond.Еда[2388:1693639]     #5 0x10443b4a0 in $s0016Redmond__bAgEypb27DishHowCookingContainerViewC8fillData_5indexyAA23RecipeStepResponseModelC_SitFyycfU_ (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Redmond.Еда:arm64+0x1001134a0)
2020-08-18 21:41:15.110145+0300 Redmond.Еда[2388:1693639]     #6 0x10433a7e4 in $sIeg_IeyB_TR (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Redmond.Еда:arm64+0x1000127e4)
2020-08-18 21:41:15.110213+0300 Redmond.Еда[2388:1693639]     #7 0x105ed5380 in __wrap_dispatch_async_block_invoke (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/libclang_rt.asan_ios_dynamic.dylib:arm64+0x3d380)
2020-08-18 21:41:15.110284+0300 Redmond.Еда[2388:1693639]     #8 0x10929e334 in _dispatch_call_block_and_release (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x2334)
2020-08-18 21:41:15.110355+0300 Redmond.Еда[2388:1693639]     #9 0x10929f72c in _dispatch_client_callout (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x372c)
2020-08-18 21:41:15.110425+0300 Redmond.Еда[2388:1693639]     #10 0x1092b0ec4 in _dispatch_root_queue_drain (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x14ec4)
2020-08-18 21:41:15.110491+0300 Redmond.Еда[2388:1693639]     #11 0x1092b1694 in _dispatch_worker_thread2 (/usr/lib/system/introspection/libdispatch.dylib:arm64+0x15694)
2020-08-18 21:41:15.110556+0300 Redmond.Еда[2388:1693639]     #12 0x1a2b28b34 in _pthread_wqthread (/usr/lib/system/libsystem_pthread.dylib:arm64+0xbb34)
2020-08-18 21:41:15.110622+0300 Redmond.Еда[2388:1693639]     #13 0x1a2b2b73c in start_wqthread (/usr/lib/system/libsystem_pthread.dylib:arm64+0xe73c)
2020-08-18 21:41:15.110687+0300 Redmond.Еда[2388:1693639] 
2020-08-18 21:41:15.110748+0300 Redmond.Еда[2388:1693639] Thread T6 created by T0 here:
2020-08-18 21:41:15.110817+0300 Redmond.Еда[2388:1693639]     <empty stack>
2020-08-18 21:41:15.110887+0300 Redmond.Еда[2388:1693639] 
2020-08-18 21:41:15.110954+0300 Redmond.Еда[2388:1693639] SUMMARY: AddressSanitizer: heap-buffer-overflow (/private/var/containers/Bundle/Application/51920F6F-4A96-4E24-A364-732866218CAC/Redmond.Еда.app/Frameworks/SwiftGifOrigin.framework/SwiftGifOrigin:arm64+0xf33c) in $sSo7UIImageC14SwiftGifOriginE20delayForImageAtIndex_6sourceSdSi_So16CGImageSourceRefaSgtFZ
2020-08-18 21:41:15.111022+0300 Redmond.Еда[2388:1693639] Shadow bytes around the buggy address:
2020-08-18 21:41:15.111088+0300 Redmond.Еда[2388:1693639]   0x000159c35cb0: 00 00 00 00 fa fa 00 00 00 00 fa fa 00 00 00 00
2020-08-18 21:41:15.111158+0300 Redmond.Еда[2388:1693639]   0x000159c35cc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
2020-08-18 21:41:15.111224+0300 Redmond.Еда[2388:1693639]   0x000159c35cd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
2020-08-18 21:41:15.111294+0300 Redmond.Еда[2388:1693639]   0x000159c35ce0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
2020-08-18 21:41:15.111366+0300 Redmond.Еда[2388:1693639]   0x000159c35cf0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
2020-08-18 21:41:15.111434+0300 Redmond.Еда[2388:1693639] =>0x000159c35d00: fa fa fa fa fa fa fa fa fa fa[01]fa fa fa fa fa
2020-08-18 21:41:15.111504+0300 Redmond.Еда[2388:1693639]   0x000159c35d10: 00 00 00 00 fa fa fd fd fd fd fa fa fd fd fd fa
2020-08-18 21:41:15.111576+0300 Redmond.Еда[2388:1693639]   0x000159c35d20: fa fa fd fd fd fd fa fa fd fd fd fd fa fa 00 00
2020-08-18 21:41:15.111644+0300 Redmond.Еда[2388:1693639]   0x000159c35d30: 00 fa fa fa 00 00 00 00 fa fa 00 00 00 00 fa fa
2020-08-18 21:41:15.111713+0300 Redmond.Еда[2388:1693639]   0x000159c35d40: 00 00 00 00 fa fa 00 00 00 00 fa fa 00 00 00 00
2020-08-18 21:41:15.111785+0300 Redmond.Еда[2388:1693639]   0x000159c35d50: fa fa 00 00 00 00 fa fa 00 00 00 00 fa fa fd fd
2020-08-18 21:41:15.111852+0300 Redmond.Еда[2388:1693639] Shadow byte legend (one shadow byte represents 8 application bytes):
2020-08-18 21:41:15.111919+0300 Redmond.Еда[2388:1693639]   Addressable:           00
2020-08-18 21:41:15.111981+0300 Redmond.Еда[2388:1693639]   Partially addressable: 01 02 03 04 05 06 07
2020-08-18 21:41:15.112046+0300 Redmond.Еда[2388:1693639]   Heap left redzone:       fa
2020-08-18 21:41:15.112111+0300 Redmond.Еда[2388:1693639]   Freed heap region:       fd
2020-08-18 21:41:15.112178+0300 Redmond.Еда[2388:1693639]   Stack left redzone:      f1
2020-08-18 21:41:15.112242+0300 Redmond.Еда[2388:1693639]   Stack mid redzone:       f2
2020-08-18 21:41:15.112309+0300 Redmond.Еда[2388:1693639]   Stack right redzone:     f3
2020-08-18 21:41:15.112435+0300 Redmond.Еда[2388:1693639]   Stack after return:      f5
2020-08-18 21:41:15.112554+0300 Redmond.Еда[2388:1693639]   Stack use after scope:   f8
2020-08-18 21:41:15.112729+0300 Redmond.Еда[2388:1693639]   Global redzone:          f9
2020-08-18 21:41:15.112801+0300 Redmond.Еда[2388:1693639]   Global init order:       f6
2020-08-18 21:41:15.112941+0300 Redmond.Еда[2388:1693639]   Poisoned by user:        f7
2020-08-18 21:41:15.113014+0300 Redmond.Еда[2388:1693639]   Container overflow:      fc
2020-08-18 21:41:15.113192+0300 Redmond.Еда[2388:1693639]   Array cookie:            ac
2020-08-18 21:41:15.113263+0300 Redmond.Еда[2388:1693639]   Intra object redzone:    bb
2020-08-18 21:41:15.113454+0300 Redmond.Еда[2388:1693639]   ASan internal:           fe
2020-08-18 21:41:15.113625+0300 Redmond.Еда[2388:1693639]   Left alloca redzone:     ca
2020-08-18 21:41:15.113840+0300 Redmond.Еда[2388:1693639]   Right alloca redzone:    cb
2020-08-18 21:41:15.113981+0300 Redmond.Еда[2388:1693639]   Shadow gap:              cc
==2388==ABORTING
Warning: hit breakpoint while running function, skipping commands and conditions to prevent recursion.
AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report.

It is crash on 104 line:

let gifProperties:CFDictionary = unsafeBitCast(gifPropertiesPointer.pointee, to: CFDictionary.self)

Crash work on this gif image (image with one frame): https://redmondeda.ru/media/203c0db5.gif

Any idea how fix it?

@carlosaguiar
Copy link

@ThePredators @StasanTelnov the same thing was happening to me and it stopped crashing when I changed the capacity to 1 (instead of 0)

let gifPropertiesPointer = UnsafeMutablePointer<UnsafeRawPointer?>.allocate(capacity: 1)

Please let me know if the same fix worked for you.

@kecskesk
Copy link

when I changed the capacity to 1 (instead of 0), it started working. Can you explain why?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants