filament icon indicating copy to clipboard operation
filament copied to clipboard

Crash on iPad Air 2

Open kpeeters opened this issue 2 years ago • 6 comments

I am seeing a crash on any attempt to render something on an iPad Air 2, with stack trace

Crashed: FEngine::loop
0  libsystem_kernel.dylib         0x6bbc __pthread_kill + 8
1  libsystem_pthread.dylib        0xd854 pthread_kill + 208
2  libsystem_c.dylib              0x1f6ac abort + 124
3  alq4                           0x11be0c utils::TPanic<utils::PostconditionPanic>::panic(char const*, char const*, int, char const*, ...) + 134
4  alq4                           0x111b30 filament::backend::PipelineStateCreator::operator()(id<MTLDevice>, filament::backend::MetalPipelineState const&) + 1490
5  alq4                           0x108128 filament::backend::StateCache<filament::backend::MetalPipelineState, id<MTLRenderPipelineState> __strong, filament::backend::PipelineStateCreator, utils::hash::MurmurHashFn<filament::backend::MetalPipelineState> >::getOrCreateState(filament::backend::MetalPipelineState const&) + 392
6  alq4                           0x1005c0 filament::backend::ConcreteDispatcher<filament::backend::MetalDriver>::draw(filament::backend::Driver&, filament::backend::CommandBase*, long*) + 1140
7  alq4                           0xe51f0 std::__1::__function::__func<filament::backend::CommandStream::execute(void*)::$_0, std::__1::allocator<filament::backend::CommandStream::execute(void*)::$_0>, void ()>::operator()() + 52
8  alq4                           0x102474 filament::backend::MetalDriver::execute(std::__1::function<void ()> const&) + 44
9  alq4                           0xe4f5c filament::backend::CommandStream::execute(void*) + 96
10 alq4                           0xc8264 filament::FEngine::loop() + 324

I don't have an iPad Air 2 myself so I don't yet know any further details, but if someone does have access, it may be worth testing a few sample programs. Will dig more on this end and try to extract a minimal example.

If this device is too old for filament to support it, then please let me know, thanks.

kpeeters avatar Mar 29 '23 17:03 kpeeters

ASSERT_POSTCONDITION(error == nil, "Could not create Metal pipeline state.")

Do you have the rest of the logs? This post-condition logs the full error message just before the crash. Based on what this code does it seems like we are trying to create a pipeline that's not supported on iPad Air 2 (it's an almost 10 years old device at this point so that wouldn't surprise me). Switching to the GL backed on iPad Air 2i s probably your best solution.

romainguy avatar Mar 30 '23 16:03 romainguy

@bejado Not sure if this is actionable, see above, but just in case…

romainguy avatar Mar 30 '23 16:03 romainguy

@kpeeters sounds like this is crashing consistently? As Romain said, the full crash logs would be very helpful.

bejado avatar Mar 30 '23 20:03 bejado

@bejado Yes, it's 100% reproducible, happens always. Will try to get a log.

kpeeters avatar Mar 30 '23 20:03 kpeeters

I obtained a device and can reproduce the crash. I see the following error:

sampler argument for sample_compare must be known at compile time

@kpeeters can you confirm that your crash is caused by the same error? If so, you should be able to avoid the crash by turning off shadows for now. However, we need to discuss a better long-term fix.

bejado avatar Apr 01 '23 02:04 bejado

Is there a solution? I had the same problem

          Crashed: FEngine::loop
0  libsystem_kernel.dylib         0x6bbc __pthread_kill + 8
1  libsystem_pthread.dylib        0xd844 pthread_kill + 208
2  libsystem_c.dylib              0x1f6ac abort + 124
3  SoundCore                      0x3e59964 utils::PostconditionPanic::PostconditionPanic(char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) + 136
4  SoundCore                      0x3d528bc filament::backend::DepthStateCreator::operator()(id<MTLDevice>, filament::backend::DepthStencilState const&) + 4361676988
5  SoundCore                      0x3d3c60c filament::backend::StateCache<filament::backend::MetalPipelineState, id<MTLRenderPipelineState> __strong, filament::backend::PipelineStateCreator, utils::hash::MurmurHashFn<filament::backend::MetalPipelineState>>::getOrCreateState(filament::backend::MetalPipelineState const&) + 4361586188
6  SoundCore                      0x3d461b4 filament::backend::ConcreteDispatcher<filament::backend::MetalDriver>::draw(filament::backend::Driver&, filament::backend::CommandBase*, long*) + 4361626036
7  SoundCore                      0x3d22708 std::__1::__function::__func<filament::backend::CommandStream::execute(void*)::$_0, std::__1::allocator<filament::backend::CommandStream::execute(void*)::$_0>, void ()>::operator()() + 4361479944
8  SoundCore                      0x3d476a4 filament::backend::MetalDriver::execute(std::__1::function<void ()> const&) + 4361631396
9  SoundCore                      0x3d22470 filament::backend::CommandStream::execute(void*) + 4361479280
10 SoundCore                      0x3ded048 filament::FEngine::loop() + 166240

xiamingwei-sudo avatar Jul 03 '24 11:07 xiamingwei-sudo