Freecad crashes at start

Bug #1754084 reported by mschaeffler on 2018-03-07
74
This bug affects 14 people
Affects Status Importance Assigned to Milestone
freecad (Debian)
New
Unknown
freecad (Ubuntu)
Medium
Unassigned

Bug Description

[Impact]

 * FreeCAD crashes at startup in Ubuntu 18.04.

 * Backporting the proposed fix will prevent FreeCAD from crashing.

 * The proposed upload will fix the issue by providing an environment variable in the freecad.desktop file. This environment variable will set LIBGL_DRI3_DISABLE=true.

[Test Case]

 * On Ubuntu 18.04 with a system where a video card or some form of graphics acceleration is used, install freecad and run normally.

 This is printed at the console:

FreeCAD 0.16, Libs: 0.16R
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2015
  ##### #### ### ####
  # # # # # #
  # ## #### #### # # # # #
  #### # # # # # # # ##### # #
  # # #### #### # # # # #
  # # # # # # # # # ## ## ##
  # # #### #### ### # # #### ## ## ##

failed to create drawable
[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.
freecad: ../../src/xcb_io.c:259: poll_for_event: Zusicherung »!xcb_xlib_threads_sequence_lost« nicht erfüllt.
Abgebrochen

[Regression Potential]

 * An environment variable disabling LIBGL_DIR3 is set in the freecad.desktop file. The affected functionality is limited to the FreeCAD process and any child processes.

tags: added: bionic
Kurt Kremitzki (kkremitzki) wrote :

I can't reproduce this in a VM running the latest bionic daily build. Can you give more information on your setup?

mschaeffler (mschaeffler) wrote :

This happens with "Gnome with X11" and not with "Gnome with Wayland"

My system is a Ryzen 1600.

Don Bowman (donbowman) wrote :

See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890882

I just recompiled from upstream git repo, and same problem.
(w/ X11)

I did:
$ lxc launch images:ubuntu/bionic/amd64 b
to get a fresh system, and followed the build instructions from https://www.freecadweb.org/wiki/CompileOnUnix

I used instructions from https://blog.simos.info/how-to-run-graphics-accelerated-gui-apps-in-lxd-containers-on-your-ubuntu-desktop/ to get an lxc image that has accelerated X11 access, glxinfo and xclock run ok.

I tried adding XInitThreads() into main() before Gui::Application::runApplication(), but no change.

The bt is:

(gdb) bt
#0 0x00007ffff4379e97 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff437b801 in __GI_abort () at abort.c:79
#2 0x00007ffff436b39a in __assert_fail_base (fmt=0x7ffff44f27d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7ffff4d7f660 "!xcb_xlib_threads_sequence_lost", file=file@entry=0x7ffff4d7f4cb "../../src/xcb_io.c", line=line@entry=259, function=function@entry=0x7ffff4d7f908 "poll_for_event") at assert.c:92
#3 0x00007ffff436b412 in __GI___assert_fail (assertion=0x7ffff4d7f660 "!xcb_xlib_threads_sequence_lost", file=0x7ffff4d7f4cb "../../src/xcb_io.c", line=259, function=0x7ffff4d7f908 "poll_for_event")
    at assert.c:101
#4 0x00007ffff4d0d1da in () at /usr/lib/x86_64-linux-gnu/libX11.so.6
#5 0x00007ffff4d0d28b in () at /usr/lib/x86_64-linux-gnu/libX11.so.6
#6 0x00007ffff4d0d57d in _XEventsQueued () at /usr/lib/x86_64-linux-gnu/libX11.so.6
#7 0x00007ffff4d103c5 in _XGetRequest () at /usr/lib/x86_64-linux-gnu/libX11.so.6
#8 0x00007fffdefc4ee2 in () at /usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0
#9 0x00007ffff2a06ff4 in () at /usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4
#10 0x00007ffff298a8ad in QGLFormat::openGLVersionFlags() () at /usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4
#11 0x00007ffff72e2a38 in Gui::Application::runApplication() () at /usr/local/lib/libFreeCADGui.so
#12 0x000055555555742b in main ()

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in freecad (Ubuntu):
status: New → Confirmed
Mohammed Shaikh (mumararshaikh) wrote :

Same think happened on Lubuntu 18.04.

FreeCAD 0.16, Libs: 0.16R
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2015
  ##### #### ### ####
  # # # # # #
  # ## #### #### # # # # #
  #### # # # # # # # ##### # #
  # # #### #### # # # # #
  # # # # # # # # # ## ## ##
  # # #### #### ### # # #### ## ## ##

failed to create drawable
[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.
freecad: ../../src/xcb_io.c:259: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted (core dumped)

Same deal here, 18.04 on a Ryzen 7 2700U (laptop variant) Could be AMD/ryzen specific?

FreeCAD 0.16, Libs: 0.16R
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2015
  ##### #### ### ####
  # # # # # #
  # ## #### #### # # # # #
  #### # # # # # # # ##### # #
  # # #### #### # # # # #
  # # # # # # # # # ## ## ##
  # # #### #### ### # # #### ## ## ##

failed to create drawable
[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.
freecad: ../../src/xcb_io.c:259: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted (core dumped)

cervinomix (cervinomix) wrote :

I have the same problem. In the end I went down to kubuntu 16.04 I only have the problem in Ubuntu 18.04.
 In Ubuntu 16.04 and 17.10 I had no problem.

Jens (jens68000) wrote :

I have the same problem with the stock version of Freecad. I have just upgraded and Freecad stopped working.
The output is the same as described above... but I have installed Freecad 0.17 beta from the Ubuntu Software package and it seems to work when I launch it from a terminal with the freecad.FreeCAD command.

If Freecad was installed previously, delete or move the old config directory:

/home/USERxxx/snap/freecad/4/.config

hi Jens, hi all,
thanks a lot for answering. In my case I had a fresh install of Xubuntu
18.04, so there was no old .config there.

First I installes Xubuntu and after next step I downloaded freecad-0.17
and installed it via dpkg -i.

But I got these known error as described.

Now I have found another "script" like this here :
LIBGL_DRI3_DISABLE=true ./FreeCAD-13522.glibc2.17-x86_64.AppImage

and it does the trick. Now it runs.
So far, I cannot find any problems due to the disabled LIBGL_DR3.
Maybe in further using freecad some behavior may appear.

Bye hans
************************************

Am Sonntag, den 20.05.2018, 18:51 +0000 schrieb Jens:
> I have the same problem with the stock version of Freecad. I have
> just upgraded and Freecad stopped working.
> The output is the same as described above... but I have installed
> Freecad 0.17 beta from the Ubuntu Software package and it seems to
> work when I launch it from a terminal with the freecad.FreeCAD
> command.
>
> If Freecad was installed previously, delete or move the old config
> directory:
>
> /home/USERxxx/snap/freecad/4/.config
>

AM (pinecone7) wrote :

So, I think I've figured it out.

Found somewhere else on the net that disabling DRI3 on start seems to solve it.

Doing:

LIBGL_DRI3_DISABLE=true freecad

gets FreeCAD to start, with no error or fault.

Maybe the desktop entry needs updating? Or some other routines.

My hardware is RX480 on AMDGPU DC, running under a daily Mesa driver as well as a preliminary 4.17.

Hans Joachim Desserud (hjd) wrote :

Don: thanks for finding the corresponding Debian bug report (comment #3). I've added a bug watch, so that this bug will be automatically notified once the status changes in Debian.

Changed in freecad (Debian):
status: Unknown → New

I have the same error.

Running 'LIBGL_DRI3_DISABLE=true freecad' seems to work.

I have an AMD A8-7600.

Emilio (emilio-moretti) wrote :

Same here. 'LIBGL_DRI3_DISABLE=true freecad' worked OK

Shawn Wilson (shawn-4) wrote :

Works for me too

Paulino (paulino) wrote :

Same problem using kubuntu-desktop on 18.04

Console output:

FreeCAD 0.16, Libs: 0.16R
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2015
  ##### #### ### ####
  # # # # # #
  # ## #### #### # # # # #
  #### # # # # # # # ##### # #
  # # #### #### # # # # #
  # # # # # # # # # ## ## ##
  # # #### #### ### # # #### ## ## ##

failed to create drawable
[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.
freecad: ../../src/xcb_io.c:259: poll_for_event: La declaración `!xcb_xlib_threads_sequence_lost' no se cumple.
Abortado (`core' generado)

Demetri mallous (d-mallous) wrote :

Same problem on Kubuntu 18.10

Same problem on Ubuntu 18.10 with both the repo 0.16.6712+dfsg1-3build1 version and the current Appimage 0.17 version.

OS: Ubuntu 18.10 x86_64
Kernel: 4.20.0-042000-generic
Packages: 2151 (dpkg), 26 (flatpak), 32 (snap)
Shell: bash 4.4.19
Resolution: 1680x1050, 1920x1200
DE: GNOME 3.30.1
WM: GNOME Shell
WM Theme: Adwaita
Theme: Adwaita-dark [GTK2/3]
Icons: Yaru [GTK2/3]
Terminal: gnome-terminal
CPU: AMD Ryzen Threadripper 1900X 8- (16) @ 3.800GHz
GPU: AMD ATI Radeon RX Vega 64
Memory: 4184MiB / 15958MiB

$ freecad
FreeCAD 0.16, Libs: 0.16R
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2015
  ##### #### ### ####
  # # # # # #
  # ## #### #### # # # # #
  #### # # # # # # # ##### # #
  # # #### #### # # # # #
  # # # # # # # # # ## ## ##
  # # #### #### ### # # #### ## ## ##

failed to create drawable
[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.
freecad: ../../src/xcb_io.c:263: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted (core dumped)

$ ./FreeCAD-0.17.13541.9948ee4.glibc2.17-x86_64.AppImage
FreeCAD 0.17, Libs: 0.17R13541 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2018
  ##### #### ### ####
  # # # # # #
  # ## #### #### # # # # #
  #### # # # # # # # ##### # #
  # # #### #### # # # # #
  # # # # # # # # # ## ## ##
  # # #### #### ### # # #### ## ## ##

failed to create drawable
[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.
freecad: ../../src/xcb_io.c:263: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted (core dumped)

tags: added: cosmic
Winston Ford (winstonford) wrote :

I am using the freecad 0.18-pre appimage on elementary juno (ubuntu 18.04) and this worked for me:

edit the .desktop file:

.local/share/applications/appimagekit_2886566de966dc3a1acbab1d9f01752f-freecad-daily.desktop

and change the Exec line to be

Exec=sh -c "LIBGL_DRI3_DISABLE=true /home/username/Applications/FreeCAD_0.18.15780.glibc2.17-x86_64.AppImage"

Zachary Gummow (maleous) wrote :

I have prepared a change to the Debian package that will eliminate this issue.

description: updated
Changed in freecad (Ubuntu):
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.