Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 806292 - >net-im/telegram-desktop-2.8.1 does not start on x11-wm/awesome
Summary: >net-im/telegram-desktop-2.8.1 does not start on x11-wm/awesome
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal critical (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-08-03 14:08 UTC by Ilia Durov
Modified: 2021-08-04 08:31 UTC (History)
3 users (show)

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


Attachments
emerge --info (info.txt,18.46 KB, text/plain)
2021-08-03 14:14 UTC, Ilia Durov
Details
1st patch (1.patch,1.71 KB, patch)
2021-08-03 19:03 UTC, Ilia Durov
Details | Diff
2nd patch (2.patch,2.33 KB, patch)
2021-08-03 19:03 UTC, Ilia Durov
Details | Diff
3rd patch (3.patch,1.71 KB, patch)
2021-08-03 19:03 UTC, Ilia Durov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ilia Durov 2021-08-03 14:08:35 UTC
>net-im/telegram-desktop-2.8.1 built using the latest GCC does not start on x11-wm/awesome. But net-im/telegram-desktop-2.8.1 build using the same compiler works fine.

Probably the problem is caused by the newest jemalloc patch. Also please check
vimdiff -R telegram-desktop-2.8.1.ebuild telegram-desktop-2.8.11.ebuild
It can help you with the issue resolving.

Telegram 2.8.11 multi-thread process itself starts (I can see it in htop utility) and then suddenly freezes, so there are no GUI at all on the screen.

-----
equery u =net-im/telegram-desktop-2.8.11
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for net-im/telegram-desktop-2.8.11:
 U I
 + + X        : Add support for X11
 + + dbus     : Enable dbus support for anything that needs it (gpsd, gnomemeeting, etc)
 - - enchant  : Enable the app-text/aspell spell-checking backend 
 + + gtk      : Add support for x11-libs/gtk+ (The GIMP Toolkit)
 + - hunspell : Enable the app-text/hunspell spell-checking backend 
 + + spell    : Add dictionary support
 - - wayland  : Enable dev-libs/wayland backend
 - - webkit   : Add support for the WebKit HTML rendering/layout engine

Reproducible: Always

Steps to Reproduce:
1. emerge >net-im/telegram-desktop-2.8.1.
2. Launch >net-im/telegram-desktop-2.8.1 on x11-wm/awesome.
Actual Results:  
1. Ensure that telegram-desktop exists in htop but you cannot see GUI on the screen.
2. Wait for about 5 minutes.
3. Ensure that GUI is still not launched but telegram-desktop (in htop) is still launched.

Expected Results:  
You can see Telegram GUI app.
Comment 1 Ilia Durov 2021-08-03 14:10:55 UTC
emerge --info:
https://pastebin.com/FmuyBUne
Comment 2 Ilia Durov 2021-08-03 14:14:33 UTC
Created attachment 729876 [details]
emerge --info
Comment 3 Esteve Varela Colominas 2021-08-03 15:30:13 UTC
Jemalloc likely has little to do with this, as that shouldn't be affected by your WM, and the patch I added merely prevents it from linking with some build-time binaries (as the portage sandbox has issues with this). I run i3 and it's working fine for me, did you try any other WMs?
Can you try the official binary? Does it happen there?
If it only happens with this package, please run it, let it hang, run "sudo gdb --pid=<pid>" and then "bt" to get a backtrace. Post that here.

Also, please refrain from spamming two different threads with links to this issue in the future... Be patient and let bug-wranglers get to it, or CCing me manually should be more than enough, too.
Comment 4 Ilia Durov 2021-08-03 16:48:36 UTC
(In reply to Esteve Varela Colominas from comment #3)
> did you try any other WMs?
No.

> Can you try the official binary? Does it happen there?
I may try =net-im/telegram-desktop-bin-2.9.0 later if it will be required.


> If it only happens with this package, please run it, let it hang, run "sudo
> gdb --pid=<pid>" and then "bt" to get a backtrace. Post that here.
OK. Now I emerged emerge -1 =net-im/telegram-desktop-2.8.11
Then I launched telegram-desktop. In htop, I see the following threads:

├─ /usr/bin/telegram-desktop
│  ├─ jemalloc_bg_thd
│  ├─ gmain
│  ├─ jemalloc_bg_thd
│  ├─ gdbus
│  ├─ jemalloc_bg_thd
│  ├─ QXcbEventQueue
│  └─ jemalloc_bg_thd
├─ /usr/bin/telegram-desktop -basegtkintegration :1.1188 org.telegram.desktop.BaseGtkIntegration-44d0dc203247b2d6d14d4e838ac0641b
│  ├─ gmain
│  └─ gdbus
└─ /usr/bin/telegram-desktop -gtkintegration :1.1188 org.telegram.desktop.GtkIntegration-44d0dc203247b2d6d14d4e838ac0641b
   ├─ gmain
   └─ gdbus

I obtained pid of the first process in the list ("/usr/bin/telegram-desktop") and executed gdb backtrace. Result:

(gdb) bt
#0  0x00007f4a1537aac9 in syscall () at /lib64/libc.so.6
#1  0x00007f4a1598bdaf in g_cond_wait () at /usr/lib64/libglib-2.0.so.0
#2  0x00007f4a15962f2b in g_once_init_enter () at /usr/lib64/libglib-2.0.so.0
#3  0x00007f4a0a62b86e in gtk_buildable_get_type () at /usr/lib64/libgtk-x11-2.0.so.0
#4  0x00007f4a0a65bd02 in gtk_container_get_type () at /usr/lib64/libgtk-x11-2.0.so.0
#5  0x00007f4a0a626db5 in gtk_bin_get_type_once () at /usr/lib64/libgtk-x11-2.0.so.0
#6  0x00007f4a0a626fed in gtk_bin_get_type () at /usr/lib64/libgtk-x11-2.0.so.0
#7  0x00007f4a0a65002c in gtk_combo_box_get_type_once () at /usr/lib64/libgtk-x11-2.0.so.0
#8  0x00007f4a0a6565ad in gtk_combo_box_get_type () at /usr/lib64/libgtk-x11-2.0.so.0
#9  0x00007f4a0a6592ca in gtk_combo_box_entry_get_type_once () at /usr/lib64/libgtk-x11-2.0.so.0
#10 0x00007f4a0a6598fd in gtk_combo_box_entry_get_type () at /usr/lib64/libgtk-x11-2.0.so.0
#11 0x00007f4a0a6599e9 in gtk_combo_box_entry_new () at /usr/lib64/libgtk-x11-2.0.so.0
#12 0x00007f4a0d03fd3e in QGtkStylePrivate::initGtkWidgets() const () at /usr/lib64/qt5/plugins/styles/libqgtk2style.so
#13 0x00007f4a0d040faf in QGtk2StylePlugin::create(QString const&) () at /usr/lib64/qt5/plugins/styles/libqgtk2style.so
#14 0x00007f4a17237e6a in QStyleFactory::create(QString const&) () at /usr/lib64/libQt5Widgets.so.5
#15 0x00007f4a171c9f47 in QApplication::style() () at /usr/lib64/libQt5Widgets.so.5
#16 0x00007f4a171ca5aa in QApplicationPrivate::initialize() () at /usr/lib64/libQt5Widgets.so.5
#17 0x00007f4a171cbb16 in QApplicationPrivate::init() () at /usr/lib64/libQt5Widgets.so.5
#18 0x000055f42e4dc118 in Core::Sandbox::Sandbox(gsl::not_null<Core::Launcher*>, int&, char**) ()
#19 0x000055f42e4cde30 in Core::Launcher::executeApplication() ()
#20 0x000055f42e4cdfb0 in Core::Launcher::exec() ()
#21 0x000055f42d9a0a45 in main ()
(gdb)
Comment 5 Ilia Durov 2021-08-03 16:59:37 UTC
Additional information:
$ echo $QT_QPA_PLATFORMTHEME
gtk2
$ find /var/db/pkg -type d | grep -i qtstyleplugins
/var/db/pkg/dev-qt/qtstyleplugins-5.0.0_p20170311-r1

There Nick Novikov says that it does not work with QT_QPA_PLATFORMTHEME=gtk2:
https://bugs.archlinux.org/task/71541
Patches are attached there as well.
Comment 6 Esteve Varela Colominas 2021-08-03 17:22:47 UTC
Have you tested those patches? You can drag them to /etc/portage/patches/net-im/telegram-desktop and they should be applied (watch for "User patches applied" in the build log). If you can test them and they work, I'll add them for 2.8.11.
Thanks in advance.
Comment 7 Ilia Durov 2021-08-03 19:02:22 UTC
(In reply to Esteve Varela Colominas from comment #6)
> Have you tested those patches? You can drag them to
> /etc/portage/patches/net-im/telegram-desktop and they should be applied
> (watch for "User patches applied" in the build log). If you can test them
> and they work, I'll add them for 2.8.11.
> Thanks in advance.

I created 3 new patches based on those 3 patches. I attached that. Please look at vimdiff (if needed). Once these attached patches were applied, Telegram 2.8.11 became working properly.
Comment 8 Ilia Durov 2021-08-03 19:03:21 UTC
Created attachment 729924 [details, diff]
1st patch
Comment 9 Ilia Durov 2021-08-03 19:03:38 UTC
Created attachment 729926 [details, diff]
2nd patch
Comment 10 Ilia Durov 2021-08-03 19:03:53 UTC
Created attachment 729928 [details, diff]
3rd patch
Comment 11 Esteve Varela Colominas 2021-08-03 21:54:16 UTC
Thanks a ton for testing! I've included the patch in the linked PR, and hopefully it's reviewed and merged soon. Please sit tight!
Comment 12 Larry the Git Cow gentoo-dev 2021-08-04 08:31:24 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba3e19059ebe0e6eb6a05e53fd42fff5bdf8e5fd

commit ba3e19059ebe0e6eb6a05e53fd42fff5bdf8e5fd
Author:     Esteve Varela Colominas <esteve.varela@gmail.com>
AuthorDate: 2021-08-03 21:07:49 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-08-04 08:29:27 +0000

    net-im/telegram-desktop: Fix running with QT_QPA_PLATFORMTHEME=gtk2
    
    Closes: https://bugs.gentoo.org/806292
    See-also: https://bugs.archlinux.org/task/71541
    Thanks-to: Ilia Durov <ildurrx@mail.ru>
    Signed-off-by: Esteve Varela Colominas <esteve.varela@gmail.com>
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 .../tdesktop-2.8.11-load-gtk-with-qlibrary.patch   | 112 +++++++++++++++++++++
 .../telegram-desktop-2.8.11.ebuild                 |   3 +-
 2 files changed, 114 insertions(+), 1 deletion(-)