Search Unity

Unity crash

Discussion in 'Linux' started by unity_AEBBB8D201B5D01C2CA0, Feb 16, 2022.

  1. unity_AEBBB8D201B5D01C2CA0

    unity_AEBBB8D201B5D01C2CA0

    Joined:
    Feb 16, 2022
    Posts:
    1
    I'm on Ubuntu 20.04 LTS.

    Unity crashes when I run it, and displays me this :



    Editor.log :

    [xcb] Unknown sequence number while processing queue
    [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
    [xcb] Aborting, sorry about that.
    Unity: ../../src/xcb_io.c :260 : poll_for_event: assertion « !xcb_xlib_threads_sequence_lost » failed.
    Caught fatal signal - signo:6 code:-6 errno:0 addr:0x3e800003e4b
    Obtained 22 stack frames.
    #0 0x007fca1f1f53c0 in funlockfile
    #1 0x007fca1f03418b in gsignal
    #2 0x007fca1f013859 in abort
    #3 0x007fca1f013729 in (Unknown)
    #4 0x007fca1f024f36 in __assert_fail
    #5 0x007fca2057e643 in _XFreeX11XCBStructure
    #6 0x007fca2057e6ed in _XFreeX11XCBStructure
    #7 0x007fca2057e9ea in _XEventsQueued
    #8 0x007fca205819dd in _XGetRequest
    #9 0x007fca2056cdd8 in XNoOp
    #10 0x007fca106b5fc4 in glIsTextureEXT
    #11 0x007fca1ed234fc in glXGetVisualFromFBConfig
    #12 0x0055691554a5a3 in CreateNativeGLContext(void*)
    #13 0x00556913bf5f88 in MakeNewContextGL(GfxDeviceLevelGL, unsigned long, int, int, int, bool, bool, bool, DepthBufferFormat)
    #14 0x00556913bf6159 in SetupGraphicsContextFromWindow(unsigned long, int, int, bool&)
    #15 0x00556913382151 in WindowGLES::Reshape(int, int, DepthBufferFormat, bool)
    #16 0x0055691338201b in WindowGLES::WindowGLES(unsigned long, int, int, DepthBufferFormat, bool)
    #17 0x0055691336001e in GfxDeviceGLES::CreateGfxWindow(unsigned long, int, int, DepthBufferFormat, bool)
    #18 0x005569148c5e55 in GUIView::CreateGfxWindow()
    #19 0x005569148c939b in GUIView::SetWindow(ContainerWindow*)
    #20 0x00556914d04c80 in GUIView_CUSTOM_Internal_SetWindow(ScriptingBackendNativeObjectPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*)
    #21 0x00000041fe665e in (wrapper managed-to-native) UnityEditor.GUIView:Internal_SetWindow (UnityEditor.GUIView,UnityEngine.ScriptableObject)
    Launching bug reporter
    QObject: Cannot create children for a parent that is in a different thread.
    (Parent is QObject(0x20a5470), parent's thread is QThread(0x1ed33b0), current thread is Thread(0x217d2e0)


    I tried many things but none worked.
    Thanks in advance for any help ! Don't hesitate to ask me for further details.
     
    Last edited: Feb 17, 2022
    Degri and LeGoMe like this.
  2. dastance

    dastance

    Joined:
    Jan 14, 2018
    Posts:
    1
    I got exactly the same bug.
    I tried to upgrade and downgrade Unity releases, with or without Unity-Hub (killing btw pending unityhub processes).
    With no effect at all.
     
  3. Kaksmularen

    Kaksmularen

    Joined:
    Feb 11, 2022
    Posts:
    1
    I got something similar on Arch Linux. My editor version is 2020.3.29f1. It crashes when it has finished loading, just before launching. Here is the error report in Editor.log:


    [xcb] Unknown sequence number while processing queue
    [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
    [xcb] Aborting, sorry about that.
    Unity: xcb_io.c:269: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
    Caught fatal signal - signo:6 code:-6 errno:0 addr:0x3e8000018ab
    Obtained 23 stack frames.
    #0 0x007f94e4950560 in __sigaction
    #1 0x007f94e499d34c in __pthread_kill_implementation
    #2 0x007f94e49504b8 in raise
    #3 0x007f94e493a534 in abort
    #4 0x007f94e493a45c in __assert_fail_base.cold
    #5 0x007f94e4949116 in __assert_fail
    #6 0x007f94eb0fee2d in _XFreeX11XCBStructure
    #7 0x007f94eb0feec8 in _XFreeX11XCBStructure
    #8 0x007f94eb0ff282 in _XEventsQueued
    #9 0x007f94eb102246 in _XGetRequest
    #10 0x007f94eb0ed3e5 in XNoOp
    #11 0x007f93ec779429 in MesaGLInteropGLXExportObject
    #12 0x007f94ec187494 in glXCreateContext
    #13 0x0055b21f43c763 in CreateNativeGLContext(void*)
    #14 0x0055b21dae4f28 in MakeNewContextGL(GfxDeviceLevelGL, unsigned long, int, int, int, bool, bool, bool, DepthBufferFormat)
    #15 0x0055b21dae50f9 in SetupGraphicsContextFromWindow(unsigned long, int, int, bool&)
    #16 0x0055b21d2711e1 in WindowGLES::Reshape(int, int, DepthBufferFormat, bool)
    #17 0x0055b21d2710ab in WindowGLES::WindowGLES(unsigned long, int, int, DepthBufferFormat, bool)
    #18 0x0055b21d24f0fe in GfxDeviceGLES::CreateGfxWindow(unsigned long, int, int, DepthBufferFormat, bool)
    #19 0x0055b21e7b7905 in GUIView::CreateGfxWindow()
    #20 0x0055b21e7bae4b in GUIView::SetWindow(ContainerWindow*)
    #21 0x0055b21ebf6730 in GUIView_CUSTOM_Internal_SetWindow(ScriptingBackendNativeObjectPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*)
    #22 0x000000412dcf0e in (wrapper managed-to-native) UnityEditor.GUIView:Internal_SetWindow (UnityEditor.GUIView,UnityEngine.ScriptableObject)


    EDIT: I just learned about
    taskset
    which, if I understand it correctly, limits the number of threads available to a process. I've only tried it two times so far, but it seems to fix the bug for me. First, I launch Unity Hub. Second, I use
    htop
    to find the PID of the process which name is unityhub-bin on my system. Third, I execute
    taskset -c -pa 0 <PID>
    to limit the process to one thread. Fourth, I launch the editor from Unity Hub, and it works.

    EDIT 2: On my third attempt, taskset doesn't fix the bug anymore.
     
    Last edited: Feb 21, 2022
    LVE likes this.
  4. treebtc

    treebtc

    Joined:
    Jan 7, 2022
    Posts:
    1
    i have similar problem
     
  5. Steedalion

    Steedalion

    Joined:
    Jul 6, 2020
    Posts:
    51
    Any solutions? I've tried multiple versions. 2020x,2021x, even 2022x.
     
  6. Yoboy123456789

    Yoboy123456789

    Joined:
    Jan 30, 2020
    Posts:
    3
    did anyone fix it? im currently having the same issue
     
  7. unity_122F49D0CB4D10A9DDD6

    unity_122F49D0CB4D10A9DDD6

    Joined:
    Oct 20, 2021
    Posts:
    1
    I'm also having this issue. Any ideas?
     
  8. Washipp

    Washipp

    Joined:
    Oct 13, 2021
    Posts:
    1
    What I noticed here is that the problem was created when I updated Linux.

    I have just called 'Software Updates' on Ubuntu 20.04.4LTS which had two new Linux Base updates.
    After installing and restarting my machine I was able to start the editor again as normal.

    EDIT: It doesn't work every time it seems. I'll update the post if I find out something else.
     
    Last edited: Mar 1, 2022
  9. Steedalion

    Steedalion

    Joined:
    Jul 6, 2020
    Posts:
    51
    Washipp likes this.
  10. Steedalion

    Steedalion

    Joined:
    Jul 6, 2020
    Posts:
    51
    See my response above

     
    Washipp likes this.
  11. Yoboy123456789

    Yoboy123456789

    Joined:
    Jan 30, 2020
    Posts:
    3





    I FOUND A FIX:

    go to your Unity directory (where the unity executable is located) in the terminal

    then copy and paste this line:

    MESA_GL_VERSION_OVERRIDE=4.5 MESA_GLSL_VERSION_OVERRIDE=450 ./Unity



    the game development gods have responded to us :rolleyes:
     
    grbulat, obelitz, AndyZooM and 8 others like this.
  12. Steedalion

    Steedalion

    Joined:
    Jul 6, 2020
    Posts:
    51

    You my friend, have achieved the rank of ninja. We are grateful.
     
    AndyZooM likes this.
  13. akash13leena

    akash13leena

    Joined:
    Aug 10, 2021
    Posts:
    2
    Thanks @
    Yoboy123456789. This solved my issue as well. I was using Unity3d in Ubuntu 20.04 in a Macmini. I am curious why was Unity crashing all of a sudden when it was working fine all this while?
     
  14. subchannel13

    subchannel13

    Joined:
    Mar 22, 2015
    Posts:
    5
    Adding -force-vulkan command line argument worked for me while messing with OpenGL versions (including Yoboy123456789's solution) did nothing.
     
    elfqwerty likes this.
  15. UserMacUserface

    UserMacUserface

    Joined:
    Mar 20, 2022
    Posts:
    1
    How do I find the unity executable file in Ubuntu 20.04? I don't even know where to start?
     
  16. wblessen

    wblessen

    Joined:
    Apr 9, 2021
    Posts:
    1
    I don't no
    Me too
     
  17. subchannel13

    subchannel13

    Joined:
    Mar 22, 2015
    Posts:
    5
    Mine was at ~/Unity/Hub/Editor/2020.3.30f1/Editor/Unity
     
  18. Arnav-crypto

    Arnav-crypto

    Joined:
    Jan 21, 2021
    Posts:
    1
    You get the path in the Unity Hub
     

    Attached Files:

  19. elfqwerty

    elfqwerty

    Joined:
    Feb 25, 2022
    Posts:
    2
    This worked for me, adding the command line argument -force-vulkan is the only solution that fixed the project for me.
     
  20. BlueDev5

    BlueDev5

    Joined:
    Dec 24, 2019
    Posts:
    23
    That doesn't work, because the editor redirects to the unity hub from where the fix means nothing.
    The flags also didn't work
    So now I hove 2 options:
    1. Downgrade Mesa (I literally cannot find any way on the internet to downgrade it on linux mint)
    2. Someone tell me how to do the fix suggested by yoboy (this seems a better option to me)
     
  21. Steedalion

    Steedalion

    Joined:
    Jul 6, 2020
    Posts:
    51
    I use this command every day. I use it first and it opens my unity hub directly. Restart PC and try this command first.


    I think the newer versions of unity hub may work differently but I am not sure. I am still using the app image unity hub and have not upgraded.

    I hope this helps. Hopefully 22.04 will bring a mesa fix for this issue. It is super annoying.
     
  22. BlueDev5

    BlueDev5

    Joined:
    Dec 24, 2019
    Posts:
    23
    Oh yeah!! Thanks, It worked I just had to make sure the hub is not running, and unity will just prompt me to either open a project or to open the unity hub. Now I can use 2020, 2019 and 2021 lts
     
  23. BlueDev5

    BlueDev5

    Joined:
    Dec 24, 2019
    Posts:
    23
    Also, I created 3 simple scripts to run the 3 versions I have, which looked like this:

    Code (CSharp):
    1. #!/bin/sh
    2.  
    3. pkill unityhub-bin
    4. cd /home/$USER/Unity/Hub/Editor
    5. MESA_GL_VERSION_OVERRIDE=4.5 MESA_GLSL_VERSION_OVERRIDE=450 ./$(ls | grep 2021.2)/Editor/Unity
    Where 2021.2 can be replaced by any version like 2021.3, 2020.3, etc. I did that grep thing because I wanted to make sure that if I install another patch of 2021.2 then I would still be able to run this same script and expect it to open up the new patch (given that I only keep 1 patch release of any editor)
     
    Last edited: Apr 21, 2022
    forestrf likes this.
  24. BlueDev5

    BlueDev5

    Joined:
    Dec 24, 2019
    Posts:
    23
    Hey I just realized that I cannot use unity services without running unity through the hub, any way to avoid that
     
  25. BlueDev5

    BlueDev5

    Joined:
    Dec 24, 2019
    Posts:
    23
    Ok so I found a workaround, basically, I opened unity through the hub( which crashed), but I looked at htop in the tree view and realized that all unity instances run under the main hub process. So I set the Mesa GL version override and Mesa GLSL version override vars in my zshrc file. and opened up unity hub through a terminal so that the variables persist even after starting unity
     
    grbulat likes this.
  26. GuruTheCoder

    GuruTheCoder

    Joined:
    Jul 1, 2022
    Posts:
    2
    @BlueDev5 Could you please tell me how you did that?
     
  27. ActuallyAscyt

    ActuallyAscyt

    Joined:
    Sep 11, 2021
    Posts:
    9
    I have an NVIDIA driver and still have that problem.
     
  28. Heptagram064

    Heptagram064

    Joined:
    Feb 22, 2022
    Posts:
    99
    Can someone from unity pls fix this? Im still having this issue 18-09-2022...
    Edit:
    I now tried every solution in this post, unity keeps crashing on this issue every 5 minutes...
    Now im sad, because i cant use linux for unity development...
     
  29. radzradz

    radzradz

    Joined:
    Jan 5, 2021
    Posts:
    6
    Crashing here for every 2 or 3 actions i try to do... :/
    -force-vulkan didn't help.
    ----
    System:
    Linux Mint 21 Cinnamon 5.4.12
    Linux Kernel 5.15.0-50-generic
     
    Pnvanol likes this.
  30. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    231
    This works wonders.
     
  31. kadirbrky

    kadirbrky

    Joined:
    Nov 3, 2022
    Posts:
    1
    Is there any possibility that someone explain the path what to do with Unity Editor file and how? :)
     
  32. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    231
    If you go to the path "/home/$USER/Unity/Hub/Editor" (without double quotes and where $USER is your username. Just pasting this path on the file explorer should work) will show you a list of folders, each one is an Unity version. Inside it, Unity's executable is simply called "Unity".

    The awesome script from BlueDev5, if pasted to an empty file and set its properties to allow executing (or executable, or something that resembles that meaning) will allow you to doubleclick that file and launch Unity with the correct mesa drivers that don't crash. It will ask you which project you want to open, so it's not as convenient as hub, but until everything is fixed, this workaround just works.