-
Notifications
You must be signed in to change notification settings - Fork 9
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
chromium 117.0.5938.149-1 gtk+3 crash (without atk) #145
Comments
P.S this crash does not happen on wayland. |
Ok I figured it out. Turns out I did not have atk on my system. That causes gtk+3 to be compiled without no-fribidi.patch. @ehawkvu I remeber atk being a dependency of chromium. I guess it was removed. |
Thanks for investigating this! I've had an unrelated crash w/ chromium that seems to have fixed itself?? (Look at the irc logs between me and sewn for more info on this). I'll re-add atk as a dependency. I'll see if there is an easy way to check if gtk+3 was compiled w/ atk support. |
Here's the patch that I'm thinking of adding, thoughts? diff --git a/community/chromium/build b/community/chromium/build
index 0fe68674..7bfac2f0 100755
--- a/community/chromium/build
+++ b/community/chromium/build
@@ -2,6 +2,33 @@
export DESTDIR="$1"
+# Check to make sure that gtk+3 is built with atk support
+cat > gtk-atk-test.c <<EOF
+#include <gtk/gtk.h>
+
+int main () {
+#ifdef GTK_ACCESSIBLE
+ return 0;
+#else
+ return 1;
+#endif
+}
+EOF
+"${CC:-cc}" $(pkg-config --cflags gtk+-3.0) gtk-atk-test.c -o gtk-atk-test
+if ! ./gtk-atk-test; then
+cat <<EOF
+You need to rebuild gtk+3 with atk support!
+
+If you are using the version of gtk+3 shipped with kiss-xorg run the following:
+
+$ kiss b gtk+3
+
+And it will automatically pick up the atk dependency.
+EOF
+ exit 1
+fi
+rm -v -- gtk-atk-test.c
+
printf "NOTE: It is HIGHLY recommended to build this package with sane build flags and 'ccache' enabled!\n"
# Glob includes the libstdc++ patchset aswell. |
I think we should patch fribidi or/and atk patched out of chromium. I would do it if I wasn't on Alpine. |
Looks like a nice workaround, despite being super hacky. I wouldn't know how feasible it is to patch the chrome itself. |
What's odd is that this problem does not occur on the wayland version of chrome - they use almost the same patches that we do. I think that gtk+3 is the place to look since for X11 we require a couple extra steps to ensure that atk is not built into the library. |
I'm not a huge fan of how hacky this solution is either, but without seriously investigating why gtk+3 has different behavior on X vs wayland when atk is patched out, I'm inclined to merge it on the next version bump. |
@kyx0r hacky fix was pushed up last night. I wonder if it would be possible to build chromium using only the qt5 toolkit, instead of gtk3? (I have not tried to build chromium w/o gtk+3, but I do wonder if it would be feasible). |
Oh my, I am not brave enough to compile qt5. Isn't it like crazy bloated last time I've checked? |
@kyx0r compared to gtk3 it's pretty bloated, but overall it's not crazy. On my system (granted w/ -O3 -march=native) qt5 takes up 110MB and takes about 10 minutes to compile (16 threads) |
Wait, rebuilding GTK+3 with ATK support, while Chromium still has ATK support disabled, fixes this problem..? The issue is indeed in gtk+3. Which is weird since the two ATK patches don't actually add lines.. |
Here is a small gtk3 program that intentionally triggers the segfault but that segfault only occurs when gtk is built without atk (yes, i asked chatgpt to write it because i cant be assed with gtk) #include <gtk/gtk.h>
// Callback function to handle key presses
static gboolean on_key_press(GtkWidget *widget, GdkEventKey *event, GtkTextBuffer *buffer) {
if (event->keyval == GDK_KEY_Escape) {
gtk_main_quit(); // Close the application when Esc key is pressed
return TRUE;
}
// Set the buffer to NULL to trigger the error
gtk_text_view_set_buffer(GTK_TEXT_VIEW(widget), NULL);
// Try to get the insert mark from the NULL buffer
GtkTextMark *insert = gtk_text_buffer_get_insert(NULL);
if (insert == NULL) {
g_print("Error: gtk_text_buffer_get_insert failed\n");
}
// Try to get the iterator at a NULL mark
GtkTextIter iter;
gtk_text_buffer_get_iter_at_mark(NULL, &iter, NULL);
return TRUE;
}
int main(int argc, char *argv[]) {
gtk_init(&argc, &argv);
// Create a window
GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(window), 400, 300);
gtk_window_set_title(GTK_WINDOW(window), "Simple Text Editor");
g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
// Create a text view
GtkWidget *text_view = gtk_text_view_new();
// Get the text buffer associated with the text view
GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view));
// Set up the key press event handler
g_signal_connect(G_OBJECT(text_view), "key-press-event", G_CALLBACK(on_key_press), buffer);
// Create a scrollable container for the text view
GtkWidget *scrolled_window = gtk_scrolled_window_new(NULL, NULL);
gtk_container_add(GTK_CONTAINER(scrolled_window), text_view);
// Add the scrolled window to the main window
gtk_container_add(GTK_CONTAINER(window), scrolled_window);
// Show all widgets
gtk_widget_show_all(window);
// Start the GTK main loop
gtk_main();
return 0;
} |
@apprehensions does that code also segfault if you were to run it under a wayland environment (like if someone was using upstreams' version of gtk+3). Good find btw, should make it much more straightforward to try and pinpoint where this problem is. |
Hi. I am back on Xorg. Done fighting battles with wayland.
My chrome crashes with this:
chromium 117.0.5938.149-1
I built a slightly newer version, but even the one you have currently crashes the same way.
Just press any key on your keyboard and it crashes.
Mouse works just fine.
Is it just my system? I don't have any issues like that in other gtk+3 apps on xorg.
Kind Regards,
Kyryl
The text was updated successfully, but these errors were encountered: