Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 861722 - media-gfx/freecad-9999 crashes on opening example or new design
Summary: media-gfx/freecad-9999 crashes on opening example or new design
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernd
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-28 13:15 UTC by brankob
Modified: 2023-03-28 08:47 UTC (History)
4 users (show)

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


Attachments
emerge --info output (emerge_info.txt,8.45 KB, text/plain)
2022-07-28 13:18 UTC, brankob
Details
tweak of the original ebouild that otherwise fails (freecad-coin-tweak.patch,99 bytes, patch)
2022-07-28 13:40 UTC, brankob
Details | Diff
trivial coin hello world example (coin_example.tbz2,1.05 KB, application/octet-stream)
2022-08-01 04:12 UTC, brankob
Details
patch for git repo(master) (0001-coin-egl.patch,42.24 KB, text/plain)
2022-09-10 20:10 UTC, brankob
Details
ebuild (coin-9999-r4.ebuild,2.36 KB, text/plain)
2022-09-10 20:11 UTC, brankob
Details

Note You need to log in before you can comment on or make changes to this bug.
Description brankob 2022-07-28 13:15:55 UTC
I have a system with Gentoo and recent packages, that works fine in all other respects.
It's a Ryzen SoC ( V1807B - Ryzen 4C/8T CPU + Vega11 iGPU).
I run mesa-9999 with vulkan support and under wayland+sway

FreeCAD-999 compiled and starts fine, but at the moment that I either start new project or try to open any example, it crashes with message:

