Unity crash

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.

2 Likes

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.

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.

1 Like

i have similar problem

Any solutions? I’ve tried multiple versions. 2020x,2021x, even 2022x.

did anyone fix it? im currently having the same issue

I’m also having this issue. Any ideas?

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.

1 Like

Solution
The issue is due to a recent mesa driver. Your options are

  • Either downgrade to a mesa driver version lower than 21.0.0 or switch driver.
  • In my case I just switched to Nvidia driver.

Issue: Unity Issue Tracker - Editor crashes at &quot;__assert_fail_base.cold&quot; when opening a project (Linux)

I sincerely hope you can find a solution soon.

1 Like

See my response above

1 Like

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 :roll_eyes:

11 Likes

You my friend, have achieved the rank of ninja. We are grateful.

1 Like

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?

Adding -force-vulkan command line argument worked for me while messing with OpenGL versions (including Yoboy123456789’s solution) did nothing.

1 Like

How do I find the unity executable file in Ubuntu 20.04? I don’t even know where to start?

I don’t no

Me too

Mine was at ~/Unity/Hub/Editor/2020.3.30f1/Editor/Unity

You get the path in the Unity Hub

7980324--1024536--Screenshot from 2022-03-21 10-01-14.png

This worked for me, adding the command line argument -force-vulkan is the only solution that fixed the project for me.

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)