msva / mva-overlay

mva's sandbox overlay

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

net-im/telegram-desktop-1.9.3[libcxx,gtk2]: segfault

Anonymous1157 opened this issue · comments

You're probably getting tired of most of your bug reports being related to telegram-desktop, so here's another one for good measure!

Trying to build on ~amd64 with clang 9.0.1. All three of rlottie, libgtvoip, and telegram-desktop have libcxx useflag and use this setup via package.env:

CC=${CHOST}-clang
CXX=${CHOST}-clang++
FEATURES="${FEATURES} -ccache"

telegram-desktop package using the gtk2 useflag will build successfully but the resulting binary segfaults.

$ telegram-desktop 
QApplication: invalid style override passed, ignoring it.
    Available styles: bb10dark, bb10bright, cleanlooks, gtk2, cde, motif, plastique, Windows, Fusion

(telegram-desktop:48479): GLib-GObject-WARNING **: 05:06:05.149: cannot register existing type 'GdkDisplayManager'

(telegram-desktop:48479): GLib-CRITICAL **: 05:06:05.149: g_once_init_leave: assertion 'result != 0' failed

(telegram-desktop:48479): GLib-GObject-CRITICAL **: 05:06:05.149: g_object_new_with_properties: assertion 'G_TYPE_IS_OBJECT (object_type)' failed

(telegram-desktop:48479): GLib-GObject-WARNING **: 05:06:05.149: invalid (NULL) pointer instance

(telegram-desktop:48479): GLib-GObject-CRITICAL **: 05:06:05.149: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(telegram-desktop:48479): GLib-GObject-WARNING **: 05:06:05.149: invalid (NULL) pointer instance

(telegram-desktop:48479): GLib-GObject-CRITICAL **: 05:06:05.149: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(telegram-desktop:48479): GLib-GObject-WARNING **: 05:06:05.150: cannot register existing type 'GdkDisplay'

(telegram-desktop:48479): GLib-CRITICAL **: 05:06:05.150: g_once_init_leave: assertion 'result != 0' failed

(telegram-desktop:48479): GLib-GObject-CRITICAL **: 05:06:05.150: g_type_register_static: assertion 'parent_type > 0' failed

(telegram-desktop:48479): GLib-CRITICAL **: 05:06:05.150: g_once_init_leave: assertion 'result != 0' failed

(telegram-desktop:48479): GLib-GObject-CRITICAL **: 05:06:05.150: g_object_new_with_properties: assertion 'G_TYPE_IS_OBJECT (object_type)' failed
Segmentation fault

This does NOT happen when using gtk3, the resulting binary will work just fine.

On my system I build everything with -O2 -ggdb so I was able to get this backtrace for the gtk2 version that segfaults. It might be helpful.

#0  0x00007fffd70af2df in IA__gdk_display_open (display_name=<optimized out>)
    at /var/tmp/portage/x11-libs/gtk+-2.24.32-r1/work/gtk+-2.24.32/gdk/x11/gdkdisplay-x11.c:173
#1  0x00007fffd707db7a in IA__gdk_display_open_default_libgtk_only ()
    at /var/tmp/portage/x11-libs/gtk+-2.24.32-r1/work/gtk+-2.24.32/gdk/gdk.c:324
#2  0x00007fffd707db7a in IA__gdk_display_open_default_libgtk_only ()
    at /var/tmp/portage/x11-libs/gtk+-2.24.32-r1/work/gtk+-2.24.32/gdk/gdk.c:314
#3  0x00007fffd724cb32 in IA__gtk_init_check (argc=<optimized out>, argv=<optimized out>)
    at /var/tmp/portage/x11-libs/gtk+-2.24.32-r1/work/gtk+-2.24.32/gtk/gtkmain.c:1008
#4  0x00007fffd724cb32 in IA__gtk_init_check (argc=<optimized out>, argv=<optimized out>)
    at /var/tmp/portage/x11-libs/gtk+-2.24.32-r1/work/gtk+-2.24.32/gtk/gtkmain.c:1002
#5  0x00000000035c4a15 in Platform::Libs::(anonymous namespace)::setupGtkBase(QLibrary&) (lib_gtk=...)
    at /var/tmp/portage/net-im/telegram-desktop-1.9.3/work/telegram-desktop-1.9.3/Telegram/SourceFiles/platform/linux/linux_libs.cpp:120
#6  0x00000000035c3543 in Platform::Libs::start() ()
    at /var/tmp/portage/net-im/telegram-desktop-1.9.3/work/telegram-desktop-1.9.3/Telegram/SourceFiles/platform/linux/linux_libs.cpp:249
#7  0x00000000035e3376 in Platform::ThirdParty::start() ()
    at /var/tmp/portage/net-im/telegram-desktop-1.9.3/work/telegram-desktop-1.9.3/Telegram/SourceFiles/platform/linux/specific_linux.cpp:375
#8  0x0000000002c5b20a in ThirdParty::start() ()
    at /var/tmp/portage/net-im/telegram-desktop-1.9.3/work/telegram-desktop-1.9.3/Telegram/SourceFiles/core/utils.cpp:126
#9  0x0000000002bd7d9e in Core::Application::run() (this=0x556d800)
    at /var/tmp/portage/net-im/telegram-desktop-1.9.3/work/telegram-desktop-1.9.3/Telegram/SourceFiles/core/application.cpp:165
#10 0x0000000002c20cb3 in std::__1::__function::__value_func<void ()>::operator()() const (this=0x55fd330)
    at /usr/include/c++/v1/functional:1860
