bytedance / Bytedance-UnionAD

MIT License
170 stars 54 forks source link

[BUG] iOS12 BURewardedVideoWebViewController WKURLSchemeTaskImpl dealloc 崩溃问题 #121

Closed uzhy1987 closed 2 years ago

uzhy1987 commented 3 years ago

Describe the bug | 问题描述

激励视频 BURewardedVideoWebViewController 会使 WKURLSchemeTaskImpl 在非主线程dealloc,导致崩溃

Environmental information | 环境信息

To Reproduce | 如何复现

iOS12 系统,激励视频

CoderWeiLee commented 3 years ago

我遇到一个全屏播放,崩溃的问题,堆栈信息如下:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x74)
  * frame #0: 0x00007fff24a7c4d8 UIKitCore`____UIKitSharedArtworkManager_block_invoke + 133
    frame #1: 0x000000010b4329c8 libdispatch.dylib`_dispatch_client_callout + 8
    frame #2: 0x000000010b433f33 libdispatch.dylib`_dispatch_once_callout + 66
    frame #3: 0x00007fff24a7c451 UIKitCore`__UIKitSharedArtworkManager + 42
    frame #4: 0x00007fff24caf908 UIKitCore`_UIImageWithNameAndTraitCollection + 215
    frame #5: 0x00007fff24caf80c UIKitCore`_UIImageWithName + 47
    frame #6: 0x00007fff2467a8c5 UIKitCore`+[UIProgressView _fillImagesForIndex:style:barStyle:] + 250
    frame #7: 0x00007fff2467aa95 UIKitCore`+[UIProgressView _standardOuterImageForStyle:barStyle:] + 65
    frame #8: 0x00007fff2467b241 UIKitCore`-[UIProgressView _intrinsicSizeWithinSize:] + 70
    frame #9: 0x00007fff2467b04f UIKitCore`-[UIProgressView setFrame:] + 66
    frame #10: 0x00007fff24bbeae4 UIKitCore`UIViewCommonInitWithFrame + 1604
    frame #11: 0x00007fff24bbe462 UIKitCore`-[UIView initWithFrame:] + 98
    frame #12: 0x00007fff2467ab52 UIKitCore`-[UIProgressView initWithFrame:] + 64
    frame #13: 0x00007fff24bbddc4 UIKitCore`-[UIView init] + 44
    frame #14: 0x0000000109cd8c73 Wallpaper`-[BU_ZFPlayerControlView bottomProgressView] + 69
    frame #15: 0x0000000109cd3311 Wallpaper`-[BU_ZFPlayerControlView init] + 545
    frame #16: 0x0000000109c933e1 Wallpaper`-[BU_ZFPlayerView playerControlView:playerModel:] + 113
    frame #17: 0x0000000109d61208 Wallpaper`-[BUPlayer setupContent] + 227
    frame #18: 0x0000000109d616fb Wallpaper`-[BUPlayer initWithPlayerItem:cacheEnable:] + 124
    frame #19: 0x0000000109d6165d Wallpaper`+[BUPlayer playerWithPlayerItem:cacheEnable:] + 74
    frame #20: 0x0000000109ce6909 Wallpaper`-[BUNativeExpressRewardedVideoAdView _initPlayer] + 337
    frame #21: 0x0000000109c7b173 Wallpaper`-[BUNativeExpressAdView setNativeAd:] + 111
    frame #22: 0x0000000109c7660f Wallpaper`-[BUNativeExpressAdView initWithFrame:nativeAd:] + 191
    frame #23: 0x0000000109ce67b2 Wallpaper`-[BUNativeExpressRewardedVideoAdView initWithFrame:nativeAd:] + 63
    frame #24: 0x0000000109c47aeb Wallpaper`-[BUNativeExpressAdConverter pbu_nativeExpressAdViewWithNativeAd:] + 1108
    frame #25: 0x0000000109c47451 Wallpaper`-[BUNativeExpressAdConverter pbu_fetchTemplateDataWithNativeAd:group:] + 115
    frame #26: 0x0000000109c46e8e Wallpaper`__55-[BUNativeExpressAdConverter convertWithNativeAdArray:]_block_invoke + 555
    frame #27: 0x00007fff2039239f CoreFoundation`__NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 7
    frame #28: 0x00007fff2046992a CoreFoundation`-[__NSSingleObjectArrayI enumerateObjectsWithOptions:usingBlock:] + 80
    frame #29: 0x0000000109c46c00 Wallpaper`-[BUNativeExpressAdConverter convertWithNativeAdArray:] + 195
    frame #30: 0x0000000109d83219 Wallpaper`-[BUNativeExpressAdManager handleSuccessLoadWithNativeAds:] + 142
    frame #31: 0x0000000109d82289 Wallpaper`__56-[BUNativeExpressAdManager pbu_loadRewardedFullscreenAd]_block_invoke + 542
    frame #32: 0x0000000109cf6dc7 Wallpaper`-[BURewardedVideoPreloaderManager callSuccessBlock:withMaterial:] + 36
    frame #33: 0x0000000109cf7320 Wallpaper`__125-[BURewardedVideoPreloaderManager getMaterialMetaFromNetworkWithSlot:sucess:failure:successLoadVideo:failureLoadVideo:IsPre:]_block_invoke + 362
    frame #34: 0x0000000109c670e2 Wallpaper`__66-[BUAPIClient fetchNativeAdsWithAdSlot:reqType:completionHandler:]_block_invoke + 46
    frame #35: 0x0000000109c67e96 Wallpaper`__81-[BUAPIClient fetchNativeAdsJsonWithAdSlot:reqType:slotParams:completionHandler:]_block_invoke_4 + 89
    frame #36: 0x0000000109dcc7f8 Wallpaper`bu_safe_dispatch_async_main_queue + 103
    frame #37: 0x0000000109c67c8b Wallpaper`__81-[BUAPIClient fetchNativeAdsJsonWithAdSlot:reqType:slotParams:completionHandler:]_block_invoke_3 + 1076
    frame #38: 0x0000000109d31e11 Wallpaper`__42-[BUNetworkRequest successCompletionBlock]_block_invoke + 144
    frame #39: 0x0000000109d32759 Wallpaper`__41-[BUGetADSRequest successCompletionBlock]_block_invoke + 144
    frame #40: 0x0000000109e0f731 Wallpaper`__47-[BUNetworkAgent requestDidSucceedWithRequest:]_block_invoke + 92
    frame #41: 0x000000010b4317ec libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame #42: 0x000000010b4329c8 libdispatch.dylib`_dispatch_client_callout + 8
    frame #43: 0x000000010b440e75 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 1152
    frame #44: 0x00007fff2038edbb CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    frame #45: 0x00007fff2038963e CoreFoundation`__CFRunLoopRun + 2685
    frame #46: 0x00007fff203886d6 CoreFoundation`CFRunLoopRunSpecific + 567
    frame #47: 0x00007fff2bededb3 GraphicsServices`GSEventRunModal + 139
    frame #48: 0x00007fff24690e0b UIKitCore`-[UIApplication _run] + 912
    frame #49: 0x00007fff24695cbc UIKitCore`UIApplicationMain + 101
    frame #50: 0x00007fff54d1e5f2 libswiftUIKit.dylib`UIKit.UIApplicationMain(Swift.Int32, Swift.Optional<Swift.UnsafeMutablePointer<Swift.UnsafeMutablePointer<Swift.Int8>>>, Swift.Optional<Swift.String>, Swift.Optional<Swift.String>) -> Swift.Int32 + 98
    frame #51: 0x0000000109a88ada Wallpaper`static UIApplicationDelegate.main() at <compiler-generated>:0
    frame #52: 0x0000000109a88a4e Wallpaper`static AppDelegate.$main(self=Wallpaper.AppDelegate) at <compiler-generated>:0
    frame #53: 0x0000000109a8b079 Wallpaper`main at <compiler-generated>:0
    frame #54: 0x00007fff202593e9 libdyld.dylib`start + 1
    frame #55: 0x00007fff202593e9 libdyld.dylib`start + 1
CoderWeiLee commented 3 years ago

而且非常奇怪的是,崩溃的时候,总是跳进汇编里,然而我没有设置总是显示汇编

WillieWangWei commented 3 years ago

使用最新版 SDK 看下是否还存在这个问题?