Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
rhill's avatar
rhill
Honored Guest
10 years ago

PlatformUIGlobalMenu + Note4 + time = crash?

Weird bug I've had when building for GearVR. It appears on Note 4 but not S6.

If you do the long-press to go to the global menu, and then a short press to return to the game, then a few seconds later, the game crashes.

I've also built an empty project, using the same Global Menu and it doesn't have the same problem. So there's something in in my game that's crashing under these very particular circumstance.

Any guidelines for what sorts of things I should be looking for?

10 Replies

Replies have been turned off for this discussion
  • rhill's avatar
    rhill
    Honored Guest
    There's also the OVRManager.PlatformUIConfirmQuit();
    You get the Do You Want to Quit? menu and if you choose No to go back into the game, it freezes.

    And unlike the other, this happens to both the Note 4 and S6.
  • rhill's avatar
    rhill
    Honored Guest
    I can reproduce it by doing what I just said. Either:
    1) Go to the confirm quit menu and choose No to return to the game
    2) Go to global menu from long cancel, then use short cancel to return to the game, and wait

    I've recorded two logcat text files from ADB, one for each of those two.

    It is clearly dependent on something I have in my game. I've found with most of the scripts disabled, I can't reproduce this problem.
  • rhill's avatar
    rhill
    Honored Guest
    Should I attach logcats here or do you wnat me to PM them to you or something?
  • Looks like one of your scripts is causing a SIGBUS (https://en.wikipedia.org/wiki/Bus_error), which is similar to a segmentation fault:
    I/Unity (22058): MenuSwitcher:switchToMenu(Int32) (at E:\VR DEV\Unity Projects\LostCitiesInterface\Assets\Scripts\OptionsMenu\MenuSwitcher.cs:113)

    I/Unity (22058): MenuSwitcher:Update() (at E:\VR DEV\Unity Projects\LostCitiesInterface\Assets\Scripts\OptionsMenu\MenuSwitcher.cs:199)

    I/Unity (22058):

    I/Unity (22058): (Filename: E Line: 0)

    I/Unity (22058):

    F/libc (22058): Fatal signal 7 (SIGBUS), code 2, fault addr 0x9d991ff0 in tid 22075 (UnityMain)

    D/AutomaticBrightnessController( 968): mCallbacks.updateBrightness()

    D/DisplayPowerController( 968): animateScreenStateChange[0]: target=2

    D/DisplayPowerController( 968): [Dual Screen Compatible] state[0] :2

    D/DisplayPowerController( 968): getFinalBrightness : Summary is 8 -> 8

    D/DisplayPowerController( 968): Animating brightness: target=8, rate=500 (PSM:false, AB limit:(-1 ~ -1) MB Limit:(-1 ~ -1) MAdj:(0, (0, 255)))

    I/DEBUG ( 331): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

    I/DEBUG ( 331): Build fingerprint: 'samsung/trltecan/trltecan:5.1.1/LMY47X/N910W8VLU1COI4:user/release-keys'

    I/DEBUG ( 331): Revision: '12'

    I/DEBUG ( 331): ABI: 'arm'

    I/DEBUG ( 331): pid: 22058, tid: 22075, name: UnityMain >>> com.CampfireUnion.LostCities <<<

    I/DEBUG ( 331): signal 7 (SIGBUS), code 2 (BUS_ADRERR), fault addr 0x9d991ff0

    I/DEBUG ( 331): r0 9d991ff0 r1 9d992000 r2 fffffe8c r3 9d992000

    I/DEBUG ( 331): r4 9d991ff0 r5 00000001 r6 9d991ffc r7 b3e4a000

    I/DEBUG ( 331): r8 8ab1bb34 r9 b34f439c sl b34f4390 fp b34f3dcc

    I/DEBUG ( 331): ip a2313ed8 sp b34f3da0 lr a2234c9c pc a2234c0c cpsr 800b0010

    I/DEBUG ( 331):

    I/DEBUG ( 331): backtrace:

    I/DEBUG ( 331): #00 pc 002b2c0c /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so

    I/DEBUG ( 331): #01 pc 002b2c98 /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so (GC_push_all_stack+72)

    I/DEBUG ( 331): #02 pc 002bb91c /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so

    I/DEBUG ( 331): #03 pc 002bb9ec /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so

    I/DEBUG ( 331): #04 pc 002b7760 /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so

    I/DEBUG ( 331): #05 pc 002b4754 /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so

    I/DEBUG ( 331): #06 pc 002b1048 /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so

    I/DEBUG ( 331): #07 pc 002ab11c /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so

    I/DEBUG ( 331): #08 pc 002aac00 /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so

    I/DEBUG ( 331): #09 pc 002ac2ac /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so

    I/DEBUG ( 331): #10 pc 002afcb8 /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so

    I/DEBUG ( 331): #11 pc 002b01e8 /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so

    I/DEBUG ( 331): #12 pc 002b0450 /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so

    I/DEBUG ( 331): #13 pc 001f5774 /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so

    I/DEBUG ( 331): #14 pc 001f6970 /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so (mono_string_new_size+164)

    I/DEBUG ( 331): #15 pc 00231bb4 /data/app/com.CampfireUnion.LostCities-1/lib/arm/libmono.so

    I/DEBUG ( 331): #16 pc 00003b3c <unknown>
  • rhill's avatar
    rhill
    Honored Guest
    I guess the trick then is why would it cause a bus error, and what changes after using the OVR menu that would make it inclined to do so?

    Am I to take it that the MenuSwitcher.switchToMenu() function triggered it? It's not doing anything very exotic memory-wise. It accesses some arrays.


    /// <summary>
    /// Switches to menu according to index of ind
    /// </summary>
    /// <param name="ind"></param>
    public void switchToMenu(int ind)
    {
    if (ind<0)
    ind=0;
    if (ind>=menuList.Length)
    ind=menuList.Length-1;
    bool val = false;
    if (keyController != null && keyController.isGamepad())
    {
    val=true;
    }

    if ((ind==2)&&(currentMapPopup > -1)) //Map index
    {

    Menu02.switchMenu(mapPopups[currentMapPopup],val);
    }
    else
    {
    Menu02.switchMenu(menuList[ind],val);
    }
    }
  • rhill's avatar
    rhill
    Honored Guest
    Another potential avenue: we are using legacy OSP audio. When I disable the OSP it stops the bug.

    The Menu.switchMenu() function does do a little "click" when it switches. And it would make sense if audio stuff is the one thing doing something funky with memory.

    I'm in the process of switching over to OSPNative instead, seeing if this works better.
  • It does look like you have a P/Invoke issue with a plugin that's being directly used by scripts. If the issue is an OSP bug, it seems to be in the C#/native interface. OSPNative eliminates most of the logic there and is more efficient, so it ought to help.
  • rhill's avatar
    rhill
    Honored Guest
    Replacing the legacy OSP with OSP Native seems to have made the difference.