Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 729064 - net-im/teams-version? with media-video/ffmpeg-4.3 - segmentation fault in SGI_video_sync
Summary: net-im/teams-version? with media-video/ffmpeg-4.3 - segmentation fault in SGI...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Andreas K. Hüttel
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-21 21:27 UTC by James Beddek
Modified: 2020-10-09 18:40 UTC (History)
13 users (show)

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


Attachments
emerge --info (emerge,7.23 KB, text/plain)
2020-06-21 21:27 UTC, James Beddek
Details
teams-use-builtin-ffmpeg-by-default.patch (teams-use-builtin-ffmpeg-by-default.patch,807 bytes, patch)
2020-07-09 04:20 UTC, Denis Dupeyron (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Beddek 2020-06-21 21:27:36 UTC
Created attachment 645576 [details]
emerge --info

Hello,

default/linux/amd64/17.1/systemd

Using latest ~amd64 as of posting with GentooLTO. 
After signing in (which works perfectly) Teams crashes with a white screen and proceeds to restart itself where it enters a crash loop unless the process is killed. Using nvidia vulkan drivers, 440.66.15

dmesg is filled with errors such as:

[   64.643204] SGI_video_sync[3648]: segfault at e6 ip 000055712398af92 sp 00007f0f025faa80 error 6 in teams[557120ea7000+4bf6000]
[   64.643208] Code: e8 43 00 00 00 4c 89 f7 e8 db 01 00 00 41 8b 46 10 41 8b 4e 18 c1 e0 0c 25 00 f0 0f 00 c1 e1 14 81 e1 00 00 f0 0f 09 c1 09 d9 <c6> 01 00 81 e3 ff 0f 00 00 c6 03 00 bf 01 00 00 00 e8 38 d0 10 02
[   67.151260] Media[3665]: segfault at 90 ip 0000559ea60584d2 sp 00007fc70bffe5a0 error 6 in teams[559ea5bb6000+4bf6000]
[   67.151264] Code: f1 e8 42 de 74 04 48 8b 7b 10 48 89 43 10 48 85 ff 74 05 e8 40 de 74 04 49 8b 06 4c 89 f7 ff 50 20 34 01 0f b6 c0 48 8b 4b 10 <89> 81 90 00 00 00 48 8b 43 10 c7 40 54 00 00 00 00 48 8b 43 08 81

Teams does not produce any terminal output indicating the issue. Reinstallation nor cleaing cache/config changes the outcome. emerge --info attached

Thanks
Comment 1 Paolo Pedroni 2020-06-22 07:26:57 UTC
It does the same thing for me as well since Friday 19th, but I'm on xf86-video-ati.

I don't get the SGI_video_sync message, but I do get all other symptoms you show.

In dmesg:
[2213283.040665] Media[4177256]: segfault at 90 ip 000055fd59d5e4d2 sp 00007f5269ffa4e0 error 6 in teams[55fd598bc000+4bf6000]
[2213283.040677] Code: f1 e8 42 de 74 04 48 8b 7b 10 48 89 43 10 48 85 ff 74 05 e8 40 de 74 04 49 8b 06 4c 89 f7 ff 50 20 34 01 0f b6 c0 48 8b 4b 10 <89> 81 90 00 00 00 48 8b 43 10 c7 40 54 00 00 00 00 48 8b 43 08 81

Could it be mesa-20.1?
Comment 2 Paolo Pedroni 2020-06-22 07:28:11 UTC
(In reply to Paolo Pedroni from comment #1)
> Could it be mesa-20.1?

Scratch that, I got mesa 20.1 ten days ago, but teams started misbehaving only last friday...
Comment 3 Massimo Burcheri 2020-06-22 12:21:45 UTC
I have the similar crash and restarting behaviour:

Jun 22 13:35:07 [kernel] Media[7410]: segfault at 90 ip 0000560d4af124d2 sp 00007fa02f7fd620 error 6 in teams[560d4aa70000+4bf6000]
Jun 22 13:35:07 [kernel] Code: f1 e8 42 de 74 04 48 8b 7b 10 48 89 43 10 48 85 ff 74 05 e8 40 de 74 04 49 8b 06 4c 89 f7 ff 50 20 34 01 0f b6 c0 48 8b 4b 10 <89> 81 90 00 00 00 48 8b 43 10 c7 40 54 00 00 00 00 48 8b 43 08 81
Jun 22 13:35:07 [kernel] [drm] Reducing the compressed framebuffer size. This may lead to less power savings than a non-reduced-size. Try to increase stolen memory size if available in BIOS.
                - Last output repeated 105 times -
Jun 22 13:35:15 [kernel] Media[7501]: segfault at 90 ip 0000560d4af124d2 sp 00007fa016613620 error 6 in teams[560d4aa70000+4bf6000]
Jun 22 13:35:15 [kernel] Code: f1 e8 42 de 74 04 48 8b 7b 10 48 89 43 10 48 85 ff 74 05 e8 40 de 74 04 49 8b 06 4c 89 f7 ff 50 20 34 01 0f b6 c0 48 8b 4b 10 <89> 81 90 00 00 00 48 8b 43 10 c7 40 54 00 00 00 00 48 8b 43 08 81
Jun 22 13:35:15 [kernel] [drm] Reducing the compressed framebuffer size. This may lead to less power savings than a non-reduced-size. Try to increase stolen memory size if available in BIOS.

I have Intel graphics with
VIDEO_CARDS="intel i965"
and no x11-drivers/xf86-video-* installed at all.
Comment 4 Massimo Burcheri 2020-06-22 12:32:29 UTC
After downgrading to media-video/ffmpeg-4.2.3, teams works again.
Comment 5 Paolo Pedroni 2020-06-22 12:33:56 UTC
I think the culprit is media-video/ffmpeg-4.3

I rolled back to 4.2.3 and teams started working again.
Comment 6 James Beddek 2020-06-22 20:58:30 UTC
Rolling back ffmpeg works for me too. Thanks for the suggestion
Comment 7 Massimo Burcheri 2020-06-23 06:53:23 UTC
Lacking an upstream $MS bugtracker and because they just have a teams user forum, I forwarded the information within the application (Feedback) to $MS.
Comment 8 Larry the Git Cow gentoo-dev 2020-07-07 22:29:03 UTC
The bug has been referenced in the following commit(s):

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

commit 5dd9ab52af7b2014a5386136b29fdf92f6093865
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2020-07-07 22:28:26 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-07-07 22:28:45 +0000

    net-im/teams: bump to v1.3.00.16851
    
    Bug: https://bugs.gentoo.org/729064
    Closes: https://bugs.gentoo.org/730266
    Package-Manager: Portage-2.3.103, Repoman-2.3.23
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 net-im/teams/Manifest                  |  1 +
 net-im/teams/teams-1.3.00.16851.ebuild | 96 ++++++++++++++++++++++++++++++++++
 2 files changed, 97 insertions(+)
Comment 9 Denis Dupeyron (RETIRED) gentoo-dev 2020-07-09 04:20:26 UTC
Created attachment 648462 [details, diff]
teams-use-builtin-ffmpeg-by-default.patch

This is a patch I use in my overlay which makes the ebuild use the built-in ffmpeg by default and fixes this issue. Note that this is tested with the latest version of teams (1.3.00.16851), but should work with the old version currently in the tree.
Comment 10 Ulrich Müller gentoo-dev 2020-07-10 09:43:48 UTC
Has this been reported upstream?
Comment 11 Stephan Hartmann (RETIRED) gentoo-dev 2020-07-10 10:19:07 UTC
(In reply to Ulrich Müller from comment #10)
> Has this been reported upstream?

There is no upstream bug tracker. Teams comes with a bundled libffmpeg.so and the problem here only arises because Gentoo unbundles it. I'm not a lawyer, but I think unbundling here is also questionable because some codecs require a license, e.g. H.264.
Comment 12 Ulrich Müller gentoo-dev 2020-07-10 11:14:50 UTC
(In reply to stha09 from comment #11)
> There is no upstream bug tracker.

Certainly Microsoft must have some sort of a ticket system?

> Teams comes with a bundled libffmpeg.so and the problem here only arises
> because Gentoo unbundles it.

I see four open security bugs for ffmpeg in Gentoo Bugzilla, and a good guess is that the bundled lib is affected by all of them (unless proven otherwise, feel free to look into the source code). So IMHO installing it isn't an option.
Comment 13 Joakim Tjernlund 2020-07-20 10:58:18 UTC
There is a media-video/ffmpeg-4.3.1 now(not in tree yet)
Anyone tested if that one works?
Comment 14 Stephan Hartmann (RETIRED) gentoo-dev 2020-07-20 11:06:29 UTC
(In reply to Joakim Tjernlund from comment #13)
> There is a media-video/ffmpeg-4.3.1 now(not in tree yet)
> Anyone tested if that one works?

Most likely it doesn't work too, because ffmpeg-4.3 support is scheduled for Chrome/Chromium-86 atm.
Comment 15 Sergey Ilinykh 2020-07-28 17:12:46 UTC
@Denis_Dupeyron, how can I add your overlay via layman?
Comment 16 deim 2020-09-16 08:38:16 UTC
patch doesn't work for me - teams-1.3.00.16851 application works but no video input - web version works OK.
Comment 17 Sven Eden 2020-09-17 06:23:05 UTC
Both unbundling ffmpeg and/or the bundled mesa EGL/GLES libs can crash ms-teams. (Well, currently they absolutely will!)

We have experimented with this in my overlay "seden" via layman and have put our experience into app-office/teams and app-office/teams-insiders. The ebuilds allow to use system-ffmpeg and system-mesa, but both flags have a hint in metadata.xml that activating them might crash the app.

I am using ms teams 1.3.00.16851 on a daily basis since june, 25th without any issues with both flags disabled.
Comment 18 Joakim Tjernlund 2020-09-17 07:30:08 UTC
(In reply to Sven Eden from comment #17)
> Both unbundling ffmpeg and/or the bundled mesa EGL/GLES libs can crash
> ms-teams. (Well, currently they absolutely will!)

Still using using system mesa and works for me but I am using mesa-20.0.x
Which mesa versions crash teams for you?
Comment 19 Sven Eden 2020-09-17 16:05:42 UTC
(In reply to Joakim Tjernlund from comment #18)
> (In reply to Sven Eden from comment #17)
> > Both unbundling ffmpeg and/or the bundled mesa EGL/GLES libs can crash
> > ms-teams. (Well, currently they absolutely will!)
> 
> Still using using system mesa and works for me but I am using mesa-20.0.x
> Which mesa versions crash teams for you?

mesa-20.1.7 (I always mask RCs)

However, the current teams version is from june, and a new one should be out soon. Hopefully it will be compatible to newer ffmpeg and mesa.
Comment 20 Stephan Hartmann (RETIRED) gentoo-dev 2020-10-01 15:56:23 UTC
@dilfridge

chromium-86 goes stable beginning of next week (99.9% sure it is security relevant) which requires >=media-video/ffmpeg-4.3. Can you please use bundled libffmpeg.so here until new version of net-im/teams is available that works with >=media-video/ffmpeg.4.3?
Comment 21 Sven Eden 2020-10-02 07:47:59 UTC
I have had good experience with my own ebuild
  app-office/teams-insiders-1.3.00.25560::seden
which works rock solid using media-libs/mesa-20.1.8 and media-video/ffmpeg-4.2.4.

However, this newest version of MS Teams still does not work with >=media-video/ffmpeg-4.3, that was the first thing I tested, so this new ebuild blocks newer ffmpeg.

Maybe it would be an idea to put in USE flags for system-ffmpeg and system-mesa like we did, so users can decide for themselves whether to unbundle ffmpeg and/or mesa upon their own discretion.

If you must have >=media-video/ffmpeg-4.3 as a dependency for something else, then unbundling it in MS Teams is not the way to go. Make it optional and everything will be fine.
Comment 22 Geoff Leach 2020-10-07 12:01:53 UTC
re comment #21

I found same, using your ebuild, neither system-ffmpeg or system-mesa worked, separately or together, disabling both was necessary.

BTW, without digressing the bug, is Teams actually open source, i.e. can it be built from what MS makes available? I've looked and seems not, but would like if someone can confirm. If possible to build maybe system-ffmpeg can be gotten to work.
Comment 23 Stephan Hartmann (RETIRED) gentoo-dev 2020-10-07 13:00:59 UTC
(In reply to Geoff Leach from comment #22)
> re comment #21
> 
> I found same, using your ebuild, neither system-ffmpeg or system-mesa
> worked, separately or together, disabling both was necessary.
> 
> BTW, without digressing the bug, is Teams actually open source, i.e. can it
> be built from what MS makes available? I've looked and seems not, but would
> like if someone can confirm. If possible to build maybe system-ffmpeg can be
> gotten to work.

Teams is not open source, but you can built libffmpeg.so from Chromium tarballs, because Teams is just a Chrome/Chromium webapp.
Comment 24 Joakim Tjernlund 2020-10-07 17:32:24 UTC
This little ffmpeg-4.3.1 patch makes Teams work for me:

--- ./libavutil/mem.c.org	2020-10-07 19:22:30.286728200 +0200
+++ ./libavutil/mem.c	2020-10-07 19:24:04.039885660 +0200
@@ -71,6 +71,8 @@
 static size_t max_alloc_size= INT_MAX;
 
 void av_max_alloc(size_t max){
+    if (!max)
+        max = INT_MAX; /* be compatible to older < 4.3 versions */
     max_alloc_size = max;
 }


ffmpeg changed av_max_alloc(0) to actually mean 0
Comment 25 Geoff Leach 2020-10-08 07:25:42 UTC
re comment 24

that patch for mem.c works for me too, teams 1.3.00.25560, ffmpeg-4.3.1, using seven's ebuild, but with ffmpeg  version constraint 

BDEPEND="
	system-ffmpeg? ( media-video/ffmpeg[chromium] )
	system-mesa? ( media-libs/mesa[egl,gles2] )
"


app-office/teams-insiders-1.3.00.25560::gl  USE="system-ffmpeg -system-mesa

(haven't tried system-mesa)
Comment 26 Paolo Pedroni 2020-10-08 10:40:01 UTC
The patch works for me as well with "stock" net-im/teams-1.3.00.16851-r2 from portage, using 'emerge --nodeps ffmpeg'.

Can we add it to ffmpeg-4.3.1 and drop the blocker in net-im/teams?
Comment 27 Geoff Leach 2020-10-09 10:26:38 UTC
Also tested teams 1.3.00.25560 using essentially sven's ebuild but with ffmpeg and mesa version checks removed, and with the ffmpeg fix. Long call with multiple participants, although mostly audio, but with outgoing video. system-mesa (20.2) and system-ffmpeg (4.3.1). 

Teams still consumes my machine though, even with this latest version. Even when there's no video! More than zoom or duo. Secondary issue.
Comment 28 Joakim Tjernlund 2020-10-09 10:40:54 UTC
Bug to include this patch in ffmpeg:
https://bugs.gentoo.org/747337
Comment 29 Larry the Git Cow gentoo-dev 2020-10-09 18:40:55 UTC
The bug has been closed via the following commit(s):

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

commit 50423e6b368afd6810517933807f693275c4fde6
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2020-10-09 18:40:42 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2020-10-09 18:40:42 +0000

    net-im/teams: Version bump
    
    * let's try again without gnome-keyring
    * remove keytar3 entirely
    * add useflags system-ffmpeg, system-mesa
    
    Closes: https://bugs.gentoo.org/729064
    Closes: https://bugs.gentoo.org/747190
    Closes: https://bugs.gentoo.org/743793
    Package-Manager: Portage-3.0.4, Repoman-3.0.1
    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

 net-im/teams/Manifest                  |   1 +
 net-im/teams/metadata.xml              |   4 ++
 net-im/teams/teams-1.3.00.25560.ebuild | 101 +++++++++++++++++++++++++++++++++
 3 files changed, 106 insertions(+)