Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 754012 - net-im/telegram-desktop with webrtc use flag crashes when making audio calls
Summary: net-im/telegram-desktop with webrtc use flag crashes when making audio calls
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Esteve Varela Colominas
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-11-11 11:18 UTC by Kete Tefid
Modified: 2022-12-08 13:52 UTC (History)
4 users (show)

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


Attachments
valgrind detect invalid memory writes (tgmemcheck.txt,13.15 KB, text/plain)
2020-11-12 19:45 UTC, Михаил
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kete Tefid 2020-11-11 11:18:43 UTC
Unless telegram-desktop is compiled with -webrtc, it will not be able to connect to an audio call. The crash info:

Type conversion already registered from type QList<QSslError> to type QtMetaTypePrivate::QSequentialIterableImpl
Type conversion already registered from type QList<QSslError> to type QtMetaTypePrivate::QSequentialIterableImpl
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
D/tgvoip: === Updating voip config ===
D/tgvoip: {"enable_vp8_encoder":true,"enable_vp8_decoder":true,"enable_vp9_encoder":true,"enable_vp9_decoder":true,"enable_h265_encoder":true,"enable_h265_decoder":true,"enable_h264_encoder":true,"enable_h264_decoder":true,"audio_frame_size":60,"jitter_min_delay_60":2,"jitter_max_delay_60":10,"jitter_max_slots_60":20,"jitter_losses_to_reset":20,"jitter_resync_threshold":0.5,"audio_congestion_window":1024,"audio_max_bitrate":20000,"audio_max_bitrate_edge":16000,"audio_max_bitrate_gprs":8000,"audio_max_bitrate_saving":8000,"audio_init_bitrate":16000,"audio_init_bitrate_edge":8000,"audio_init_bitrate_gprs":8000,"audio_init_bitrate_saving":8000,"audio_bitrate_step_incr":1000,"audio_bitrate_step_decr":1000,"use_system_ns":true,"use_system_aec":true,"force_tcp":false,"jitter_initial_delay_60":2,"adsp_good_impls":"(Qualcomm Fluence)","bad_call_rating":true,"use_ios_vpio_agc":false,"use_tcp":false,"audio_medium_fec_bitrate":20000,"audio_medium_fec_multiplier":0.1,"audio_strong_fec_bitrate":7000}
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
telegram-desktop: malloc.c:2394: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Aborted


[ebuild   R   ~] net-im/telegram-desktop-2.4.9::gentoo  USE="X dbus gtk hunspell pulseaudio spell -enchant -libressl -lto -webrtc" 0 KiB

The same problem happens with the current stable version i.e. 2.4.7-r1

Reproducible: Always
Comment 1 Georgy Yakovlev archtester gentoo-dev 2020-11-12 00:48:05 UTC
https://github.com/desktop-app/tg_owt/issues/30

