Bug 267461 - net-im/tg_owt telegram-desktop crash when I try to share screen
Summary: net-im/tg_owt telegram-desktop crash when I try to share screen
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Sergey A. Osokin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-31 12:02 UTC by Ivan
Modified: 2024-12-02 15:30 UTC (History)
4 users (show)

See Also:


Attachments
debug logs (232.57 KB, application/gzip)
2022-11-06 08:49 UTC, Ivan
no flags Details
Fixes screen sharing crashes in telegram (508 bytes, patch)
2024-11-28 16:38 UTC, Kirill B
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan 2022-10-31 12:02:59 UTC
I tried to participate in meeting in telegram and while I can use mic or see shared screen, I can share screen myself.

Immediately after choose what to share, telegram-desktop crashes with 

# Fatal error in: /wrkdirs/usr/ports/net-im/tg_owt/work/tg_owt-621f3da/src/media/engine/webrtc_voice_engine.cc, line 365
# last system error: 0
# Check failed: adm()
# Abort

https://github.com/desktop-app/tg_owt/blob/master/src/media/engine/webrtc_voice_engine.cc#L365

Probably, adm() is not valid for some reason

Can anybody confirm the issue?
Thanks
Comment 1 Ivan 2022-10-31 12:03:42 UTC
I forgot to mention, that I use xOrg.
Comment 2 Sergey A. Osokin freebsd_committer freebsd_triage 2022-11-01 03:07:33 UTC
Hi,

thanks for the report.


Is there any a chance to build net-im/telegram-desktop and net-im/tg_owt with the debug symbols and reproduce the issue.

Thank you.
Comment 3 Ivan 2022-11-06 08:49:18 UTC
Created attachment 237883 [details]
debug logs
Comment 4 Ivan 2022-11-06 08:53:16 UTC
Hello,
it took for a while, sorry. telegram-desktop is a beast to compile.
I've copied debug directory from Telegram profile, I hope this helps. It is strange that virtually all other functions work. adm() looks like basic object for audio/video communication, but unless I try to share my screen everything else looks good.
Comment 5 Sergey A. Osokin freebsd_committer freebsd_triage 2023-05-17 16:32:08 UTC
(In reply to Ivan from comment #4)
Hi Ivan,

there were few update of net-im/tg_owt and net-im/telegram-desktop ports.
Is it still an issue?

Thank you.
Comment 6 Ivan 2023-05-20 08:31:53 UTC
Hello, I'm running the ~2 weeks old ports tree snapshot and the problem still here. Can you confirm the issue if you use telegram? It's very easy to trigger.
Thanks.
Comment 7 Sergey A. Osokin freebsd_committer freebsd_triage 2023-05-22 19:02:48 UTC
Is ther(In reply to Ivan from comment #6)

Hi Ivan,

would you mind to provide a step by step explanation how to reproduce the bug.
As I mentioned earlier it's probably better to raise an issue for the tdesktop project on GH.
Comment 8 Ivan 2023-05-22 19:32:28 UTC
1. Create a new group chat
2. Start videochat (no other participants required)
3. Share screen or window in the videochat.

Telegram crashes for me immediately.
Comment 9 Li-Wen Hsu freebsd_committer freebsd_triage 2023-09-29 17:19:18 UTC
(In reply to Ivan from comment #8)
Hello, can you check again with the latest versions just updated yesterday?
Comment 10 Ivan 2023-10-24 18:50:24 UTC
(In reply to Li-Wen Hsu from comment #9)
Hello, I've built current ports today and it's still crashing. Strange that we have no confirmation nor contradiction assuming how easy is to replicate the issue.
Comment 11 Sergey A. Osokin freebsd_committer freebsd_triage 2024-06-10 15:49:14 UTC
Hi Ivan,

could you provide details: does the issue related to Qt5 or Qt6 version of telegram desktop?

I can confirm the issue is reproducible on Qt6 on my side.

I also tried to build debug version of the net-im/telegram-desktop, including debug version of the net-im/tg_owt, however linking of the first one has failed, https://people.freebsd.org/~osa/telegram-desktop-qt6-5.1.5.log

Figuring out what's going there.
Comment 12 Ivan 2024-06-10 16:58:06 UTC
Hello,
thanks for confirmation. I've feared this is something on my side, because discussion was very quiet here. 

I have QT5 version, but I'm planing to upgrade to 14.1 on this weekend and will recompile everything I use in poudreire. Do I need to set some knobs?

I think it's tg related issue, I remember I've used screen sharing long time ago. Maybe 3 years ago.
Comment 13 Kirill B 2024-11-28 16:38:33 UTC
Created attachment 255507 [details]
Fixes screen sharing crashes in telegram

Patch for net-im/tg_owt

Fixes screen sharing crash issue of net-im/telegram-desktop
Comment 14 Ivan 2024-11-30 09:59:36 UTC
(In reply to Kirill B from comment #13)
Amazing discovery! It works flawlessly now.
Comment 15 commit-hook freebsd_committer freebsd_triage 2024-12-02 15:05:54 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=683f6abb3eef6268f3070ab7e7e6a48d03bbe959

commit 683f6abb3eef6268f3070ab7e7e6a48d03bbe959
Author:     Sergey A. Osokin <osa@FreeBSD.org>
AuthorDate: 2024-12-02 15:02:14 +0000
Commit:     Sergey A. Osokin <osa@FreeBSD.org>
CommitDate: 2024-12-02 15:03:52 +0000

    net-im/tg_owt: fix screen sharing crash issue

    While I'm here regenerate another patch.

    Bump PORTREVISION.

    PR:     267461

 net-im/tg_owt/Makefile                                        |  1 +
 ...tch-src_modules_audio__device_audio__device__impl.cc (new) | 11 +++++++++++
 net-im/tg_owt/files/patch-src_rtc__base_openssl__adapter.cc   |  4 ++--
 3 files changed, 14 insertions(+), 2 deletions(-)
Comment 16 Sergey A. Osokin freebsd_committer freebsd_triage 2024-12-02 15:30:36 UTC
Committed, thanks!