Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebKit crashed gnome-online-accounts not work. #10

Open
IzsakiRobi opened this issue Dec 15, 2022 · 33 comments
Open

WebKit crashed gnome-online-accounts not work. #10

IzsakiRobi opened this issue Dec 15, 2022 · 33 comments

Comments

@IzsakiRobi
Copy link

Hi!

The gnome-online-accounts add gmail or other acc for need WebKit, is not work :|
Empty page only and always display: "Loading..."

GDK is not able to create a GL context, falling back to glReadPixels (slow!): Unable to create a GL contextGLib-GIO: _g_io_module_get_default:

Epiphany browser too.

"(epiphany:5362): epiphany-WARNING **: 09:18:47.236: Web process crashed"

continously...

This is a WebKit - Mesa problem, i think.

In the Asahi linux distro, works good... Same machine.

rob

@leifliddy
Copy link
Owner

leifliddy commented Dec 15, 2022

That sound similar to an issue that Linus Torvalds submitted.
https://bugzilla.redhat.com/show_bug.cgi?id=2130009

What hardware are you running? An m1 or m2 machine?
Did this work before you updated the mesa drivers?
Can you provide any logs?

@IzsakiRobi
Copy link
Author

Hi!

I'm running Your prebuilt image on MacBook Air M2.
All work wit your first mesa and kernel packages. if I remember correctly...
But the first 12.09? update break WebKit, if I remember correctly.

If you tell me what log you need, (and how to make) I'll be happy to send you.

rob

@leifliddy
Copy link
Owner

leifliddy commented Dec 15, 2022

So the m2 has BTI (Branch Target Identification) which has caused a number or problems.
That's what aforementioned issue was related to and what this issue was related to
https://bugzilla.redhat.com/show_bug.cgi?id=2111900

Can you please run the following to update your system?

# ref https://github.com/leifliddy/asahi-fedora-builder/issues/8#issuecomment-1352990854
dnf downgrade $(dnf list installed | grep mesa | grep -E '1:23.0.0_pre20221207|1:23.0.0_pre20221209' | awk '{print $1}')
dnf upgrade

That will upgrade your kernel to 6.1.0-100.asahi2.1.fc37.aarch64 and mesa libraries to 23.0.0_pre20221214-1.fc37
(which I put out last night).
If the issue persists, just run journalctl -b or better yet journal -b -p err (which will only display errors).
Just find the relevant events in the logs and post them.

@leifliddy
Copy link
Owner

BTW, I've recently ordered an m2 mac air -- it should arrive sometime next week.

@IzsakiRobi
Copy link
Author

IzsakiRobi commented Dec 15, 2022

First:
Congratulations on your good decision :) (M2 Air)

Second:
the WebKit error (journalctl)
https://www.dropbox.com/s/g36fvlmcgat9k1v/Webkit_err.txt?dl=0
Not say much.. (for me)

I install to M1 iMac today, and I'm curious.

ps: My system is Up - To - Date your latest and good mesa and kernel packages...

also sorry my bad english (most of the google translate) :)

rob

@IzsakiRobi
Copy link
Author

IzsakiRobi commented Dec 15, 2022

Hi!

Strange(r) Things... 😊

Clean install on my M1 iMac, the webkit processes (epiphany, geary, gnome-online-accounts, etc...) works FINE!
I sacrificed the M2 Air system, and clean install same step and procedure with the iMac, the WebKit things DON'T WORK!!!

So, this bug is for M2 only. 😐

I"m waiting for the solution...

I hope you'r m2 Air will arrive as soon as possible, and you can test it more easily...

BTW: The Asahi Linux, minimal ARC and same Gnome desktop works fine on M2

rob

@IzsakiRobi
Copy link
Author

Happy New Year!

Since then, I have tested it with several operating systems and WebKit works everywhere on the M2 processor.
(Asahi Linux - Gnome Desktop, Asahi-Ubuntu Gnome-Desktop)(Wayland and Xorg)
Only not, under Asahi-Fedora 😔
Gnome-online-accounts, mail client, browser, etc. would really need it.

For me and others, this is the only option to run Fedora on Apple Silicon.
There is a great need for this project.!

Any progress on the solution?

Thanks!

rob

@Conan-Kudo
Copy link

cc: @mcatanzaro

