wix-incubator / DetoxSync

Synchronization framework for Detox and other testing frameworks
MIT License
34 stars 16 forks source link

MKMapView crash #4

Closed AidenMontgomery closed 3 years ago

AidenMontgomery commented 3 years ago

Description

The iOS application crashes when a MapView from react-native-maps is rendered during Detox tests.

Reproduction

Provide the steps necessary to reproduce the issue. If you are seeing a regression, try to provide the last known version where the issue did not reproduce.

Works with version 17.14.4 as stated in a previous issue https://github.com/wix/Detox/issues/2516

  1. Create an app with a MapView control
  2. Launch app with Detox
  3. Crash

I have created a project that can be used to replicate the issue. It currently has version 17.14.4 of Detox included in the package.json file. Change this to 18.0.0 and perform a clean installation of the node modules and pods, then run detox and it will crash.

https://github.com/AidenMontgomery/mapviewdetox

Expected behavior

No crash

Environment (please complete the following information):

Logs

thrown: "Signal 11 was raised
(
    0   Detox                               0x000000010c74af85 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
    1   Detox                               0x000000010c74e190 __DTXHandleCrash + 464
    2   Detox                               0x000000010c74e8d5 __DTXHandleSignal + 59
    3   libsystem_platform.dylib            0x00007fff60c815fd _sigtramp + 29
    4   libsystem_c.dylib                   0x00007fff200bfb0b __srefill1 + 24
    5   Metal                               0x00007fff36a5e2df VariantEntry* VariantList<4u>::newVariantEntry<VariantKey>(VariantKey const&) + 223
    6   Metal                               0x00007fff36a58b25 __128-[MTLCompiler newRenderPipelineStateWithDescriptorInternal:options:reflection:destinationBinaryArchive:error:completionHandler:]_block_invoke.1385 + 105
    7   DetoxSync                           0x000000010d4f5bc6 ____dispatch_wrapper_func_2param_block_invoke + 27
    8   libdispatch.dylib                   0x00007fff20106508 _dispatch_client_callout + 8
    9   libdispatch.dylib                   0x00007fff20113bb1 _dispatch_lane_barrier_sync_invoke_and_complete + 94
    10  DetoxSync                           0x000000010d4f5543 __detox_sync_dispatch_sync + 319
    11  Metal                               0x00007fff36a580b7 -[MTLCompiler newRenderPipelineStateWithDescriptorInternal:options:reflection:destinationBinaryArchive:error:completionHandler:] + 1290
    12  Metal                               0x00007fff36a577bd -[MTLCompiler newRenderPipelineStateWithDescriptor:options:reflection:error:completionHandler:] + 27
    13  Metal                               0x00007fff36a276ea -[_MTLDevice newRenderPipelineStateWithDescriptor:error:] + 65
    14  VectorKit                           0x00007fff30a73099 ggl::MetalResourceManager::newPipelineState(ggl::PipelineState const*) + 2465
    15  VectorKit                           0x00007fff30a5bdab ggl::MetalRenderer::_renderItem(ggl::RenderTarget*, ggl::RenderItem*, ggl::MetalContext*) + 119
    16  VectorKit                           0x00007fff30a59175 ggl::MetalRenderer::_processBuffer(ggl::RenderTarget*, ggl::CommandBuffer*, ggl::PassDescriptor const&, id<MTLCommandBuffer>, std::__1::shared_ptr<ggl::RenderTransaction> const&) + 5635
    17  VectorKit                           0x00007fff30a5671d ggl::MetalRenderer::_processQueue(ggl::RenderTarget*, ggl::RenderQueue*, id<MTLCommandBuffer>) + 765
    18  VectorKit                           0x00007fff30a56478 ggl::MetalRenderer::_processQueue(ggl::RenderTarget*, ggl::RenderQueue*, id<MTLCommandBuffer>) + 88
    19  VectorKit                           0x00007fff30a561ba invocation function for block in ggl::MetalRenderer::frame(ggl::RenderTarget*, ggl::RenderQueue*, std::__1::function<void ()>, std::__1::function<void ()>) + 52
    20  VectorKit                           0x00007fff30a5d040 invocation function for block in geo::TaskQueue::sync(std::__1::function<void ()>) + 51
    21  DetoxSync                           0x000000010d4f5bc6 ____dispatch_wrapper_func_2param_block_invoke + 27
    22  libdispatch.dylib                   0x00007fff20106508 _dispatch_client_callout + 8
    23  libdispatch.dylib                   0x00007fff201144fe _dispatch_async_and_wait_invoke_and_complete_recurse + 336
    24  libdispatch.dylib                   0x00007fff2010a69a _dispatch_async_and_wait_f + 210
    25  DetoxSync                           0x000000010d4f56dc __detox_sync_dispatch_async_and_wait + 319
    26  VectorKit                           0x00007fff30a5cf82 geo::TaskQueue::sync(std::__1::function<void ()>) + 170
    27  VectorKit                           0x00007fff30a560ee geo::TaskQueue::sync_b(void () block_pointer) + 150
    28  VectorKit                           0x00007fff30a55c6b ggl::MetalRenderer::frame(ggl::RenderTarget*, ggl::RenderQueue*, std::__1::function<void ()>, std::__1::function<void ()>) + 357
    29  VectorKit                           0x00007fff30a82c56 ggl::RenderFrame::execute(ggl::RenderTarget*, ggl::RenderQueue*, std::__1::function<void ()>, std::__1::function<void ()>) + 112
    30  VectorKit                           0x00007fff308c3995 -[MDDisplayLayer drawToTexture:withRenderQueue:completionHandler:] + 401
    31  VectorKit                           0x00007fff30a83e56 -[MetalLayer _onTimerFired:withPresent:] + 357
    32  VectorKit                           0x00007fff3078e45f md::MapEngine::renderScene(double, std::__1::function<void ()>) + 93
    33  VectorKit                           0x00007fff3078c255 md::MapEngine::onRenderTimerFired(double) + 325
    34  VectorKit                           0x00007fff30a77fd6 ggl::DisplayLink::onTimerFired(double) + 32
    35  VectorKit                           0x00007fff30a77b8f -[_GGLDisplayLinkTarget displayLinkFired:] + 72
    36  QuartzCore                          0x00007fff2794a369 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 755
    37  QuartzCore                          0x00007fff27a2fd78 display_timer_callback(__CFMachPort*, void*, long, void*) + 639
    38  CoreFoundation                      0x00007fff2035c9d8 __CFMachPortPerform + 157
    39  CoreFoundation                      0x00007fff2038fc82 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
    40  CoreFoundation                      0x00007fff2038f023 __CFRunLoopDoSource1 + 614
    41  CoreFoundation                      0x00007fff203894f2 __CFRunLoopRun + 2353
    42  CoreFoundation                      0x00007fff203886d6 CFRunLoopRunSpecific + 567
    43  GraphicsServices                    0x00007fff2bededb3 GSEventRunModal + 139
    44  UIKitCore                           0x00007fff24690e0b -[UIApplication _run] + 912
    45  DetoxSync                           0x000000010d4fbb6d __detox_sync_UIApplication_run + 362
    46  UIKitCore                           0x00007fff24695cbc UIApplicationMain + 101
    47  mapviewdetox                        0x0000000109b07b70 main + 112
    48  libdyld.dylib                       0x00007fff202593e9 start + 1
)"
LeoNatan commented 3 years ago

Thanks for creating a demo project, I will take a look.

LeoNatan commented 3 years ago

Reproduced, investigating.

LeoNatan commented 3 years ago

Moved issue to DetoxSync, as the issue is in this framework.

LeoNatan commented 3 years ago

Fixed. Will release a new version of Detox with the fix soon.

AidenMontgomery commented 3 years ago

Thank you for the fast response on this. I really appreciate all of the hard work you put into maintaining and developing these React-Native projects.

LeoNatan commented 3 years ago

Something broke with the changes here, so I will revert while we investigate what's up. Reopening the issue.

LeoNatan commented 3 years ago

Hopefully fixed now.