Bug 255687

Summary: www/chromium crashes on Microsoft Teams
Product: Ports & Packages Reporter: Marek Zarychta <zarychtam>
Component: Individual Port(s)Assignee: freebsd-chromium (Nobody) <chromium>
Status: Closed FIXED    
Severity: Affects Only Me CC: freebsd, grahamperrin, rene
Priority: --- Keywords: crash, needs-qa
Version: LatestFlags: bugzilla: maintainer-feedback? (chromium)
zarychtam: maintainer-feedback?
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
Patch for h264 decoder allowing to watch shared screen under Microsoft Teams none

Description Marek Zarychta 2021-05-07 19:29:04 UTC
I have started to use www/chromium with Teams recently. It works fine until someone shares the screen with me then the tab almost immediately crashes. It can be also triggered by changing the video layout to "Large Galery" or "Together" mode during the conference. The crash message looks like below:
#
# Fatal error in: ../../third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc, line 80
# last system error: 35
# Check failed: context->lowres == 0 (223629728 vs. 0)

The overall user experience of using Microsoft Teams with native www/chromium is pleasant, there is no problems with voice conferencing and making presentations, sharing screen, etc. though during the normal operation I observe a lot of harmless warnings:

# [6783:111352:0507/211953.124614:ERROR:network.cc(436)] Too many network interfaces to handle!
[6783:111351:0507/212000.146449:ERROR:audio_rtp_receiver.cc(88)] AudioRtpReceiver::OnSetVolume: No audio channel exists.
[6783:111352:0507/212000.396613:ERROR:network.cc(436)] Too many network interfaces to handle!
[6783:111351:0507/212005.065772:ERROR:webrtc_video_engine.cc(3350)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[6783:111351:0507/212005.066033:ERROR:webrtc_video_engine.cc(3350)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[6783:111351:0507/212005.066348:ERROR:webrtc_video_engine.cc(3350)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[6783:111351:0507/212005.066546:ERROR:webrtc_video_engine.cc(3350)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[6783:111351:0507/212005.066960:ERROR:webrtc_video_engine.cc(3350)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[6783:111351:0507/212005.067270:ERROR:webrtc_video_engine.cc(3350)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
[6783:111351:0507/212005.067351:ERROR:webrtc_video_engine.cc(3350)] Absent receive stream; ignoring clearing encoded frame sink for ssrc 0
Comment 1 Marek Zarychta 2021-05-11 10:55:51 UTC
I don't know if it can be relevant or not but it looks like multimedia/ffmpeg is either culprit or at least involved. Below are the lines 80-84 of the file h264_decoder_impl.cc

// Called by FFmpeg when it is done with a frame buffer, see AVGetBuffer2.
void AVFreeBuffer2(void* opaque, uint8_t* data) {
  VideoFrame* video_frame = static_cast<VideoFrame*>(opaque);
  delete video_frame;
}
Comment 2 Matthias Wolf 2021-05-11 16:27:11 UTC
Duplicate of https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255484.

Added a fix for it to 90.0.4430.212.
Comment 3 Marek Zarychta 2021-05-11 18:39:26 UTC
(In reply to Matthias Wolf from comment #2)
Thanks for fixing this. I am waiting for the port and pkg update then.
Comment 4 Marek Zarychta 2021-05-12 04:07:44 UTC
I have built chromium-90.0.4430.212, but it seems to be still affected. When I change the layout during the conference to "Large Galery" or "Together" it still crashes with:

# Fatal error in: ../../third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc, line 80
# last system error: 35
# Check failed: context->lowres == 0 (223629728 vs. 0)

# pkg info -Af chromium
chromium-90.0.4430.212
Name           : chromium
Version        : 90.0.4430.212
Installed on   : Wed May 12 05:54:58 2021 CEST
Origin         : www/chromium
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : java www
Licenses       : BSD3CLAUSE, LGPL21, MPL11
Maintainer     : chromium@FreeBSD.org
WWW            : https://www.chromium.org/Home
Comment        : Google web browser based on WebKit
Options        :
	ALSA           : off
	CODECS         : on
	CUPS           : on
	DEBUG          : off
	DRIVER         : on
	HEIMDAL        : off
	HEIMDAL_BASE   : off
	KERBEROS       : on
	LTO            : off
	MIT            : off
	PULSEAUDIO     : off
	SNDIO          : on
	TEST           : off
Shared Libs required:
	libavutil.so.56
	libexpat.so.1
	libxslt.so.1
	libjpeg.so.8
	libopus.so.0
	libfreetype.so.6
	libFLAC.so.8
	libXtst.so.6
	libatk-1.0.so.0
	libdrm.so.2
	libcups.so.2
	libplc4.so
	libatspi.so.0
	libwebpmux.so.3
	libnss3.so
	libnssutil3.so
	libgbm.so.1
	libXrender.so.1
	libglib-2.0.so.0
	libharfbuzz.so.0
	libsndio.so.7.1
	libintl.so.8
	libXrandr.so.2
	libsnappy.so.1
	libavformat.so.58
	libsmime3.so
	libXi.so.6
	libgdk-3.so.0
	libpci.so.3
	libpangocairo-1.0.so.0
	libxshmfence.so.1
	libatk-bridge-2.0.so.0
	libXext.so.6
	libpango-1.0.so.0
	libcairo.so.2
	libgtk-3.so.0
	libxml2.so.2
	libwebp.so.7
	libcairo-gobject.so.2
	libxkbcommon.so.0
	libgmodule-2.0.so.0
	libXcomposite.so.1
	libxcb.so.1
	libopenh264.so.6
	libgio-2.0.so.0
	libgdk_pixbuf-2.0.so.0
	libXfixes.so.3
	libwebpdemux.so.2
	libnspr4.so
	libharfbuzz-subset.so.0
	libgobject-2.0.so.0
	libX11.so.6
	libplds4.so
	libavcodec.so.58
	libdbus-1.so.3
	libXdamage.so.1
	libGL.so.1
	libpng16.so.16
	libfontconfig.so.1
	libgthread-2.0.so.0
Shared Libs provided:
	libvk_swiftshader.so
	libEGL.so
	libGLESv2.so
	libVkICD_mock_icd.so
Annotations    :
	FreeBSD_version: 1300504
	cpe            : cpe:2.3:a:google:chrome:90.0.4430.212:::::freebsd13:x64
	deprecated     : Uses Python 2.7 which is EOLed upstream
	expiration_date: 2020-12-31
Flat size      : 299MiB
Description    :
Chromium is an open-source browser project that aims to build a safer,
faster, and more stable way for all users to experience the web.

The Chromium website contains design documents, architecture overviews,
testing information, and more to help you learn to build and work with
the Chromium source code.

WWW: https://www.chromium.org/Home
Comment 5 Marek Zarychta 2021-05-15 05:43:44 UTC
Created attachment 224958 [details]
Patch for h264 decoder allowing to watch shared screen under Microsoft Teams

(In reply to Matthias Wolf from comment #2)

I have this patch enhanced a bit to completely disabling the spurious check. It seems to work with Microsoft Teams. With this patch applied I am able to watch the screen if someone shares it during the conference. Also "Large Galery" and "Together" modes during the conference can be applied (it wasn't fully tested with attendees). In the situations described above Microsoft Teams without this patch was always crashing.
Comment 6 Marek Zarychta 2021-05-15 06:29:37 UTC

*** This bug has been marked as a duplicate of bug 255484 ***
Comment 7 Marek Zarychta 2021-05-15 06:30:49 UTC
Probably duplicate