Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 773919

Summary: dev-qt/qtwebengine-5.15.2_p20210224: ERROR:network_service_instance_impl.cc(286)] Network service crashed, restarting service.
Product: Gentoo Linux Reporter: 12101111 <w12101111>
Component: Current packagesAssignee: Qt Bug Alias <qt>
Status: RESOLVED FIXED    
Severity: normal CC: cafaia, gentoo.org, jstein, stkabugs
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://bugreports.qt.io/browse/QTBUG-91715
See Also: https://bugs.archlinux.org/task/69902
https://bugs.gentoo.org/show_bug.cgi?id=773040
Whiteboard: fix: ensure timestamp of gentoo >=2021-03-12 20:45; emerge -1q dev-qt/qtwebengine
Package list:
Runtime testing required: ---
Attachments: emerge --info from musl system
emerge --info from glibc system
build.log from glibc system

Description 12101111 2021-03-02 07:23:30 UTC
I have try to build dev-qt/qtwebengine-5.15.2_p20210224/_p20210205 on my musl system and glibc system, both use clang/llvm toolchain and libc++, and both have this issue.


Reproducible: Always

Steps to Reproduce:
1.emerge =dev-qt/qtwebengine-5.15.2_p20210224
2.run zeal/notepadqq or other program need qtwebengine, e.g.

#include <QApplication>
#include <QWebEngineView>
#include <singleapplication.h>

int main(int argc, char **argv)
{
    QApplication app(argc, argv);
    QWebEngineView view;
    view.load(QUrl("https://www.whatsmyua.info/"));
    view.show();

    return app.exec();
}

3. print error: [xxxx:xxxx:xxxx/xxxxxx.xxxxxx:ERROR:network_service_instance_impl.cc(286)] Network service crashed, restarting service.
4. The webview is blank
Actual Results:  
All program using qtwebengine don't work and print this error forever:

...
[8554:8554:0302/112541.341487:ERROR:network_service_instance_impl.cc(286)] Network service crashed, restarting service.
[8554:8554:0302/112541.348989:ERROR:network_service_instance_impl.cc(286)] Network service crashed, restarting service.
[8554:8554:0302/112541.356006:ERROR:network_service_instance_impl.cc(286)] Network service crashed, restarting service.
[8554:8554:0302/112541.362912:ERROR:network_service_instance_impl.cc(286)] Network service crashed, restarting service.
[8554:8554:0302/112541.369857:ERROR:network_service_instance_impl.cc(286)] Network service crashed, restarting service.
[8554:8554:0302/112541.376677:ERROR:network_service_instance_impl.cc(286)] Network service crashed, restarting service.
[8554:8554:0302/112541.383569:ERROR:network_service_instance_impl.cc(286)] Network service crashed, restarting service.
[8554:8554:0302/112541.391002:ERROR:network_service_instance_impl.cc(286)] Network service crashed, restarting service.
...

Expected Results:  
It should work just like =dev-qt/qtwebengine-5.15.2 ( chromium version 83 )

I have try to build with USE=debug and these *FLAGS:

COMMON_FLAGS="-march=skylake -mtune=skylake -O1 -pipe -g"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS} -stdlib=libc++"
RUSTFLAGS="-Ctarget-feature=-crt-static"
LDFLAGS="-fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind \
-march=skylake -mtune=skylake"

There is no coredump, signal or something that can be catched by gdb/lldb

