Bug 411425 - The link ordering is correct by chance only and init of gdrive.so fails when linking with LTO enabled
Summary: The link ordering is correct by chance only and init of gdrive.so fails when ...
Status: REPORTED
Alias: None
Product: libkgapi
Classification: Frameworks and Libraries
Component: drive (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Daniel Vrátil
URL:
Keywords:
: 428826 449113 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-08-29 15:45 UTC by Hans-Peter Jansen
Modified: 2022-01-30 13:39 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch to provoke failure, even if LTO is disabled (584 bytes, patch)
2019-08-29 15:45 UTC, Hans-Peter Jansen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Peter Jansen 2019-08-29 15:45:01 UTC
Created attachment 122413 [details]
patch to provoke failure, even if LTO is disabled

SUMMARY
The linking is ordered alphabetically in src/drive/CMakeLists.txt, and fails
with a segfault, if LTO is used, because LTO doesn't stick to the supplied linking order, if it sees a chance to optimize module locality.

See:
https://bugzilla.opensuse.org/show_bug.cgi?id=1148217
Specifically:
https://bugzilla.opensuse.org/show_bug.cgi?id=1148217#c19
and
https://bugzilla.opensuse.org/show_bug.cgi?id=1148217#c21

STEPS TO REPRODUCE
apply attached patch, compile, install, and run "kioclient5 exec gdrive:/"

OBSERVED RESULT
Failure: The process for the protocol gdrive failed unexpectedly. (translated)

EXPECTED RESULT
No failure

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Tumbleweed 20190824
(available in About System)
KDE Plasma Version:  5.16.4
KDE Frameworks Version: 5.61.0
Qt Version: 5.13.0

ADDITIONAL INFORMATION
Linking with LTO disabled fixed the problem, but the correct initialization order should be addressed in some future version.
Comment 1 Antonio Rojas 2022-01-30 13:37:22 UTC
*** Bug 428826 has been marked as a duplicate of this bug. ***
Comment 2 Antonio Rojas 2022-01-30 13:39:46 UTC
*** Bug 449113 has been marked as a duplicate of this bug. ***