msva / mva-overlay

mva's sandbox overlay

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

telegram-desktop: Freeze on start

shibotto opened this issue · comments

commented

Premise: telegram-desktop is the only package I use from your overlay. I don't know if it is somewhat relevant.

[2017.05.23 17:00:01] Launched version: 1001002, alpha: [FALSE], beta: 0, debug mode: [FALSE], test dc: [FALSE]
[2017.05.23 17:00:01] Executable dir: , name: 
[2017.05.23 17:00:01] Initial working dir: /encrypted/gentoo/shiba/
[2017.05.23 17:00:01] Working dir: /encrypted/gentoo/shiba/.TelegramDesktop/
[2017.05.23 17:00:01] Arguments: "Telegram"
[2017.05.23 17:00:01] Logs started
[2017.05.23 17:00:01] Connecting local socket to /tmp/d5c17f2c082f8fea1cb04152ac9f25d8-{87A94AB0-E370-4cde-98D3-ACC110C5967D}...
[2017.05.23 17:00:01] Socket connect error 0, starting server and app...
[2017.05.23 17:00:01] Moved logging from '/encrypted/gentoo/shiba/.TelegramDesktop/log_start0.txt' to '/encrypted/gentoo/shiba/.TelegramDesktop/log.txt'!
[2017.05.23 17:00:01] Opened '/encrypted/gentoo/shiba/.TelegramDesktop/tdata/working' for reading, the previous Telegram Desktop launch was not finished properly :( Crash log size: 0
[2017.05.23 17:00:01] Font Error: could not locate 'Open Sans Semibold' font in ':/gui/fonts/OpenSans-Semibold.ttf'.

It is strange (and, by the way, I can't reproduce that).

Does it follow to missing text during Telegram work, or it works fine despite of that error?

@Shiba89 ping? Can you give any more feedback on that?

// I'll close issue until your (or anybody else) answer here, since I can't reproduce the issue and so then I can't fix the problem I can't see.

I reproduce the same issue. It only works if I open the binary as root.

I noticed that the issue is not related with Open Sans, but with another thing we don't know, because when I opened Telegram with root, it appears the same log but with more messages, and however, Telegram opened anyways.
This is the log when I open Telegram as root: https://pastebin.com/tFsF67L8
The log when I tried to open it as a root is the same as above shown by the reporter.

I removed telegram-desktop and tried the bin version (in my overlay), and this is the log: https://pastebin.com/27Z4UkaG

I'll try again later after reinstalling the source-based version.

I'd like to see strace (as I wrote above) to look for exact place and the reason why it exits when you run it as non-root.

I tried to get the strace, but as if Telegram gets stuck and does not open, I can't get the paste so it gets in a perpetual loop. When I try to run Telegram as a user, I have to kill the process to end.

However, this shows when I try to open it from the command line:
`
jorgicio@hackenherr:~$ Telegram [14:14:52]

(Telegram:25360): GLib-GObject-WARNING **: cannot register existing type 'GdkDisplayManager'

(Telegram:25360): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(Telegram:25360): GLib-GObject-CRITICAL **: g_object_new: assertion 'G_TYPE_IS_OBJECT (object_type)' failed

`
So I have to kill it to stop.

strace.txt
This is what I tried to get.

It's very and very strange.
Can you also:

  1. post the output of id command (especially, the system groups, you're in),
  2. tell me, if you're using Hardened profile, SELinux (or other MAC/RBAC), and/or PaX kernel patchset?
  3. try to perform that:
$ env -i sh
$ export HOME=/home/jorgicio PATH=/usr/local/bin:/usr/bin:/bin DISPLAY=:0
$ Telegram

And also, repeat 3) after doing this:

$ mv ~/.local/share/TelegramDesktop{,.backup} &&
$ sudo cp -r /root/.local/share/TelegramDesktop /home/jorgicio/.local/share/ &&
$ sudo chown jorgicio:jorgicio -R /home/jorgicio/.local/share

before it

And tell me, if any of that will change anything in tdesktop's behaviour?

By the way, it is not necessary to close already-opened telegram, when you'll try to that.
Also, it can be that it just want some long time to do some internal caching work. How long did you wait (maximum amount of time you wait before interrupting it)?

@msva I had it on hold during 45 seconds and then I interrupted the running and got that log. I don't use the SELinux profile, but the common desktop one.
I did the three commands you suggested in step 3) and it works. Then I did the latter and repeated the 3) step and it works too.

And just to collect the full case: do it work without step 3) now, after "latter" commands?

Sorry, I forgot to paste the output of the id command:

uid=1000(jorgicio) gid=1000(jorgicio) grupos=1000(jorgicio),5(tty),7(lp),10(wheel),14(uucp),18(audio),19(cdrom),27(video),35(games),78(kvm),85(usb),100(users),105(bumblebee),106(lpadmin),243(plugdev),988(realtime),995(scanner),996(dnscrypt),997(wireshark),998(dropbox)

And without the "export" part, this happens:

