Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 802624 - =net-im/telegram-desktop-2.8.10 won't finish compiling
Summary: =net-im/telegram-desktop-2.8.10 won't finish compiling
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Esteve Varela Colominas
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-07-17 17:31 UTC by Red
Modified: 2021-07-20 10:36 UTC (History)
5 users (show)

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


Attachments
emerge --info (telegram-desktop-emerge-info.txt,24.83 KB, text/plain)
2021-07-17 17:31 UTC, Red
Details
Build log (telegram-desktop-build.log,515.15 KB, text/plain)
2021-07-17 18:38 UTC, Red
Details
Output of pstree when telegram-desktop compilation hangs (telegram-desktop-pstree.txt,3.10 KB, text/plain)
2021-07-18 22:47 UTC, Red
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Red 2021-07-17 17:31:24 UTC
=net-im/telegram-desktop-2.8.10 won't finish compiling. After disabling ccache and reducing make jobs to 1, the exact step is:

[218/938] : && /usr/bin/x86_64-pc-linux-gnu-g++ -O2 -pipe -march=skylake -mtune=skylake -Wl,-O1 -Wl,--as-needed Telegram/codegen/codegen/common/CMakeFiles/codegen_common.dir/basic_tokenized_file.cpp.o Telegram/codegen/codegen/common/CMakeFiles/codegen_common.dir/checked_utf8_string.cpp.o Telegram/codegen/codegen/common/CMakeFiles/codegen_common.dir/clean_file.cpp.o Telegram/codegen/codegen/common/CMakeFiles/codegen_common.dir/cpp_file.cpp.o Telegram/codegen/codegen/common/CMakeFiles/codegen_common.dir/logging.cpp.o Telegram/codegen/codegen/emoji/CMakeFiles/codegen_emoji.dir/data.cpp.o Telegram/codegen/codegen/emoji/CMakeFiles/codegen_emoji.dir/data_old.cpp.o Telegram/codegen/codegen/emoji/CMakeFiles/codegen_emoji.dir/data_read.cpp.o Telegram/codegen/codegen/emoji/CMakeFiles/codegen_emoji.dir/generator.cpp.o Telegram/codegen/codegen/emoji/CMakeFiles/codegen_emoji.dir/main.cpp.o Telegram/codegen/codegen/emoji/CMakeFiles/codegen_emoji.dir/options.cpp.o Telegram/codegen/codegen/emoji/CMakeFiles/codegen_emoji.dir/replaces.cpp.o -o Telegram/codegen/codegen/emoji/codegen_emoji  /usr/lib64/libjemalloc.so  /usr/lib64/libQt5Widgets.so.5.15.2  /usr/lib64/libQt5Gui.so.5.15.2  /usr/lib64/libQt5Network.so.5.15.2  /usr/lib64/libQt5DBus.so.5.15.2  /usr/lib64/libQt5Core.so.5.15.2 && :

The compiler is not running at this point according to htop.

build.log shows no additional information.

Attached is the result of FEATURES=-ccache MAKEOPTS=-j1 emerge --info net-im/telegram-desktop

Reproducible: Always
Comment 1 Red 2021-07-17 17:31:54 UTC
Created attachment 724573 [details]
emerge --info
Comment 2 Marco Scardovi (scardracs) 2021-07-17 18:07:09 UTC
Please post full build log
Comment 3 Red 2021-07-17 18:38:57 UTC
Created attachment 724576 [details]
Build log
Comment 4 Georgy Yakovlev archtester gentoo-dev 2021-07-17 20:59:41 UTC
why do you have CPPFLAGS set to same value as C(XX)FLAGS?
it's not supposed to be used like that, please unset and leave empty.
Comment 5 Esteve Varela Colominas 2021-07-17 22:44:30 UTC
I can't reproduce this, even with your USE flag setup, and your *FLAGS don't seem wrong.

Aside from simply clearing your *FLAGS, try re-running the build a couple of times to see if your issue is reproducible and hangs at exactly the same file. Can you run "tree" when it's hung, and post the output? I'd like to see what process is currently spawned under ebuild.sh.

