Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 606892 - media-gfx/freecad-0.16: libGL error
Summary: media-gfx/freecad-0.16: libGL error
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Michael Weber (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-23 10:16 UTC by brothermechanic
Modified: 2018-08-07 08:56 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (info.txt,6.00 KB, text/plain)
2017-01-23 12:33 UTC, brothermechanic
Details
ebuild for tests (freecad-0.16-r1.ebuild,4.08 KB, text/plain)
2017-01-24 20:36 UTC, bdouxx
Details

Note You need to log in before you can comment on or make changes to this bug.
Description brothermechanic 2017-01-23 10:16:19 UTC
$ FreeCAD
FreeCAD 0.16, Libs: 0.16RUnknown
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2015
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
*** Abort *** an exception was raised, but no catch was found.
        ... The exception is:SIGSEGV 'segmentation violation' detected. Address 0

FreeCAD crush on start when i select worckbench.

emerge --info
https://paste.pound-python.org/show/uK0XelOY7qyspvWbiJrU/
Comment 1 brothermechanic 2017-01-23 11:30:37 UTC
it's starts normally 
when i run it that way 

LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib64/opengl/nvidia/lib" FreeCAD

please fix it
Comment 2 Jonas Stein gentoo-dev 2017-01-23 12:29:00 UTC
please attach the emerge --info as text, because the online paste is not permanent. 

have you tried
revdep-rebuild -v

https://wiki.gentoo.org/wiki/Gentoo_Cheat_Sheet#Package_troubleshooting
Comment 3 brothermechanic 2017-01-23 12:33:02 UTC
Created attachment 461054 [details]
emerge --info

emerge --info
Comment 4 brothermechanic 2017-01-23 12:33:38 UTC
revdep-rebuild -v don't helped for it
Comment 5 bdouxx 2017-01-23 19:49:36 UTC
hi

Not a expert, but can you run a "eselect opengl list" and verify your file : /etc/env.d/000opengl ?


I have made a lot of modification in ebuild file for version 16
, but I watch nothing about this problem in version 15.
Comment 6 brothermechanic 2017-01-23 19:53:06 UTC
$ eselect opengl list
Available OpenGL implementations:
  [1]   nvidia *
  [2]   xorg-x11

ls -la /etc/env.d/000opengl 
-rw-r--r-- 1 root root 170 янв 23 17:38 /etc/env.d/000opengl
Comment 7 bdouxx 2017-01-24 10:10:16 UTC
can you verify your file?

in the wiki
https://wiki.gentoo.org/wiki/User:MGorny/New_eselect-opengl_design

there is something like this in this file:
LDPATH="/usr/lib32/opengl/nvidia/lib:/usr/lib64/opengl/nvidia/lib"
Comment 8 brothermechanic 2017-01-24 10:35:08 UTC
My system is ok!

https://hastebin.com/cipezolati.pl

https://hastebin.com/citalefaja.pl

ps: i have hormally running 3d applications like blender and unrealengine
Comment 9 bdouxx 2017-01-24 20:36:06 UTC
Created attachment 461270 [details]
ebuild for tests

Hi 

Can you try this new ebuild?
I make some modifications ( based on /usr/portage/games-sports/foobillard/foobillard-3.0a.ebuild)


adding
IUSE="collada video_cards_nvidia"

and
use video_cards_nvidia && append-ldflags -L/usr/$(get_libdir)/opengl/nvidia/lib
Comment 10 brothermechanic 2017-01-25 05:04:14 UTC
Hello
Thank you for ebuild!

I add some modifications, 

https://github.com/brothermechanic/cg/tree/master/media-gfx/freecad

like

if you add collada use flag - you must erase collada export when user build it without collada flag
now i simply remove collada flag (turn collada support by default)

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

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
*** Abort *** an exception was raised, but no catch was found.
        ... The exception is:SIGSEGV 'segmentation violation' detected. Address 0
Comment 11 bdouxx 2017-01-25 19:19:18 UTC
hi,


can you try this?

http://mindcache.io/2016/04/13/gentoo-linux-libgl-error.html
Comment 12 brothermechanic 2017-01-26 07:53:15 UTC
my system is ok

$ glxinfo | grep direct
direct rendering: Yes
    GL_AMD_multi_draw_indirect, GL_AMD_seamless_cubemap_per_texture, 
    GL_ARB_direct_state_access, GL_ARB_draw_buffers, 
    GL_ARB_draw_indirect, GL_ARB_draw_instanced, GL_ARB_enhanced_layouts, 
    GL_ARB_half_float_vertex, GL_ARB_imaging, GL_ARB_indirect_parameters, 
    GL_ARB_multi_draw_indirect, GL_ARB_multisample, GL_ARB_multitexture, 
    GL_EXT_depth_bounds_test, GL_EXT_direct_state_access, 
    GL_NV_bindless_multi_draw_indirect, 
    GL_NV_bindless_multi_draw_indirect_count, GL_NV_bindless_texture, 
    GL_AMD_multi_draw_indirect, GL_AMD_seamless_cubemap_per_texture, 
    GL_ARB_direct_state_access, GL_ARB_draw_buffers, 
    GL_ARB_draw_indirect, GL_ARB_draw_instanced, GL_ARB_enhanced_layouts, 
    GL_ARB_half_float_vertex, GL_ARB_imaging, GL_ARB_indirect_parameters, 
    GL_ARB_multi_draw_indirect, GL_ARB_multisample, GL_ARB_multitexture, 
    GL_EXT_depth_bounds_test, GL_EXT_direct_state_access, 
    GL_NV_bindless_multi_draw_indirect, 
    GL_NV_bindless_multi_draw_indirect_count, GL_NV_bindless_texture, 
    GL_EXT_map_buffer_range, GL_EXT_multi_draw_indirect,
Comment 13 bdouxx 2017-01-26 20:34:08 UTC
Hi

sorry, but I have no more idea...

can you install media-gfx/freecad-0.15.4671
and give the result of
which FreeCAD ( and a cat of this file)
which FreeCADCmd ( and a cat of this file)


I removed make_wrapper in the ebuild, it was perhaps a mistake.



looking on this topic, there are same problem with steam

https://forums.gentoo.org/viewtopic-t-1039076.html

https://bugs.gentoo.org/show_bug.cgi?id=531990#c26
http://data.gpo.zugaina.org/gamerlay/games-util/steam-launcher/files/

https://github.com/ValveSoftware/steam-for-linux/issues/3624
Comment 14 hangglider 2017-05-02 20:56:51 UTC
Same symptoms, just recompiling (incl. all Qt stuff), as the SEGV happened in QtOpenGL, QGLWindowSurface::paintDevice(), as there seems some initialization to be missed.

If problem is still there afterwards, I'll send more details.
Comment 15 hangglider 2017-05-03 15:57:20 UTC
What I found out so far:
(gdb) thread apply all bt
Thread 1 (Thread 0x7f06a82a97c0 (LWP 25764)):
#0  0x00007f06a4124329 in QGLWindowSurface::paintDevice() () from /usr/lib64/qt4/libQtOpenGL.so.4
#1  0x00007f06a60103fa in ?? () from /usr/lib64/qt4/libQtGui.so.4
#2  0x00007f06a5e33ec0 in QWidgetPrivate::syncBackingStore() () from /usr/lib64/qt4/libQtGui.so.4
#3  0x00007f06a5e46c18 in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#4  0x00007f06a6263612 in QSplashScreen::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#5  0x00007f06a5df04bc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#6  0x00007f06a5df7306 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#7  0x00007f06a7785a15 in Gui::GUIApplication::notify(QObject*, QEvent*) () from /usr/lib64/libFreeCADGui.so
#8  0x00007f06a58c47ad in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#9  0x00007f06a6011d64 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#10 0x00007f06a5e36725 in QWidget::repaint(QRect const&) () from /usr/lib64/qt4/libQtGui.so.4
...
(gdb) disass
Dump of assembler code for function _ZN16QGLWindowSurface11paintDeviceEv:
   0x00007f06a41242ec <+0>:     push   %rbx
   0x00007f06a41242ed <+1>:     mov    %rdi,%rbx
   0x00007f06a41242f0 <+4>:     callq  0x7f06a4123408 <_ZN16QGLWindowSurface14updateGeometryEv>
   0x00007f06a41242f5 <+9>:     mov    0x20(%rbx),%rcx
   0x00007f06a41242f9 <+13>:    mov    0x8(%rcx),%rdx
   0x00007f06a41242fd <+17>:    mov    %rdx,%rax
   0x00007f06a4124300 <+20>:    test   %rdx,%rdx
   0x00007f06a4124303 <+23>:    jne    0x7f06a4124336 <_ZN16QGLWindowSurface11paintDeviceEv+74>
   0x00007f06a4124305 <+25>:    cmpq   $0x0,0x20(%rcx)
   0x00007f06a412430a <+30>:    je     0x7f06a4124312 <_ZN16QGLWindowSurface11paintDeviceEv+38>
   0x00007f06a412430c <+32>:    lea    0x50(%rcx),%rax
   0x00007f06a4124310 <+36>:    jmp    0x7f06a4124336 <_ZN16QGLWindowSurface11paintDeviceEv+74>
   0x00007f06a4124312 <+38>:    lea    0x10(%rbx),%rdi
   0x00007f06a4124316 <+42>:    callq  0x7f06a40d7040 <_ZNK14QWindowSurface6windowEv@plt>
   0x00007f06a412431b <+47>:    mov    0x8(%rax),%rax
   0x00007f06a412431f <+51>:    mov    0x88(%rax),%rax
   0x00007f06a4124326 <+58>:    mov    (%rax),%rdi
=> 0x00007f06a4124329 <+61>:    mov    (%rdi),%rax
   0x00007f06a412432c <+64>:    callq  *0x18(%rax)
(gdb) info r
rax            0x2073700        34027264
rbx            0x2073120        34025760
rcx            0x2072c20        34024480
rdx            0x0      0
rsi            0x7fff6fb713e0   140735067657184
rdi            0x0      0
rbp            0x7fff6fb715d0   0x7fff6fb715d0
rsp            0x7fff6fb71340   0x7fff6fb71340
...

so for me it looks like the corresponding line in C++:

src/opengl/qwindowsurface_gl.cpp:501

QGLContext *ctx = reinterpret_cast<QGLContext *>(window()->d_func()->extraData()->glContext);

is bit too optimistic (as either inline function extraData() or glContext is 0.

I don't expect this to be the full reason, so I'd have to dive into QtOpenGL a bit deeper, if time permits.
Comment 16 Navid Zamani 2017-11-23 14:00:55 UTC
In -9999, this bug is still the case.
And can still be worked around, with running
$ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib64/opengl/nvidia/lib" FreeCAD

($LD_LIBRARY_PATH is empty otherwise, btw.)