Pixel 8 Pro Crash

We’re having app crashes with our project on a Pixel 8 Pro which we’re not seeing on a Pixel 6 Pro, Pixel 7, Galaxy S23, or a S23 Ultra. We’re also see app crashes with the BabylonJS RN sample project from the main branch and the react-native-0-70 branch (default and updates the packages to below except RN).

This is in a React Native project running the below relative packages:

    "@babylonjs/core": "6.43.0",
    "@babylonjs/loaders": "6.43.0",
    "@babylonjs/materials": "6.43.0",
    "@babylonjs/react-native": "1.8.2",
    "@babylonjs/react-native-iosandroid-0-71": "1.8.2",
    "@babylonjs/react-native-windows-0-71": "1.8.2",
    "react-native": "0.72.10",

In our app we’re getting the below error from metro.

Logcat:

 LOG  BJS - [10:09:56]: Babylon Native (v6.48.1) launched
 ERROR  Error: Exception in HostFunction: Failed to create frame buffer

This error is located at:
    in Renderer (created by Center)
    in RCTView (created by View)
    in View (created by Center)
    in Center (created by MainComponent)
    in RCTView (created by View)
    in View (created by MainComponent)
    in RCTView (created by View)
    in View (created by MainLayoutComponent)
    in ErrorBoundary (created by MainLayoutComponent)
    in RCTView (created by View)
    in View (created by MainLayoutComponent)
    in MainLayoutComponent (created by MainComponent)
    in MainComponent (created by SceneView)
    in StaticContainer
    in EnsureSingleNavigator (created by SceneView)
    in SceneView (created by Drawer)
    in RCTView (created by View)
    in View (created by Screen)
    in RCTView (created by View)
    in View (created by Background)
    in Background (created by Screen)
    in Screen (created by Drawer)
    in RNSScreen
    in Unknown (created by InnerScreen)
    in Suspender (created by Freeze)
    in Suspense (created by Freeze)
    in Freeze (created by DelayedFreeze)
    in DelayedFreeze (created by InnerScreen)
    in InnerScreen (created by Screen)
    in Screen (created by MaybeScreen)
    in MaybeScreen (created by Drawer)
    in RNSScreenContainer (created by ScreenContainer)
    in ScreenContainer (created by MaybeScreenContainer)
    in MaybeScreenContainer (created by Drawer)
    in RCTView (created by View)
    in View (created by Drawer)
    in RCTView (created by View)
    in View (created by AnimatedComponent(View))
    in AnimatedComponent(View)
    in Unknown (created by Drawer)
    in RCTView (created by View)
    in View (created by AnimatedComponent(View))
    in AnimatedComponent(View)
    in Unknown (created by PanGestureHandler)
    in PanGestureHandler (created by Drawer)
    in Drawer (created by DrawerViewBase)
    in DrawerViewBase (created by DrawerView)
    in RNGestureHandlerRootView (created by GestureHandlerRootView)
    in GestureHandlerRootView (created by DrawerView)
    in RCTView (created by View)
    in View (created by SafeAreaInsetsContext)
    in SafeAreaProviderCompat (created by DrawerView)
    in DrawerView (created by DrawerNavigator)
    in PreventRemoveProvider (created by NavigationContent)
    in NavigationContent
    in Unknown (created by DrawerNavigator)
    in DrawerNavigator (created by RightDrawerComponent)
    in RightDrawerComponent (created by App)
    in StaticContainer
    in EnsureSingleNavigator (created by SceneView)
    in SceneView (created by Drawer)
    in RCTView (created by View)
    in View (created by Screen)
    in RCTView (created by View)
    in View (created by Background)
    in Background (created by Screen)
    in Screen (created by Drawer)
    in RNSScreen
    in Unknown (created by InnerScreen)
    in Suspender (created by Freeze)
    in Suspense (created by Freeze)
    in Freeze (created by DelayedFreeze)
    in DelayedFreeze (created by InnerScreen)
    in InnerScreen (created by Screen)
    in Screen (created by MaybeScreen)
    in MaybeScreen (created by Drawer)
    in RNSScreenContainer (created by ScreenContainer)
    in ScreenContainer (created by MaybeScreenContainer)
    in MaybeScreenContainer (created by Drawer)
    in RCTView (created by View)
    in View (created by Drawer)
    in RCTView (created by View)
    in View (created by AnimatedComponent(View))
    in AnimatedComponent(View)
    in Unknown (created by Drawer)
    in RCTView (created by View)
    in View (created by AnimatedComponent(View))
    in AnimatedComponent(View)
    in Unknown (created by PanGestureHandler)
    in PanGestureHandler (created by Drawer)
    in Drawer (created by DrawerViewBase)
    in DrawerViewBase (created by DrawerView)
    in RNGestureHandlerRootView (created by GestureHandlerRootView)
    in GestureHandlerRootView (created by DrawerView)
    in RCTView (created by View)
    in View (created by SafeAreaInsetsContext)
    in SafeAreaProviderCompat (created by DrawerView)
    in DrawerView (created by DrawerNavigator)
    in PreventRemoveProvider (created by NavigationContent)
    in NavigationContent
    in Unknown (created by DrawerNavigator)
    in DrawerNavigator (created by LeftDrawerComponent)
    in LeftDrawerComponent (created by App)
    in RNCSafeAreaView
    in Unknown (created by App)
    in RCTView (created by View)
    in View (created by Portal.Host)
    in Portal.Host (created by GlobalModal)
    in GlobalModal (created by App)
    in ThemeProvider (created by PaperProvider)
    in RCTView (created by View)
    in View (created by Portal.Host)
    in Portal.Host (created by PaperProvider)
    in RNCSafeAreaProvider (created by SafeAreaProvider)
    in SafeAreaProvider (created by SafeAreaInsetsContext)
    in SafeAreaProviderCompat (created by PaperProvider)
    in PaperProvider (created by App)
    in EnsureSingleNavigator
    in BaseNavigationContainer
    in ThemeProvider
    in NavigationContainerInner (created by App)
    in AbacProvider (created by App)
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in emesent(RootComponent)
 ERROR  Error: Exception in HostFunction: Failed to create frame buffer