jorgicio@hackenherr:~$ env -i sh                                                                                                                               [23:21:52]
sh-4.3$ Telegram
QXcbConnection: Could not connect to display 
Telegram[0x621c3c]
Telegram[0x621edc]
Telegram[0xef6464]
Telegram[0xef67b8]
/lib64/libpthread.so.0(+0x10ec0)[0x7f09464a9ec0]
/lib64/libc.so.6(gsignal+0x37)[0x7f0945c170e7]
/lib64/libc.so.6(abort+0x16a)[0x7f0945c1853a]
/usr/lib64/libQt5Core.so.5(+0x8e306)[0x7f0946743306]
/usr/lib64/libQt5Core.so.5(_ZNK14QMessageLogger5fatalEPKcz+0xd4)[0x7f09467449e4]
/usr/lib64/libQt5XcbQpa.so.5(+0x3c8e8)[0x7f093f4728e8]
/usr/lib64/libQt5XcbQpa.so.5(_ZN15QXcbIntegrationC1ERK11QStringListRiPPc+0x4ea)[0x7f093f47854a]
/usr/lib64/qt5/plugins/platforms/libqxcb.so(+0x13de)[0x7f094977f3de]
/usr/lib64/libQt5Gui.so.5(_ZN27QPlatformIntegrationFactory6createERK7QStringRK11QStringListRiPPcS2_+0xc1)[0x7f0946c0c381]
/usr/lib64/libQt5Gui.so.5(_ZN22QGuiApplicationPrivate25createPlatformIntegrationEv+0x8a0)[0x7f0946c17550]
/usr/lib64/libQt5Gui.so.5(_ZN22QGuiApplicationPrivate21createEventDispatcherEv+0x1b)[0x7f0946c185ab]
/usr/lib64/libQt5Core.so.5(_ZN23QCoreApplicationPrivate4initEv+0x725)[0x7f09468e6345]
/usr/lib64/libQt5Gui.so.5(_ZN22QGuiApplicationPrivate4initEv+0x19)[0x7f0946c14749]
/usr/lib64/libQt5Widgets.so.5(_ZN19QApplicationPrivate4initEv+0x9)[0x7f094907b609]
Telegram[0x50851e]
Telegram[0x62ca7d]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7f0945c04790]
Telegram[0x435f59]
Aborted

Anyway, if it will work without env -i now, then it looks like there is font caching issue, or something like that.
Probably, it can be alternatively fixed by calling fc-cache -v -f command prior to running Telegram.

If it will still not work without env -i, I'd need a bit of kinda "private information" 😀 : full output of env command without any arguments (all your environment variables)

P.S. By the way, that stacktrace in "step 3)" without exporting is normal (it happens because of lack of DISPLAY variable)

Without env -i it doesn't work.
The env output is here.

Well, I suspect two groups of the variables: INFINALITY* and XDG*

Oh! Try to run QT_STYLE_OVERRIDE=moo Telegram.

Did it and didn't work. I think the culprit may be in some XDG_* variable.

Well, it is two ways to find the culprit:

  1. take env -i (step 3) from above) and start adding variables one-by-one until it will stop working.
  2. take current environment and start unset'ting variables until it start working.

In both of ways you can start from any of variables and add/remove them in any order you want. The only important thing is that they should be export'ed if it is second way and unset'ted if it is the first.
Also, I guess, second way is a bit more useful, since it will be easier to debug it a bit later (see below) if it will be the situation that culprit is few of them altogether, but not a single one.

Then, when you'll localize potential culprit variable, it'll be time to check if:

  1. unsetting only it in your "fresh" shell session fixes the problem.
  2. setting it in "step 3)" produces the problem.

If even single of that is "no", then it is not only it is culprit by itself, but there is few of them altogether, and it needs a bit more debugging to find all of them.

Then you can post it (or them) here and I'll patch the sources to locally unset them in Telegram, so it should fix the problem for all the people who experience it.

Also, did you try to unset QT_STYLE_OVERRIDE && /usr/bin/Telegram?

Yes, and happens the same.

I reported the issue in Telegram and I found the culprit: Pulseaudio. Since I started like you said, I can't play sounds or any note voices.

See telegramdesktop/tdesktop#3470 and telegramdesktop/tdesktop#3477

By the way, are you really sure, PA is really issue? It can be just a side-effect (and easily fixable).

Did you try bisecting environment variables like I suggested above :)

I don't have installed system-wide Pulseaudio, and as I noticed, PA is may be an issue as shown in the issue reports (and the tests I did, because I can't play any sound at all in Telegram) And I did all you said, and only the env part worked, but without sound. So yes, it may be a PA issue

@Shiba89 @jorgicio
can you try it with USE=-pulseaudio now? Will it fix the issue?

commented

Sorry, I accidentally muted notifications for this issue. I'm trying this week, it takes a while on my hardware so I have to wait until I have enough time.

commented

Compilation fails for me, complete build log at https://dpaste.de/Gqib/raw
Errors starts around line 1570.

commented

Builds and works fine as of daf2931 with USE="-pulseaudio", thank you. I tried playing some audio message and video with the embedded player and so far no problem. Should I give it a go with USE="+pulseaudio"?

Well, I doubt it will work for you with USE=pulseaudio if it wasn't work before (since there wasn't changes about that in upstream).

But if you want, you can check and post result here.
Just for our information ☺

And, I guess, issue can finally be closed ;)

commented
 * Found these USE flags for net-im/telegram-desktop-1.1.19:
 U I
 - - custom-api-id : Use custom API ID and API HASH (you must set it either in make.conf or
                     portage/env/{CAT}/{PN}.
 - - debug         : Enable extra debug codepaths, like asserts and extra output. If you want
                     to get meaningful backtraces see
                     https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
 - - gtk3          : Keeps GTK3 stuff enabled
 + + pulseaudio    : Keeps Pulseaudio support enabled (ALSA-only backend will be used if you
                     disable this)
 + + wide-baloons  : Apply custom patch to make text baloons in chat journal follow longest
                     line width on adaptive widescreen layout, instead of using short ones and
                     keep tons of empty space.

I really don't know what to say, but it works... whatever :D