Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 651658 - dev-util/kdevelop:5 and media-libs/mesa-17*[llvm] link with different slots of sys-devel/llvm, resulting in a runtime symbol conflict and crash
Summary: dev-util/kdevelop:5 and media-libs/mesa-17*[llvm] link with different slots o...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
: 686810 719914 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-03-27 01:02 UTC by Matt Whitlock
Modified: 2020-05-14 21:14 UTC (History)
7 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Whitlock 2018-03-27 01:02:28 UTC
dev-util/kdevelop-5.2.1 (/usr/lib64/qt5/plugins/kdevplatform/30/kdevclangsupport.so) links with sys-devel/llvm:6, but media-libs/mesa-17.3.7 (/usr/lib64/dri/radeonsi_dri.so) links with sys-devel/llvm:5.

According to [1], it can be possible for a process to load two different versions of LLVM libraries but only if LLVM is built using Autotools, not CMake. Since Gentoo's sys-devel/llvm is built using CMake, its libraries do not have versioned symbols. Thus, when kdevelop loads two different versions of LLVM, the symbols clash, and the second copy of LLVM attempts to initialize state that was already initialized by the first copy of LLVM, resulting in the following crash:

  mesa: CommandLine Error: Option 'help-list' registered more than once!
  LLVM ERROR: inconsistency in registered CommandLine options


[1]: https://bugs.archlinux.org/task/48973#comment146238
Comment 1 Matt Whitlock 2018-03-27 01:38:51 UTC
Upgrading to media-libs/mesa-18.0.0_rc5 eliminated the dependency on sys-devel/llvm:5, so now kdevelop works again, but this is not a proper solution, as it will break again when kdevelop links with LLVM 7 but Mesa is still stuck on LLVM 6.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-03-29 07:33:11 UTC
I don't think there's any easy way to fix this. Options are:

1. Get symbol versioning upstream. I think I've seen something on the topic but I don't know the details and Phabricator has the most useless search I've ever seen. Plus, it's unclear if it's really going to fix all the issues or only a few apparent ones.

2. Use a cheap hack in dependencies/blocks of kdeveloper to disallow mesa versions with different LLVM_MAX_SLOT. This is going to be PITA to maintain, and will not even be guaranteed to work (it will mostly rely on PM rebuilding both mesa and kdevelop after possible LLVM upgrade, and PM aggressively trying to upgrade stuff).

3. Add USE flags to control LLVM version linked, and require match betwen kdevelop and mesa. Total PITA to maintain and PITA to users.

4. Stop slotting LLVM. Solves a lot of the problems at the cost of killing old software.
Comment 3 Andreas Sturmlechner gentoo-dev 2019-05-27 10:52:40 UTC
*** Bug 686810 has been marked as a duplicate of this bug. ***
Comment 4 Matt Whitlock 2020-03-29 22:19:50 UTC
This problem has resurfaced for me today. I upgraded to sys-devel/llvm-10.0.0, but media-libs/mesa-20.0.2 is still linked against LLVM 9. Thus, I am again unable to start KDevelop.

I suppose my only option is to uninstall LLVM 10, mask it, and rebuild KDevelop. What a disaster.

Kinda makes one appreciate the way Windows loads DLLs in a strict dependency tree, versus the flat import namespace of the GNU dynamic linker.
Comment 5 email200202 2020-03-30 12:17:11 UTC
Same here.

I solved it by disabling the llvm use flag of mesa then removing sys-devel/llvm-9.0.1
Comment 6 email200202 2020-03-31 05:17:04 UTC
I found that disabling llvm use flag of mesa is a bad idea. It made plasmashell painfully unresponsive.
Comment 7 Andreas Sturmlechner gentoo-dev 2020-04-29 10:20:45 UTC
*** Bug 719914 has been marked as a duplicate of this bug. ***
Comment 8 Tomasz Golinski 2020-05-02 21:20:31 UTC
I noticed the same error today with both LLVM:9 and :10 installed, mesa-20.0.6. However simple rebuild of kdevelop solved the problem for me.