Compiling qtwebengine with musl need some patches, I have been maintaining these patches and used them to successfully compile chromium 79-90, electron 6-12, qtwebengine 5.13-5.15 without any issue. qtwebengine-5.15.2_p20210224 and electron-11 is based on same chromium version: 87.0.4280.144, yet qtwebengine don't work. So this issue is not related with musl. The modified ebuild for musl is at https://github.com/12101111/overlay/tree/master/dev-qt/qtwebengine.
Comment 1 12101111 2021-03-02 07:26:35 UTC
Created attachment 688974 [details]
emerge --info from musl system
Comment 2 12101111 2021-03-02 07:27:10 UTC
Created attachment 688977 [details]
emerge --info from glibc system
Comment 3 12101111 2021-03-02 09:59:36 UTC
Created attachment 688992 [details]
build.log from glibc system
Comment 4 Andreas Sturmlechner gentoo-dev 2021-03-02 11:28:10 UTC
Please build with GCC then.
Comment 5 12101111 2021-03-05 01:40:14 UTC
(In reply to Andreas Sturmlechner from comment #4)
> Please build with GCC then.

All other qt libraries of my system are linked against libc++, so building qtwebengine with gcc will get lots of c++ abi error.

The toolchain used in chromium upstream is clang/libc++. It shouldn't be the problem here.
Comment 6 Andreas Sturmlechner gentoo-dev 2021-03-05 08:47:35 UTC
We'll have to assume it is a build-with-clang problem then, anyway, as long as it is not reproduced with GCC.
Comment 7 Stephan Karacson 2021-03-07 21:51:04 UTC
This bug hits kmail 20.12.2 and konqueror 20.08.3, not displaying emails or webpages.
downgrade to dev-qt/qtwebengine-5.15.2 works.
I'm not using clang wittingly. (firefox&mesa are the only ones depending on clang equery says, never switched from gcc away I believe, don't know how).
Comment 8 12101111 2021-03-08 04:00:56 UTC
The reason is still unknown but I find a workaround to make it work at least: run with --single-process. However not all program accept this option.

screenshot: https://github.com/12101111/overlay/issues/13

Since there are some reports from archlinux, this is not a toolchain or kernel issue.

And I don't think this is a network issue, because as the chromium document say, --enable-features=NetworkServiceInProcess make the network service run in main process, and this do make the network part works, but the program is still broken.
Comment 9 Andreas Thalhammer 2021-03-08 18:15:52 UTC
I've hit the same issue, my primary browser being Konqueror. The problem is that compiling qtwebengine takes very long on my system. Just one thing I noticed while downgrading, as of this moment still in progress:

[ebuild     UD ] dev-qt/qtwebengine-5.15.2:5/5.15::gentoo [5.15.2_p20210224:5/5.15::gentoo] USE="alsa pulseaudio system-ffmpeg system-icu widgets -bindist -debug -designer -geolocation -kerberos -test (-jumbo-build%*)" 0 KiB

The apparent difference is that 5.15.2_p20210224 is a USE="jumbo-build", while 5.15.2 apparently is not.

Also I remember that in the past there were issues with USE="system-icu" and USE="system-ffmpeg", but recently this worked again...

Would using clang solve the issue? It's already on my system, not only for Firefox. I've decided to go with ~amd64 sys-devel/clang:11 (ACCEPT_KEYWORDS) for accelerated video output over dev-libs/intel-neo...
Comment 10 Florian Bruhin 2021-03-08 22:25:09 UTC
It'd be interesting to know what window manager affected people are using. From the information I've gathered[1] so far, all people affected by this are either on i3wm or bspwm (yet [2] mentions seeing it on KDE Plasma, while someone in the qutebrowser repository said they could only reproduce after switching from Plasma to i3).

[1] https://github.com/qutebrowser/qutebrowser/issues/6235#issuecomment-793099273
[2] https://github.com/12101111/overlay/issues/13#issuecomment-792458441
Comment 11 zhangsan 2021-03-09 11:24:06 UTC
I have same issue, after upgrade to qtwebengine-5.15.2_p20210224, rstudio can't work, print "ERROR:network_service_instance_impl.cc(286)] Network service crashed, restarting service". Run "rstudio --single-process" works for me.
I use gcc and kde.
Comment 12 Andreas Thalhammer 2021-03-09 15:21:22 UTC
I only even have Plasma installed, oo other window manager. I also have Wayland available and sometimes tested KDE Plasma with Wayland, but it wasn't satisfactory yet, but it's a fact that I did switch between Plasma/X11 and Plasma/Wayland sometimes. Not recently though.

I don't know how to pass option --single-process to WebEngine, because Konqueror doesn't support that option.

I've saved the two builds now, following https://wiki.gentoo.org/wiki/Binary_package_guide, so now I'm able to quickly switch between 5.15.2 and 5.15.2_p20210224, which took around 16hrs to build on my old and slow system. The later I tried without jumbo-build (but again with system-ffmpeg and system-icu), but didn't change anything, still gives the same error.
Comment 13 Florian Bruhin 2021-03-09 19:52:30 UTC
I think this might be related to the locale somehow. With my default LANG=en_US.UTF-8 I can't reproduce, but with LANG=en_DK.UTF-8 I can (on Archlinux though).