user sees similar failure.
Comment 2 Михаил 2020-11-12 19:27:57 UTC
Backtrace with debuginfo

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#1  0x00007fd44955e536 in __GI_abort () at abort.c:79
#2  0x00007fd4495b5f00 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7fd4496bfb9b "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#3  0x00007fd4495bd8ca in malloc_printerr (str=str@entry=0x7fd4496c2440 "malloc(): invalid size (unsorted)") at malloc.c:5389
#4  0x00007fd4495c0ae4 in _int_malloc (av=av@entry=0x7fd3d0000020, bytes=bytes@entry=112) at malloc.c:3764
#5  0x00007fd4495c2369 in __GI___libc_malloc (bytes=112) at malloc.c:3086
#6  0x00007fd443f03df5 in operator new(unsigned long) () at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libstdc++.so.6
#7  0x00005597e50a7e36 in __gnu_cxx::new_allocator<std::_Rb_tree_node<rtc::SocketAddress> >::allocate(unsigned long, void const*) (__n=1, this=<optimized out>)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/g++-v9/ext/new_allocator.h:102
#8  std::allocator_traits<std::allocator<std::_Rb_tree_node<rtc::SocketAddress> > >::allocate(std::allocator<std::_Rb_tree_node<rtc::SocketAddress> >&, unsigned long) (__n=1, __a=...)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/g++-v9/bits/alloc_traits.h:444
#9  std::_Rb_tree<rtc::SocketAddress, rtc::SocketAddress, std::_Identity<rtc::SocketAddress>, std::less<rtc::SocketAddress>, std::allocator<rtc::SocketAddress> >::_M_get_node() (this=<optimized out>)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/g++-v9/bits/stl_tree.h:580
#10 std::_Rb_tree<rtc::SocketAddress, rtc::SocketAddress, std::_Identity<rtc::SocketAddress>, std::less<rtc::SocketAddress>, std::allocator<rtc::SocketAddress> >::_M_create_node<rtc::SocketAddress const&>(rtc::SocketAddress const&)
    (this=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/g++-v9/bits/stl_tree.h:630
#11 std::_Rb_tree<rtc::SocketAddress, rtc::SocketAddress, std::_Identity<rtc::SocketAddress>, std::less<rtc::SocketAddress>, std::allocator<rtc::SocketAddress> >::_Alloc_node::operator()<rtc::SocketAddress const&>(rtc::SocketAddress const&) const (__arg=..., this=0x7fd3b4bba3a0) at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/g++-v9/bits/stl_tree.h:548
#12 std::_Rb_tree<rtc::SocketAddress, rtc::SocketAddress, std::_Identity<rtc::SocketAddress>, std::less<rtc::SocketAddress>, std::allocator<rtc::SocketAddress> >::_M_insert_<rtc::SocketAddress const&, std::_Rb_tree<rtc::SocketAddress, rtc::SocketAddress, std::_Identity<rtc::SocketAddress>, std::less<rtc::SocketAddress>, std::allocator<rtc::SocketAddress> >::_Alloc_node>(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, rtc::SocketAddress const&, std::_Rb_tree<rtc::SocketAddress, rtc::SocketAddress, std::_Identity<rtc::SocketAddress>, std::less<rtc::SocketAddress>, std::allocator<rtc::SocketAddress> >::_Alloc_node&)
    (this=this@entry=0x7fd3b4bba440, __x=<optimized out>, __p=0x7fd3cc002700, __v=..., __node_gen=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/g++-v9/bits/stl_tree.h:1810
#13 0x00005597e50a7f81 in std::_Rb_tree<rtc::SocketAddress, rtc::SocketAddress, std::_Identity<rtc::SocketAddress>, std::less<rtc::SocketAddress>, std::allocator<rtc::SocketAddress> >::_M_insert_unique<rtc::SocketAddress const&>(rtc::SocketAddress const&) (this=this@entry=0x7fd3b4bba440, __v=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/g++-v9/bits/stl_tree.h:538
#14 0x00005597e50a8db5 in std::set<rtc::SocketAddress, std::less<rtc::SocketAddress>, std::allocator<rtc::SocketAddress> >::insert(rtc::SocketAddress const&) (__x=..., this=0x7fd3b4bba440)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/g++-v9/bits/stl_set.h:509
#15 tgcalls::NetworkManager::start() (this=0x7fd3d0004f60) at /var/tmp/portage/net-im/telegram-desktop-2.4.7/work/tdesktop-2.4.7-full/Telegram/ThirdParty/tgcalls/tgcalls/NetworkManager.cpp:119
#16 0x00005597e50a94ce in tgcalls::Manager::<lambda(tgcalls::NetworkManager*)>::operator() (networkManager=<optimized out>, __closure=<optimized out>)
    at /var/tmp/portage/net-im/telegram-desktop-2.4.7/work/tdesktop-2.4.7-full/Telegram/ThirdParty/tgcalls/tgcalls/Manager.cpp:265
#17 tgcalls::ThreadLocalObject<tgcalls::NetworkManager>::<lambda()>::operator() (this=<optimized out>) at /var/tmp/portage/net-im/telegram-desktop-2.4.7/work/tdesktop-2.4.7-full/Telegram/ThirdParty/tgcalls/tgcalls/ThreadLocalObject.h:37
#18 rtc::rtc_thread_internal::MessageWithFunctor<tgcalls::ThreadLocalObject<T>::perform(const rtc::Location&, FunctorT&&) [with FunctorT = tgcalls::Manager::start()::<lambda(tgcalls::NetworkManager*)>; T = tgcalls::NetworkManager]::<lambda()> >::Run(void) (this=<optimized out>) at /usr/include/tg_owt/rtc_base/thread.h:62
#19 0x00007fd447054da4 in rtc::(anonymous namespace)::MessageHandlerWithTask::OnMessage(rtc::Message*) (this=<optimized out>, msg=0x7fd3b4bba740)
    at /var/tmp/portage/media-libs/tg_owt-0_pre20201105/work/tg_owt-12f4a27f2f02f9dd40f9891d8ec6e58bc1ff5263/src/rtc_base/thread.cc:78
#20 0x00007fd447055380 in rtc::Thread::Dispatch(rtc::Message*) (this=<optimized out>, pmsg=0x7fd3b4bba740)
    at /var/tmp/portage/media-libs/tg_owt-0_pre20201105/work/tg_owt-12f4a27f2f02f9dd40f9891d8ec6e58bc1ff5263/src/rtc_base/thread.cc:664
#21 0x00007fd447055bb8 in rtc::Thread::ProcessMessages(int) (this=0x7fd3cc005dd0, cmsLoop=cmsLoop@entry=-1)
    at /var/tmp/portage/media-libs/tg_owt-0_pre20201105/work/tg_owt-12f4a27f2f02f9dd40f9891d8ec6e58bc1ff5263/src/rtc_base/thread.cc:1000
#22 0x00007fd447055c48 in rtc::Thread::Run() (this=<optimized out>) at /var/tmp/portage/media-libs/tg_owt-0_pre20201105/work/tg_owt-12f4a27f2f02f9dd40f9891d8ec6e58bc1ff5263/src/rtc_base/thread.cc:842
#23 0x00007fd447057597 in rtc::Thread::PreRun(void*) (pv=0x7fd3cc005dd0) at /var/tmp/portage/media-libs/tg_owt-0_pre20201105/work/tg_owt-12f4a27f2f02f9dd40f9891d8ec6e58bc1ff5263/src/rtc_base/thread.cc:831
#24 0x00007fd4492c2ede in start_thread (arg=0x7fd3b4bbb640) at pthread_create.c:463
#25 0x00007fd44963510f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Comment 3 Михаил 2020-11-12 19:45:17 UTC
Created attachment 671134 [details]
valgrind detect invalid memory writes

Previous backtrace is useless because memory heap corrupted before fail.
Comment 4 Perfect Gentleman 2020-11-20 17:12:50 UTC
the same here
Comment 5 Perfect Gentleman 2020-11-20 17:17:19 UTC
the same with USE=webrtc
Comment 6 segmentation fault 2020-11-24 20:04:05 UTC
Opened a bug upstream here:

https://github.com/telegramdesktop/tdesktop/issues/9803

I guess it's the same bug, present still in the current 2.4.11 version.
Comment 7 segmentation fault 2020-11-25 06:41:51 UTC
(In reply to segmentation fault from comment #6)
> Opened a bug upstream here:
> 
> https://github.com/telegramdesktop/tdesktop/issues/9803
> 
> I guess it's the same bug, present still in the current 2.4.11 version.

Well, the answer I got from there is that "tg_owt package is broken in gentoo and doesn't work at all" and that they "suggest to use official binary". This practically sends the ball back to Gentoo and its WebRTC package tg_owt (https://packages.gentoo.org/packages/media-libs/tg_owt).
Comment 8 Esteve Varela Colominas 2020-11-27 15:18:02 UTC
I was assuming this to be a GentooLTO issue, but I guess I'll chime in with reproducing this on 2.4.7.
I wanted to follow up with a question, however. If WebRTC is disabled, can calls be made? If so, are there any disadvantages to this?
Comment 9 Georgy Yakovlev archtester gentoo-dev 2020-11-27 20:27:21 UTC
i talked with upstream, apparently fedora's telegram rpmfusion package also has same problem ( and they also use separate dynamic tg_owt build like we do)

investigation in progress.
Comment 10 Esteve Varela Colominas 2021-03-25 17:06:29 UTC
Turns out upstream builds with -DCMAKE_BUILD_TYPE=Release, which implicitly enables -DNDEBUG. Doing this in the ebuild as well fixes this, as far as I can tell.
Comment 11 Larry the Git Cow gentoo-dev 2021-03-25 19:31:31 UTC
The bug has been closed via the following commit(s):

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

commit 2bf7ec990e647dd5d6ba0599a8cda3a5289a2c20
Author:     Esteve Varela Colominas <esteve.varela@gmail.com>
AuthorDate: 2021-03-25 17:28:33 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-03-25 19:28:36 +0000

    media-libs/tg_owt: Take maintainership, bump to 0_pre20210309
    
    Closes: https://bugs.gentoo.org/754012
    Signed-off-by: Esteve Varela Colominas <esteve.varela@gmail.com>
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 media-libs/tg_owt/Manifest                    |  3 ++
 media-libs/tg_owt/metadata.xml                |  9 +++-
 media-libs/tg_owt/tg_owt-0_pre20210309.ebuild | 76 +++++++++++++++++++++++++++
 3 files changed, 87 insertions(+), 1 deletion(-)
Comment 12 Georgy Yakovlev archtester gentoo-dev 2021-04-23 19:38:31 UTC
idk why I reopened this bug, maybe while re-assigning.
it's fixed, closing.