lxqt / lxqt-panel

The LXQt desktop panel
https://lxqt-project.org
GNU Lesser General Public License v2.1
193 stars 135 forks source link

lxqt-panel segfaults when compiled with LTO #1126

Open jubalh opened 5 years ago

jubalh commented 5 years ago

openSUSE started to compile all its packages with Link Time Optimization from gcc by default. For more info please see the Debian wiki and openSUSE wiki. Once we do this lxqt-panel doesn't work properly anymore. For now we will add an exception to compile lxqt-panel without LTO. But I guess it would be good to check why it breaks.

Expected Behavior

lxqt-panel should not segfault.

Current Behavior

lxqt-panel segfaults with.

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f04f5d5b100 in QLayout::setEnabled(bool) () from /usr/lib64/libQt5Widgets.so.5
[Current thread is 1 (Thread 0x7f04f3ea0800 (LWP 1857))]
(gdb) bt
#0  0x00007f04f5d5b100 in QLayout::setEnabled(bool) () from /usr/lib64/libQt5Widgets.so.5
#1  0x000056553a2dec35 in ?? ()
#2  0x000056553a2bf934 in ?? ()
#3  0x000056553a30f796 in ?? ()
#4  0x000056553a30e1b2 in Plugin::loadLib(ILXQtPanelPluginLibrary const*) ()
#5  0x000056553a315cfc in Plugin::Plugin(LXQt::PluginInfo const&, LXQt::Settings*, QString const&, LXQtPanel*) ()
#6  0x000056553a31da24 in ?? ()
#7  0x000056553a31e269 in LXQtPanel::loadPlugins() ()
#8  0x000056553a31f571 in LXQtPanel::LXQtPanel(QString const&, LXQt::Settings*, QWidget*) ()
#9  0x000056553a3177c5 in ?? ()
#10 0x000056553a2b8ebf in ?? ()
#11 0x00007f04f6592bcb in __libc_start_main () from /lib64/libc.so.6
#12 0x000056553a2b8ffa in _start ()
Steps to Reproduce (for bugs)
  1. Compile all of LXQt with LTO. Probably compiling lxqt-panel that way is enough to trigger the issue.
  2. launch lxqt-panel
Context

I'm not yet sure how such an issue occurs. But I assume fixing it would be good since maybe there is an issue underlying it. In any case it would be good to solve it in case more distros decide to use LTO.

System Information
agaida commented 5 years ago

if i understand the current code right fixing this for LTO will be a bigger task - so for god sake disable LTO for the panel until we reworked/overhauled the plugin structure and mechanisms. Might be a task for 0.15 or 0.16

jubalh commented 5 years ago

so for god sake disable LTO for the panel

If you read carefully what I wrote you saw this paragraph:

For now we will add an exception to compile lxqt-panel without LTO. But I guess it would be good to check why it breaks.

So as I said, we do disable LTO for lxqt-panel. But opening this issue to keep track of this upstream makes still sense.

agaida commented 5 years ago

There should be already a similar bug open - but ok, having it explicit again don't hurt.