Will dig into it more tomorrow or so.
Comment 14 Florian Bruhin 2021-03-10 12:29:35 UTC
FYI, I now reported this upstream: https://bugreports.qt.io/browse/QTBUG-91715

I found a better workaround (--single-process is bad from a stability/security perspective):

* Find out the locale .pak name matching your locale in /usr/share/qt/translations/qtwebengine_locales/ (path from my Archlinux system, might be slightly different on Gentoo). This is usually the first part of your locale, except for en_DK.UTF-8 (or other en_* except en_US and en_GB) where you'll need to pick either "en-GB" or "en-US". Other special cases might be es-419, pt-BR, pt-PT, zh-CN and zh-TW.
* Start the affected application with the according --lang argument, e.g. --lang=de
* If your application doesn't accept/forward those arguments, set QTWEBENGINE_CHROMIUM_FLAGS=--lang=de in your environment instead (for qutebrowser, use --qt-flag or its qt.args setting)
Comment 15 Chiitoo gentoo-dev 2021-03-10 13:14:05 UTC
(In reply to Florian Bruhin from comment #14)
> FYI, I now reported this upstream:
> https://bugreports.qt.io/browse/QTBUG-91715
> 
> I found a better workaround (--single-process is bad from a
> stability/security perspective):
> 
> * Find out the locale .pak name matching your locale in
> /usr/share/qt/translations/qtwebengine_locales/ (path from my Archlinux
> system, might be slightly different on Gentoo). This is usually the first
> part of your locale, except for en_DK.UTF-8 (or other en_* except en_US and
> en_GB) where you'll need to pick either "en-GB" or "en-US". Other special
> cases might be es-419, pt-BR, pt-PT, zh-CN and zh-TW.
> * Start the affected application with the according --lang argument, e.g.
> --lang=de
> * If your application doesn't accept/forward those arguments, set
> QTWEBENGINE_CHROMIUM_FLAGS=--lang=de in your environment instead (for
> qutebrowser, use --qt-flag or its qt.args setting)

Many thanks!
Comment 16 12101111 2021-03-10 17:32:25 UTC
I can confirm https://codereview.qt-project.org/c/qt/qtwebengine/+/338355 fix this bug.
Comment 17 Florian Bruhin 2021-03-11 09:54:55 UTC
FWIW the patch still has issues - it causes a crash for me (without problems before) and for someone else too, see the comments on the review page. I'd recommend waiting until it's been fixed and merged upstream.
Comment 18 Florian Bruhin 2021-03-12 15:37:57 UTC
A proper fix was now merged upstream: https://code.qt.io/cgit/qt/qtwebengine.git/commit/?h=5.15&id=199ea00a9eea13315a652c62778738629185b059
Comment 19 Andreas Sturmlechner gentoo-dev 2021-03-12 17:35:39 UTC
(In reply to Florian Bruhin from comment #18)
> A proper fix was now merged upstream:
> https://code.qt.io/cgit/qt/qtwebengine.git/commit/?h=5.
> 15&id=199ea00a9eea13315a652c62778738629185b059
Thanks a lot for keeping us up to date here!
Comment 20 Andreas Sturmlechner gentoo-dev 2021-03-12 20:12:12 UTC
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=286732e1677d672669f19607f1db62780c62d746

commit 286732e1677d672669f19607f1db62780c62d746
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2021-03-12 17:08:45 +0000

    dev-qt/qtwebengine: Fix runtime crash with certain locales

    Due to the pain a revbump will cause and only a minority of users affected,
    the patch is applied in place and we will ask affected users to rebuild.

    Reported-by: 12101111 <w12101111@outlook.com>
    Thanks-to: Florian Bruhin <gentoo.org@the-compiler.org>
Comment 21 Andreas Sturmlechner gentoo-dev 2021-03-12 21:02:55 UTC
If you are affected by this bug, please sync and check:

# emerge --sync
# emerge --info | grep ^Timestamp
Timestamp of repository gentoo: Fri, 12 Mar 2021 20:45:02 +0000

^ you are good to go to rebuild:

# emerge -1q dev-qt/qtwebengine
Comment 22 Andreas Thalhammer 2021-03-20 19:16:46 UTC
Worked, thanks!
Comment 23 Stephan Karacson 2021-03-20 23:41:00 UTC
Worked on my system.
Thank you
Comment 24 Andreas Sturmlechner gentoo-dev 2021-04-18 20:51:27 UTC
I think we can consider this fixed.