Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 906302 - net-im/telegram-desktop-4.8.1-r1 qt6 segfault at exit
Summary: net-im/telegram-desktop-4.8.1-r1 qt6 segfault at exit
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Esteve Varela Colominas
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2023-05-13 22:27 UTC by Михаил
Modified: 2023-05-16 17:07 UTC (History)
1 user (show)

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


Attachments
emerge --info telegram-desktop (info_bad.txt,9.36 KB, text/plain)
2023-05-13 22:27 UTC, Михаил
Details
Build log (build_bad.log.zst,57.14 KB, application/zstd)
2023-05-13 22:28 UTC, Михаил
Details
Build log without jemalloc cmake patch (build_without.log.zst,57.24 KB, application/zstd)
2023-05-14 00:35 UTC, Михаил
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Михаил 2023-05-13 22:27:27 UTC
Created attachment 861641 [details]
emerge --info telegram-desktop

Telegram with USE=qt6 works but crash on exit.

$ telegram-desktop
Painter::begin: Paint device returned engine == 0, type: 2
QWidget::render: Cannot render with an inactive painter
qt.svg: Error while inflating gzip file: SVG format check failed
…
qt.svg: Error while inflating gzip file: SVG format check failed
qt.gui.imageio.jpeg: Corrupt JPEG data: premature end of data segment
Segmentation fault (core dumped)

$ telegram-desktop
…
corrupted size vs. prev_size in fastbins
Aborted (core dumped)
Comment 1 Михаил 2023-05-13 22:28:31 UTC
Created attachment 861642 [details]
Build log
Comment 2 Михаил 2023-05-14 00:19:29 UTC
Telegram exits normally if patch tdesktop-4.2.4-jemalloc-only-telegram.patch not used.

Without patch:
$ ldd /usr/bin/telegram-desktop  | fgrep jem
        libjemalloc.so.2 => /usr/lib64/libjemalloc.so.2 (0x00007f02bf600000)


Gentoo ebuild:
$ ldd /usr/bin/telegram-desktop  | fgrep jem
$

Also telegram quit without crash if preloaded jemalloc.
Comment 3 Михаил 2023-05-14 00:35:05 UTC
Created attachment 861644 [details]
Build log without jemalloc cmake patch

Build logs files differ in parts:

1. Linking with jemalloc utilities codegen_style, codegen_emoji, codegen_lang
2. Linking with jemalloc application.

For my opinion patch should affect only first part and should not prevent linking telegram-desktop with jemalloc.
Comment 4 Esteve Varela Colominas 2023-05-14 11:31:30 UTC
Reproduced; jemalloc is indeed not linked when it should be.
I wonder if replacing INTERFACE with PRIVATE in the telegram target_link_libraries would work. I'll test more tomorrow.
Comment 5 Михаил 2023-05-16 16:34:20 UTC
Telegram linked with jemalloc with patch from https://github.com/gentoo/gentoo/pull/31044
Comment 6 Larry the Git Cow gentoo-dev 2023-05-16 17:07:41 UTC
The bug has been closed via the following commit(s):

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

commit ce4cbbe6125f6444606f3c3df4c82c93e17a8e64
Author:     Esteve Varela Colominas <esteve.varela@gmail.com>
AuthorDate: 2023-05-15 14:20:02 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-05-16 17:07:16 +0000

    net-im/telegram-desktop: Fix jemalloc linkage
    
    Updated patch allows for jemalloc to be linked properly
    
    Closes: https://bugs.gentoo.org/906302
    Thanks-to: Михаил <spike@lmu.name>
    Signed-off-by: Esteve Varela Colominas <esteve.varela@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/31044
    Signed-off-by: Sam James <sam@gentoo.org>

 .../tdesktop-4.2.4-jemalloc-only-telegram-r1.patch | 43 ++++++++++++++++++++++
 ...-r1.ebuild => telegram-desktop-4.6.5-r2.ebuild} |  2 +-
 ...-r1.ebuild => telegram-desktop-4.8.1-r2.ebuild} |  2 +-
 3 files changed, 45 insertions(+), 2 deletions(-)