#11 0x0000000002c20cb3 in std::__1::function<void ()>::operator()() const (this=0x55fd330) at /usr/include/c++/v1/functional:2419
#12 0x0000000002c20cb3 in base::unique_function<void ()>::operator()() (this=0x55fd330)
    at /var/tmp/portage/net-im/telegram-desktop-1.9.3/work/telegram-desktop-1.9.3/Telegram/lib_base/base/unique_function.h:127
#13 0x0000000002c20cb3 in base::InvokeQueuedEvent::invoke() (this=0x55fd310)
    at /var/tmp/portage/net-im/telegram-desktop-1.9.3/work/telegram-desktop-1.9.3/Telegram/lib_base/base/invoke_queued.h:26
#14 0x0000000002c20cb3 in Core::Sandbox::notifyOrInvoke(QObject*, QEvent*) (this=0x7fffffffd7b0, receiver=0x7fffffffd7b0, e=0x55fd310)
    at /var/tmp/portage/net-im/telegram-desktop-1.9.3/work/telegram-desktop-1.9.3/Telegram/SourceFiles/core/sandbox.cpp:512
#15 0x0000000002c20cb3 in Core::Sandbox::notify(QObject*, QEvent*) (this=0x7fffffffd7b0, receiver=0x7fffffffd7b0, e=0x55fd310)
    at /var/tmp/portage/net-im/telegram-desktop-1.9.3/work/telegram-desktop-1.9.3/Telegram/SourceFiles/core/sandbox.cpp:531
#16 0x00007ffff52b5aae in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x7fffffffd7b0, event=0x55fd310)
    at kernel/qcoreapplication.cpp:1092
#17 0x00007ffff52b86a7 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
    (receiver=0x0, event_type=0, data=0x5468b60) at kernel/qcoreapplication.cpp:1832
#18 0x00007ffff530c203 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x5562780) at kernel/qeventdispatcher_glib.cpp:277
#19 0x00007ffff4a46f6b in g_main_dispatch (context=0x7fffe8005000) at ../glib-2.60.7/glib/gmain.c:3189
#20 0x00007ffff4a46f6b in g_main_context_dispatch (context=context@entry=0x7fffe8005000) at ../glib-2.60.7/glib/gmain.c:3854
#21 0x00007ffff4a47208 in g_main_context_iterate
    (context=context@entry=0x7fffe8005000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at ../glib-2.60.7/glib/gmain.c:3927
#22 0x00007ffff4a4729f in g_main_context_iteration (context=0x7fffe8005000, may_block=may_block@entry=1)
    at ../glib-2.60.7/glib/gmain.c:3988
#23 0x00007ffff530bfb0 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x557d180, flags=...)
    at kernel/qeventdispatcher_glib.cpp:423
#24 0x00007ffff52b48fb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffffffd580, flags=..., 
    flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:136
#25 0x00007ffff52bca0f in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:118
#26 0x0000000002c1c085 in Core::Sandbox::start() (this=0x7fffffffd7b0)
    at /var/tmp/portage/net-im/telegram-desktop-1.9.3/work/telegram-desktop-1.9.3/Telegram/SourceFiles/core/sandbox.cpp:148
#27 0x0000000002c0d169 in Core::Launcher::executeApplication() (this=<optimized out>)
    at /var/tmp/portage/net-im/telegram-desktop-1.9.3/work/telegram-desktop-1.9.3/Telegram/SourceFiles/core/launcher.cpp:475
#28 0x0000000002c0cd25 in Core::Launcher::exec() (this=0x547c0c0)
    at /var/tmp/portage/net-im/telegram-desktop-1.9.3/work/telegram-desktop-1.9.3/Telegram/SourceFiles/core/launcher.cpp:291
#29 0x0000000003a8b013 in main(int, char**) (argc=<optimized out>, argv=<optimized out>)
    at /var/tmp/portage/net-im/telegram-desktop-1.9.3/work/telegram-desktop-1.9.3/Telegram/SourceFiles/main.cpp:12

Another useflag related issue that probably doesn't need its own bug report: I cannot build rlottie, libgtvoip, nor telegram-desktop using GCC with libcxx useflag, I have to use GCC with libstdc++-v3 or clang with libc++ or else the build fails in different ways depending which package.

talking about gtk2+libcxx issue - unfortunatelly, I can't see any obvious thing, that triggers it, and since I'm not using gtk2 myself (and don't have enough spare time to properly debug it myself), I can't fix it for now. All that I can offer for now, is to add a warning in pkg_pretend about possible segfaults with gtk2+libcxx enabled together.

And talking about gcc+libcxx it is "as intended". Building with libcxx requires clang.
And AFAIRC, I did add the checks, that will prevent build to start if libcxx is anabled, but current compiler is not clang:
image
And all the packages should die with exactly this error message if you would try to build them with libcxx+gcc

(and yes, sorry for the delay)

I updated to 1.9.9 and now the build with gtk3 will just run in the background without opening an X11 window.

So I tried building without gtk2 or gtk3 and... the program works perfectly with no lines to the console at all? And I can't tell the difference between a working build with or without GTK support. What does this feature actually do? I didn't need it all along.

oh, also having both gtk2 and gtk3 flags disabled - disables GTK integration at all (telegram behaves like normal Qt applicaiton, without gtk file dialog, appindicator and so on)

Installed 1.9.13 and the application still gets stuck running in the background if I have gtk3 flag enabled (I re-enabled it by accident while messing with the new system-* flags). Works fine with -gtk2 -gtk3.