I wonder why your emerge --info is so extensive. Mine doesn't report even half of those variables.
Comment 6 Red 2021-07-18 00:08:14 UTC
(In reply to Esteve Varela Colominas from comment #5)
> Can you run "tree" when it's hung, and post the output? I'd like to
> see what process is currently spawned under ebuild.sh.
> 

What is "tree" and what package is it in?
Comment 7 Red 2021-07-18 00:18:56 UTC
I was able to compile telegram-desktop with the new jemalloc USE flag disabled.
Comment 8 Georgy Yakovlev archtester gentoo-dev 2021-07-18 02:34:33 UTC
note that new ebuild briefly added USE=jemalloc and now comes with jemalloc enabled unconditionally.

so after you sync next time, try again. version did not change but flag was removed.
Comment 9 Georgy Yakovlev archtester gentoo-dev 2021-07-18 02:35:11 UTC
(In reply to Esteve Varela Colominas from comment #5)

> I wonder why your emerge --info is so extensive. Mine doesn't report even
> half of those variables.

I guess it's emerge --info --verbose
Comment 10 Esteve Varela Colominas 2021-07-18 09:43:11 UTC
> What is "tree" and what package is it in?

I meant pstree and it's in the psmisc package.

I highly doubt the jemalloc USE flag would affect this, but since that USE flag was removed (its functionality being force-enabled) yesterday, you'll have to build it *with* that eventually as well.
Comment 11 Red 2021-07-18 22:47:38 UTC
Created attachment 724918 [details]
Output of pstree when telegram-desktop compilation hangs
Comment 12 Esteve Varela Colominas 2021-07-19 14:02:45 UTC
Thanks. I got a similar report from someone else through a different channel, and both hang at the same command(s). Here's a sample:

> codegen_numbers -o/var/tmp/portage/net-im/telegram-desktop-2.8.10/work/telegram-desktop-2.8.10_build/Telegram/gen /var/tmp/portage/net-im/telegram-desktop-2.8.10/work/tdesktop-2.8.10-full/Telegram/Resources/numbers.txt

Also here's a stack trace of the hang:

#0  0x00007f64abc89fab in __lll_lock_wait () from target:/lib64/libpthread.so.0
No symbol table info available.
#1  0x00007f64abc82f13 in pthread_mutex_lock () from target:/lib64/libpthread.so.0
No symbol table info available.
#2  0x00007f64acc4051b in ?? () from target:/usr/lib64/libjemalloc.so.2
No symbol table info available.
#3  0x00007f64acc1cf94 in ?? () from target:/usr/lib64/libjemalloc.so.2
No symbol table info available.
#4  0x00007f64acc2038d in calloc () from target:/usr/lib64/libjemalloc.so.2
No symbol table info available.
#5  0x00007f64abc9aaf8 in ?? () from target:/lib64/libdl.so.2
No symbol table info available.
#6  0x00007f64abc9a410 in dlsym () from target:/lib64/libdl.so.2
No symbol table info available.
#7  0x00007f64ace74d98 in ?? () from target:/usr/lib64/libsandbox.so

It might be a bad combination of jemalloc with libsandbox. I wonder if we can build codegen_* without linking with jemalloc.
It's weird however that I still can't reproduce it myself, but this might be enough info to fix it.
Comment 13 Esteve Varela Colominas 2021-07-19 20:13:30 UTC
The linked Pull Request contains a patch that's been tested by the other affected user I mentioned in my last message. If you want to, you can test that as well.
Comment 14 Red 2021-07-19 22:17:25 UTC
(In reply to Esteve Varela Colominas from comment #13)
> The linked Pull Request contains a patch that's been tested by the other
> affected user I mentioned in my last message. If you want to, you can test
> that as well.

Telegram compiles and runs successfully for me with the patch.
Comment 15 Larry the Git Cow gentoo-dev 2021-07-20 02:44:06 UTC
The bug has been referenced in the following commit(s):

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

commit 4962cfb47fe4a1fa126b892b693433077e3b1460
Author:     Esteve Varela Colominas <esteve.varela@gmail.com>
AuthorDate: 2021-07-19 20:07:09 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-07-20 02:43:52 +0000

    net-im/telegram-desktop: Bump to 2.8.11
    
    Also attempted to fix a build-time hang.
    Tested and confirmed by at least one user, that's good enough right?
    
    Bug: https://bugs.gentoo.org/802624
    Thanks-to: Red <redblade7@runbox.com>
    Thanks-to: Vlad <@Windows2k@telegram>
    Closes: https://github.com/gentoo/gentoo/pull/21718
    Signed-off-by: Esteve Varela Colominas <esteve.varela@gmail.com>
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 net-im/telegram-desktop/Manifest                   |  2 +-
 .../tdesktop-2.8.10-jemalloc-only-telegram.patch   | 31 ++++++++++++++++++++++
 ....8.10.ebuild => telegram-desktop-2.8.11.ebuild} |  2 ++
 3 files changed, 34 insertions(+), 1 deletion(-)
Comment 16 Esteve Varela Colominas 2021-07-20 10:36:09 UTC
Thanks for confirming!