Using the BabylonJS RN Sample with the main branch, it doesn’t crash but also doesn’t render correctly:

Please let me know if you need anything else or to test anything.

Thanks!
Casey.

Tagging @BabylonNative

1 Like

We are discussing offline to see how we can test and repro this issue.

1 Like

Hi Cedric,

Just following up to see if there’s been any progress and anything we can do on our end?

Thanks!
Casey.

Cc @BabylonNative

Device is being borrowed so we can test/debug

2 Likes

I picked up a Pixel 8 Pro from our device lab and will hopefully be able to repro soon. Do we have a repro with pure Babylon Native without the React Native part?

Unfortunately we don’t have a Babylon Native repro as we only use React Native.

Okay, no problem. I will try to repro soon.

I am able to repro. Will investigate.

1 Like

Thanks @bghgary !

I’ve tracked down the crash to a bug in bgfx. See fixed wrong cast uint16t to uint32t by Fabiz · Pull Request #3187 · bkaradzic/bgfx (github.com)

But even after fixing this specific problem, the model still doesn’t look right. I’m going to try updating bgfx to the latest to see if everything is good.

2 Likes

Turns out the bad rendering is completely unrelated and is already broken in master. Nevertheless, I will look at it a bit to see what’s going on.

1 Like

This will fix the crash specific to Pixel 8 Pro: Update to latest bgfx.cmake by bghgary · Pull Request #1377 · BabylonJS/BabylonNative (github.com).

The unrelated rendering issue is fixed by: Fix regression with vertex buffer promote to float logic by bghgary · Pull Request #1376 · BabylonJS/BabylonNative (github.com)

3 Likes

Thanks so much @bghgary !