@mcatanzaro
Copy link

I can help get patches upstream if somebody works on it, but I don't know how to do the required work here, sorry. If anyone cares to try, start by trying to make it work with the JavaScriptCoreUseJIT=0 environment variable, so you only have to fix the slow interpreter tier first. There are more hints in the upstream bug https://bugs.webkit.org/show_bug.cgi?id=245697.

(Alternatively, if you are OK with rebuilding WebKit, you could use -DENABLE_JIT=OFF -DENABLE_C_LOOP=ON as a workaround.)

@leifliddy
Copy link
Owner

leifliddy commented Jan 3, 2023

@mcatanzaro Thanks for your reply.
So I'm looking at webkitgtk-2.38.3-2.fc37.src.rpm

%define _vpath_builddir %{_vendor}-%{_target_os}-build/webkit2gtk-5.0
%cmake \
  -GNinja \
  -DPORT=GTK \
  -DCMAKE_BUILD_TYPE=Release \
  -DUSE_GTK4=ON \
  -DENABLE_WEBDRIVER=OFF \
%if %{without docs}
  -DENABLE_DOCUMENTATION=OFF \
%endif
%if !0%{?with_gamepad}
  -DENABLE_GAMEPAD=OFF \
%endif
%if 0%{?rhel}
%ifarch aarch64
  -DENABLE_JIT=OFF \
  -DUSE_SYSTEM_MALLOC=ON \
%endif
%endif
  %{nil}

And it's setting DENABLE_JIT=OFF for RHEL aarch64 (for webkit2gtk-5.0 and webkit2gtk-4.0)

I'm wondering if the case could be made for Fedora to follow suit.
However, making the issue less visible probably isn't going to help push things along. I'll try rebuilding with those options and will see if that works.

@leifliddy
Copy link
Owner

I was receiving this error

CMake Error at Source/cmake/WebKitFeatures.cmake:322 (message):
  ENABLE_SAMPLING_PROFILER conflicts with ENABLE_C_LOOP.  You must disable
  one or the other.

So I had to turn sampling profiling off

%ifarch aarch64
  -DENABLE_JIT=OFF \
  -DENABLE_C_LOOP=ON \
  -DENABLE_SAMPLING_PROFILER=off \
%endif

It's building now, could take a while.

I did try cross-compiling on an x86_64 system by passing --target=aarch64, but was met with this error:

Compiler.c.o -c /root/rpmbuild/BUILD/webkitgtk-2.38.3/redhat-linux-build/webkit2gtk-5.0/CMakeFiles/CMakeScratch/TryCompile-ELd16o/testCCompiler.c
    cc1: error: unrecognized command-line option '-mbranch-protection=standard'
    ninja: build stopped: subcommand failed.

@mcatanzaro
Copy link

I'm wondering if the case could be made for Fedora to follow suit.

No, we don't want to use these flags unless absolutely necessary.

@leifliddy
Copy link
Owner

@mcatanzaro @Conan-Kudo Is it possible to cross-compile?
Or does that -mbranch-protection=standard option prevent that from happening?

@mcatanzaro
Copy link

You should be able to cross-compile, but sometimes there are bugs. -mbranch-protection=standard is an aarch64-specific flag. Looks like that's being used on the host system by mistake for a configure check. Not sure how to fix that.

@leifliddy
Copy link
Owner

leifliddy commented Jan 3, 2023

That's odd, I can't cross-compile any rpm's now without that issue cropping up.
Well at least it's consistent ; )
Looking at the CMakeError.log it looks like it's not setting the correct target.

Target: x86_64-redhat-linux

and it's just referencing the cross-compile toolchain

-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc - broken

Also, my build just failed on my macbook m1 due to a
No space left on device error. I've got approx 360GB of available disk space.
So I'm sure how that's even possible. Wait...I think it filled up /tmp
It's full of these files:

[root@fedora ~]# ll /tmp/
total 1497952
-rw-r--r--. 1 root       root       18643507 Jan  3 18:43 ccCFQzS0.ltrans0.o
-rw-r--r--. 1 root       root       16798903 Jan  3 18:43 ccCFQzS0.ltrans1.o
-rw-r--r--. 1 root       root       12275395 Jan  3 18:44 ccCFQzS0.ltrans10.o
-rw-r--r--. 1 root       root       12668559 Jan  3 18:44 ccCFQzS0.ltrans100.o
-rw-r--r--. 1 root       root        9392452 Jan  3 18:44 ccCFQzS0.ltrans101.o
-rw-r--r--. 1 root       root        9749288 Jan  3 18:44 ccCFQzS0.ltrans102.o
-rw-r--r--. 1 root       root        9053556 Jan  3 18:44 ccCFQzS0.ltrans103.o
-rw-r--r--. 1 root       root       10333647 Jan  3 18:44 ccCFQzS0.ltrans104.o
-rw-r--r--. 1 root       root        9378726 Jan  3 18:44 ccCFQzS0.ltrans105.o
...

I've never seen that before.
I mean it's like 40% full now, but I'm wondering if some files were deleted when the build process failed.
I'll look closer at both of these issues later...

@leifliddy
Copy link
Owner

If you look at the kernel spec file, you'll see this

%if %{with_cross}
BuildRequires: binutils-%{_build_arch}-linux-gnu, gcc-%{_build_arch}-linux-gnu
%define cross_opts CROSS_COMPILE=%{_build_arch}-linux-gnu-
%define __strip %{_build_arch}-linux-gnu-strip
%endif
...

# Note we need to disable these flags for cross builds because the flags
# from redhat-rpm-config assume that host == target so target arch
# flags cause issues with the host compiler.
%if !%{with_cross}
%define build_hostcflags  %{?build_cflags}
%define build_hostldflags %{?build_ldflags}
%endif

%define make %{__make} %{?cross_opts} %{?make_opts} HOSTCFLAGS="%{?build_hostcflags}" HOSTLDFLAGS="%{?build_hostldflags}"

I'm wondering if similar logic needs to be used here...

@leifliddy
Copy link
Owner

leifliddy commented Jan 4, 2023

I almost got cross-compile functionality working with this logic

%define with_cross    %{?_with_cross:1} %{?!_with_cross:0}
...
%if %{with_cross}
BuildRequires: binutils-%{_build_arch}-linux-gnu, gcc-%{_build_arch}-linux-gnu, gcc-c++-%{_build_arch}-linux-gnu
%define __strip %{_build_arch}-linux-gnu-strip
%endif
...
%cmake \
...
%if %{with_cross}
  -DCMAKE_C_COMPILER=%{_build_arch}-linux-gnu-gcc \
  -DCMAKE_CXX_COMPILER=%{_build_arch}-linux-gnu-g++ \
%endif

But I'm getting stuck with this error:

cc1: fatal error: inaccessible plugin file /usr/lib/gcc/aarch64-linux-gnu/12/plugin/gcc-annobin.so expanded from short plugin name gcc-annobin: No such file or directory

So back to trying to compile this on the macbook m1....
On the first attempt I ran out of space on /tmp .
So this time I simply did this mount --bind /var/tmp /tmp and ran rpmbuild
However, 10-20 min later my system ran out of memory and the build process failed.
Jan 04 05:11:11 fedora kernel: Out of memory: Killed process 181039 (ld) total-vm:9826864kB, anon-rss:4063728kB, file-rss:16kB, shmem-rss:0kB, UID:0 pgtables:5024kB oom_score_adj:0

My m1 macbook has 8GB of physical memory....I can't believe that's not enough.
It's easy enough to find a workaround, just need to put some more time into it.

@mcatanzaro
Copy link

8 GB is going to be really tight. You might be able to survive if you try building with -j1 -g0, but probably you'll need a beefier system.

@leifliddy
Copy link
Owner

It looks like I'm not the only one experiencing this issue https://src.fedoraproject.org/rpms/webkitgtk/blob/rawhide/f/webkitgtk.spec#_316
https://pagure.io/fedora-infrastructure/issue/11000

Going to try adding aarch64 to this list

%ifarch %{ix86} s390x
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
%endif

@leifliddy
Copy link
Owner

leifliddy commented Jan 5, 2023

Sweet that worked!!

@IzsakiRobi
I put the modified webkit2gtk rpms here:
https://leifliddy.com/.webkit2gtk/

You should be able to upgrade with this:

rpm -Uvh https://leifliddy.com/.webkit2gtk/webkit2gtk5.0-2.38.3-3.fc37.aarch64.rpm https://leifliddy.com/.webkit2gtk/webkit2gtk4.1-2.38.3-3.fc37.aarch64.rpm https://leifliddy.com/.webkit2gtk/webkit2gtk4.0-2.38.3-3.fc37.aarch64.rpm https://leifliddy.com/.webkit2gtk/javascriptcoregtk5.0-2.38.3-3.fc37.aarch64.rpm https://leifliddy.com/.webkit2gtk/javascriptcoregtk4.1-2.38.3-3.fc37.aarch64.rpm https://leifliddy.com/.webkit2gtk/javascriptcoregtk4.0-2.38.3-3.fc37.aarch64.rpm

You can always revert to the original packages with:

dnf downgrade webkit2gtk5.0 webkit2gtk4.1 webkit2gtk4.0

Please let me know if this sort out your issue.
I'll consider adding these packages to my asahi repo if it's successful. But I'm not exactly sure how to do the versioning. The obvious way would be to create a version that's one release (or minor version) ahead of the current release, but would involve having to constantly monitor pending package releases -- and that just sounds like a lot of work. The other option would be to just have users modify the fedora repo config and exclude the webkit2gtk packages.
Both options have their downsides, I need to think about this a bit.

Anyways, please provide some feedback whenever you can.

Update:
I added these packages to the rawhide repo located here:
https://leifliddy.com/asahi-linux/rawhide/aarch64/

@IzsakiRobi
Copy link
Author

IzsakiRobi commented Jan 5, 2023

Hi!

Thank you for your hard work! 🥇

The webkit packages you create works like a charm!!! on My M2 Air
Now is use Gnome Web, Geary, and gnome-online accounts (WebKit based apps...)

I will download and backup, and add these packages to the dnf exclude list until a final solution is found. :)
I'm constantly monitoring what's happening on your github page and in the repo :)

Thank You Again!

rob

@leifliddy
Copy link
Owner

leifliddy commented Jan 5, 2023

Nice, I'm glad that worked!
@mcatanzaro Thanks for your help with this

It doesn't sound like this is going to be resolved upstream anytime soon.
So I'm going to try submitting a bugzilla report first and see how far I get with that.

@IzsakiRobi
Copy link
Author

Thank you very much to you and everyone who helped!

I think that more and more people will use your installer on their M2.
Maybe they should have some info about this on the main page?

@mcatanzaro
Copy link

It doesn't sound like this is going to be resolved upstream anytime soon.
So I'm going to try submitting a bugzilla report first and see how far I get with that.

There's already https://bugs.webkit.org/show_bug.cgi?id=245697

@leifliddy
Copy link
Owner

Exactly, that's what I was referencing. It doesn't look like there's traction with that ticket in terms of resolution.

I'm just wondering what the implications are with setting these options in the webkit2gtk spec file

%ifarch aarch64
  -DENABLE_JIT=OFF \
  -DENABLE_C_LOOP=ON \
  -DENABLE_SAMPLING_PROFILER=off \

Is that going to cause significant performance degradation?
What do you think we should do?

@mcatanzaro
Copy link

Is that going to cause significant performance degradation?

Yes, it will be a major performance degradation. But you should do it anyway (until somebody fixes #245697) because slow WebKit is a lot better than no WebKit. ;)

@mcatanzaro
Copy link

And you have the options right. Use exactly those flags and no others. In particular, don't use -DUSE_SYSTEM_MALLOC=ON because unlike RHEL, you don't need that, and it significantly reduces security.

@Conan-Kudo
Copy link

Is there a way we could upstream this into the spec so that we can have it autobuild in COPR?

@leifliddy
Copy link
Owner

leifliddy commented Jan 5, 2023

@Conan-Kudo Is that question for me? If so just tell me what I need to do.

@mcatanzaro
Copy link

No, it's a question for me. I'd rather not because the spec is complicated enough already. But if it would make things significantly more convenient for you, then it's possible, but you'd need to find some way to do it without affecting normal aarch64. Do you have an architecture condition that can be used with %ifarch, for example?

@Conan-Kudo
Copy link

"%{vendor}" == "Fedora Copr - group @asahi"

@mcatanzaro
Copy link

"%{vendor}" == "Fedora Copr - group @asahi"

This is really stretching the bounds of an acceptable hack. ;)

@Conan-Kudo
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants