Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Core / ASTextKitAttributes] Thread sanitizers #552

Closed
Kaspik opened this issue Sep 6, 2017 · 4 comments
Closed

[Core / ASTextKitAttributes] Thread sanitizers #552

Kaspik opened this issue Sep 6, 2017 · 4 comments

Comments

@Kaspik
Copy link
Contributor

Kaspik commented Sep 6, 2017

Hey team! i know you have been looking at some main-thread access problems. Have you also been able to take a look on sanitizers? It looks like there are some issues with text attributes.

Latest Texture on CocoaPods, latest version of iOS.

WARNING: ThreadSanitizer: data race (pid=58487)
  Read of size 8 at 0x7b20000f9e98 by thread T34:
  * #0 ASTextKitAttributes::operator==(ASTextKitAttributes const&) const ASTextKitAttributes.h:124 (AsyncDisplayKit:x86_64+0x5da4e8)
    #1 -[ASTextNodeRendererKey isEqual:] ASTextNode.mm:88 (AsyncDisplayKit:x86_64+0x5d9cff)
    #2 CFEqual <null>:8571360 (CoreFoundation:x86_64+0x1a33c)
    #3 -[ASTextNodeDrawParameter rendererForBounds:] ASTextNode.mm:155 (AsyncDisplayKit:x86_64+0x5db0d2)
    #4 +[ASTextNode drawRect:withParameters:isCancelled:isRasterizing:] ASTextNode.mm:509 (AsyncDisplayKit:x86_64+0x5e31dd)
    #5 __90-[ASDisplayNode(AsyncDisplay) _displayBlockWithAsynchronous:isCancelledBlock:rasterizing:]_block_invoke.74 ASDisplayNode+AsyncDisplay.mm:258 (AsyncDisplayKit:x86_64+0x1baa1d)
    #6 __71-[_ASAsyncTransaction addOperationWithBlock:priority:queue:completion:]_block_invoke _ASAsyncTransaction.mm:422 (AsyncDisplayKit:x86_64+0x1d95a)
    #7 invocation function for block in ASAsyncTransactionQueue::GroupImpl::schedule(long, NSObject<OS_dispatch_queue>*, void () block_pointer) _ASAsyncTransaction.mm:255 (AsyncDisplayKit:x86_64+0x13825)
    #8 __tsan::invoke_and_release_block(void*) <null>:8571360 (libclang_rt.tsan_iossim_dynamic.dylib:x86_64+0x637fb)
    #9 _dispatch_client_callout <null>:8571360 (libdispatch.dylib:x86_64+0x343b)

  Previous write of size 8 at 0x7b20000f9e98 by thread T32:
  * #0 ASTextKitAttributes::ASTextKitAttributes() ASTextKitAttributes.h:33 (AsyncDisplayKit:x86_64+0x55a4f8)
    #1 ASTextKitAttributes::ASTextKitAttributes() ASTextKitAttributes.h:33 (AsyncDisplayKit:x86_64+0x55a399)
    #2 -[ASTextNodeRendererKey .cxx_construct] ASTextNode.mm:65 (AsyncDisplayKit:x86_64+0x5dab6f)
    #3 object_cxxConstructFromClass <null>:8571360 (libobjc.A.dylib:x86_64+0x39b9)
    #4 -[ASTextNodeDrawParameter rendererForBounds:] ASTextNode.mm:155 (AsyncDisplayKit:x86_64+0x5db0d2)
    #5 +[ASTextNode drawRect:withParameters:isCancelled:isRasterizing:] ASTextNode.mm:509 (AsyncDisplayKit:x86_64+0x5e31dd)
    #6 __90-[ASDisplayNode(AsyncDisplay) _displayBlockWithAsynchronous:isCancelledBlock:rasterizing:]_block_invoke.74 ASDisplayNode+AsyncDisplay.mm:258 (AsyncDisplayKit:x86_64+0x1baa1d)
    #7 __71-[_ASAsyncTransaction addOperationWithBlock:priority:queue:completion:]_block_invoke _ASAsyncTransaction.mm:422 (AsyncDisplayKit:x86_64+0x1d95a)
    #8 invocation function for block in ASAsyncTransactionQueue::GroupImpl::schedule(long, NSObject<OS_dispatch_queue>*, void () block_pointer) _ASAsyncTransaction.mm:255 (AsyncDisplayKit:x86_64+0x13825)
    #9 __tsan::invoke_and_release_block(void*) <null>:8571360 (libclang_rt.tsan_iossim_dynamic.dylib:x86_64+0x637fb)
    #10 _dispatch_client_callout <null>:8571360 (libdispatch.dylib:x86_64+0x343b)

  Issue is caused by frames marked with "*".

  Location is heap block of size 120 at 0x7b20000f9e80 allocated by thread T32:
    #0 calloc <null>:8571376 (libclang_rt.tsan_iossim_dynamic.dylib:x86_64+0x46be2)
    #1 class_createInstance <null>:8571376 (libobjc.A.dylib:x86_64+0xf011)
    #2 -[ASTextNodeDrawParameter rendererForBounds:] ASTextNode.mm:155 (AsyncDisplayKit:x86_64+0x5db0d2)
    #3 +[ASTextNode drawRect:withParameters:isCancelled:isRasterizing:] ASTextNode.mm:509 (AsyncDisplayKit:x86_64+0x5e31dd)
    #4 __90-[ASDisplayNode(AsyncDisplay) _displayBlockWithAsynchronous:isCancelledBlock:rasterizing:]_block_invoke.74 ASDisplayNode+AsyncDisplay.mm:258 (AsyncDisplayKit:x86_64+0x1baa1d)
    #5 __71-[_ASAsyncTransaction addOperationWithBlock:priority:queue:completion:]_block_invoke _ASAsyncTransaction.mm:422 (AsyncDisplayKit:x86_64+0x1d95a)
    #6 invocation function for block in ASAsyncTransactionQueue::GroupImpl::schedule(long, NSObject<OS_dispatch_queue>*, void () block_pointer) _ASAsyncTransaction.mm:255 (AsyncDisplayKit:x86_64+0x13825)
    #7 __tsan::invoke_and_release_block(void*) <null>:8571376 (libclang_rt.tsan_iossim_dynamic.dylib:x86_64+0x637fb)
    #8 _dispatch_client_callout <null>:8571376 (libdispatch.dylib:x86_64+0x343b)

  Thread T34 (tid=2258442, running) is a GCD worker thread

  Thread T32 (tid=2258440, running) is a GCD worker thread

SUMMARY: ThreadSanitizer: data race ASTextKitAttributes.h:124 in ASTextKitAttributes::operator==(ASTextKitAttributes const&) const
==================

screen shot 2017-09-06 at 11 34 21

screen shot 2017-09-06 at 11 34 43

screen shot 2017-09-06 at 11 37 41

@Kaspik
Copy link
Contributor Author

Kaspik commented Nov 2, 2017

No Response two months? 😞
Still an issue, still kinda big one.
@Adlai-Holler @maicki @garrettmoon

@hebertialmeida
Copy link
Contributor

I also have noticed some race conditions on ASTextKitAttributes.

@MiguelChiang
Copy link

I met the exact same problem, but have no idea how it impact on the performance yet.

SUMMARY: ThreadSanitizer: data race ASTextKitAttributes.h:124 in ASTextKitAttributes::operator==(ASTextKitAttributes const&) const

@Kaspik
Copy link
Contributor Author

Kaspik commented Oct 24, 2018

Fixed already.

@Kaspik Kaspik closed this as completed Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants