Search Unity

Linux build crashes on Ubuntu 18.04 if return is pressed

Discussion in 'Linux' started by bast_, Aug 3, 2018.

  1. bast_

    bast_

    Joined:
    Aug 3, 2018
    Posts:
    3
    Hello,

    So in my game i have a first screen where the user is prompted to press return on keyboard or start on gamepad to start the game.
    I use input.GetKeyDown to listen for the keyboard input pressed. Everything works fine on Windows and Mac builds.
    But when i run a linux build through Steam, on Ubuntu 18.04, the game crashes when i press return. There doesn't seems to be anything wrong in the log.
    This only happens if i have a controller plugged in (tried with XBOX 360, XBOX ONE and PS3 gamepads).
    If i press start on gamepad instead of using keyboard, the game starts normally. I'm using Incontrol from the asset store to handle controllers.
    Also, everything works fine on Ubuntu 16.04.

    On top of that, if a controller is plugged when the game is running, the game crashes and the following is displayed in the log :

    Change in attached Unity joysticks detected; refreshing device list.
    (Filename: /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

    Receiving unhandled NULL exception
    #0 0x007fffe2376cc0 in funlockfile
    #1 0x007fffe2377138 in explicit_bzero
    #2 0x007fffe2377140 in vp8_regular_quantize_b_sse4_1
    #3 0x007fffe23771c0 in operator delete(void*, std::nothrow_t const&)
    #4 0x007fffe2377240 in (Unknown)
    #5 0x007fffe2377250 in mono_set_defaults
    #6 0x007fffe2377530 in mono_runtime_invoke
    #7 0x007fffe2377560 in operator delete(void*, std::nothrow_t const&)
    #8 0x007fffe2377590 in operator delete(void*, std::nothrow_t const&)
    #9 0x007fffe23775b0 in operator delete(void*, std::nothrow_t const&)
    #10 0x007fffe2377710 in operator delete(void*, std::nothrow_t const&)
    #11 0x007fffe2377750 in operator delete(void*, std::nothrow_t const&)
    #12 0x007fffe2377770 in zcfree
    #13 0x007fffe2377db0 in __libc_start_main
    #14 0x007fffe2377e70 in zcfree

    Any help would be really appreciated.
    Thanks

    Unity 2017.3.1p3
    Ubuntu 18.04
    Incontrol 1.7.0
     
  2. bast_

    bast_

    Joined:
    Aug 3, 2018
    Posts:
    3
    After further testing, i realize that there is no keyboard focus at all, and that the game crashes as soon as i press return, even if my "start screen" isn't loaded yet.
    A workaround is to do a random amount of alt tabs, and eventually the game won't crash when pressing return.

    Moreover, this issue doesn't seem to occur in windowed mode.
     
  3. bast_

    bast_

    Joined:
    Aug 3, 2018
    Posts:
    3
    Ok i finally managed to solved the first issue.
    It was due to audio clips import settings : wrong settings were causing the build to hang between Unity splash screen and first screen of the game.
    A pop up windows "app not responding" was open and had keyboard focus, but i couldn't see it in fullscreen mode. So as soon as i pressed return, it was activating the "force quit" option of the pop up, closing the game.

    It works fine now and loading time is significantly reduced with settings recommended here : http://blog.theknightsofunity.com/wrong-import-settings-killing-unity-game-part-2/

    The game still crashes when plugging a controller though.