[quote]
connect failed: No such file or directory
freecad: /var/tmp/portage/media-libs/coin-4.0.0/work/coin/src/glue/gl.cpp:2354: const cc_glglue* cc_glglue_instance(int): Assertion `current_ctx && "Must have a current GL context when instantiating cc_glglue!! (Note: if you are using an old Mesa GL version, set the environment variable COIN_GL_NO_CURRENT_CONTEXT_CHECK to get around what may be a Mesa bug.)"' failed.
Prekinjen (izpis jedra)[/quote]

I tried using that advice and setting COIN_GL_NO_CURRENT_CONTEXT_CHECK, but then I get just a screenfull crash report from MESA.
All other stuff that is using mesa is running fine ( various cad, openscad, mpv, games like saurbraten etc), just freecad crashes.

Anyone with an idea where to look ?

Output of "emerge -pv --nodeps libdrm xf86-video-{amdgpu,ati} wayland wayland-protocols wlroots sway coin freecad":

[quote]
These are the packages that would be merged, in order:

[ebuild   R   *] x11-libs/libdrm-9999::gentoo  USE="-valgrind" ABI_X86="32 (64) (-x32)" VIDEO_CARDS="amdgpu intel nouveau radeon (-exynos) (-freedreno) (-omap) (-tegra) (-vc4) (-vivante) -vmware" 0 KiB
[ebuild   R   *] x11-drivers/xf86-video-amdgpu-9999::gentoo  USE="udev" 0 KiB
[ebuild   R   *] x11-drivers/xf86-video-ati-9999::gentoo  USE="udev" 0 KiB
[ebuild   R   *] dev-libs/wayland-9999::gentoo  USE="-doc -test" ABI_X86="32 (64) (-x32)" 0 KiB
[ebuild   R   *] dev-libs/wayland-protocols-9999::gentoo  USE="-test" 0 KiB
[ebuild   R   *] gui-libs/wlroots-9999:0/9999::gentoo  USE="X vulkan x11-backend" 0 KiB
[ebuild   R   *] gui-wm/sway-9999-r4::mine  USE="X man swaybar swaybg swayidle swaylock swaymsg swaynag systemd tray -elogind -fish-completion -seatd -wallpapers -zsh-completion" 0 KiB
[ebuild   R    ] media-libs/coin-4.0.0::gentoo  USE="exceptions -debug -doc -javascript -man -openal -qthelp -test -threads" 0 KiB
[ebuild   R   *] media-gfx/freecad-9999-r4::mine  USE="addonmgr fem idf image inspection material openscad part-design path points raytracing robot show surface techdraw tux -cloud -debug -designer -headless -pcl -plot -ship -test" PYTHON_SINGLE_TARGET="python3_10 -python3_8 -python3_9" 0 KiB
[/quote]

I've also attached output of emerge --info






Reproducible: Always

Steps to Reproduce:
1. freecad
2. open any example on the front page
3.
Actual Results:  
system crash / core dump
Comment 1 brankob 2022-07-28 13:18:56 UTC
Created attachment 795269 [details]
emerge --info output
Comment 2 brankob 2022-07-28 13:38:11 UTC
Oh, I forgot to mention that I had to tweak the freecad-9999 ebuild just to 
skip the line that removes coind3d cmake file, which is now absent in the code tree.

Change is trivial, but just in case, I've attached the patch of ebuild change...
Comment 3 brankob 2022-07-28 13:40:53 UTC
Created attachment 795275 [details, diff]
tweak of the original ebouild that otherwise fails

git tree now doesn't have the file, so the line that removes it, now fails:
"rm "${S}/cMake/FindCoin3D.cmake" || die"

ebuild change only removes that line.
Comment 4 Bernd 2022-07-29 17:02:23 UTC
(In reply to Branko Badrljica from comment #3)
> Created attachment 795275 [details, diff] [details, diff]
> tweak of the original ebouild that otherwise fails
> 
> git tree now doesn't have the file, so the line that removes it, now fails:
> "rm "${S}/cMake/FindCoin3D.cmake" || die"
> 
> ebuild change only removes that line.
Your tree is outdated. Please sync and try again.


For the crash I first have to research. I'm having no clue about using mesa, especially not in combination with wayland. I can't reproduce this on a live ebuild, built 4 days ago with hardware acceleration instead of mesa.

One a side note, live ebuilds usually aren't meant for the casual user. They can succeed to build and run properly on one day, and fail to build or crash on the next day. I had this already a few times with freecad.
Comment 5 brankob 2022-08-01 04:12:30 UTC
Created attachment 796303 [details]
trivial coin hello world example

unpack, run my_build and then execute the final executable in 000_build.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-08-01 04:14:39 UTC
If the software itself is crashing, you likely need to report this directly to upstream.
Comment 7 brankob 2022-08-01 04:18:54 UTC
(In reply to Sam James from comment #6)
> If the software itself is crashing, you likely need to report this directly
> to upstream.

It looks like coin library fails to get valid context for a drawable or somethign from wayland.

I've found trivial "Hello world" example with coin that fails in the exact same way and attached it here in a tarbzip.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-08-01 04:26:11 UTC
(In reply to Branko Badrljica from comment #7)
> (In reply to Sam James from comment #6)
> > If the software itself is crashing, you likely need to report this directly
> > to upstream.
> 
> It looks like coin library fails to get valid context for a drawable or
> somethign from wayland.
> 
> I've found trivial "Hello world" example with coin that fails in the exact
> same way and attached it here in a tarbzip.

Ah, sorry, I'd just missed it. I think it might be that coin is deficient here? https://github.com/coin3d/coin/issues/451
Comment 9 Bernd 2022-08-01 06:23:57 UTC
Following the issue linked by Sam, there seems to be several packages involved in this.

- Coin needs EGL, Wayland support
- Quarter (and eventually obsolete SoQt as well) moving from QGLWidget to QOpenGLWidget
- pivy implementing this move in it's python bindings.

The basis seems to be the EGL and Wayland support for coin, of which the issue got re-opened after a PR was merged, so this implementation seems not to be complete. However, coin upstream noted that a COIN_USE_EGL or similar cmake option will be available in the next release.
Comment 10 brankob 2022-09-10 20:04:47 UTC
I've got tired waiting for upstream to accept waiting patches, so I did that myself and added simple fix that prevented compile.
Coin now seems to be working fine. with EGL/Wayland. 
Given example certainly works now on my machine, same as Freecad and Openscad.
I'll attach the patch for current HEAD of git repo and new ebuild for coin.

BTW, openscad has gained new meson config bool ENABLE_EGL. It works fine without it, though.
Comment 11 brankob 2022-09-10 20:10:48 UTC
Created attachment 804535 [details]
patch for git repo(master)
Comment 12 brankob 2022-09-10 20:11:16 UTC
Created attachment 804538 [details]
ebuild
Comment 13 Bernd 2022-09-10 23:39:53 UTC
Wouldn't this patch belong to the media-libs/coin package?
Comment 14 brankob 2022-09-11 09:36:38 UTC
Yes, but I wanted to resolve the report that  I started.
Comment 15 Bernd 2022-09-11 09:48:12 UTC
Thanks Branko for your research in this and patching!