On 2018/10/03 01:05, Victor Kukshiev wrote: > Hello, ports@! > > This diff fixes crash x11/sakura port with vte 0.54. > upstream commit: > https://bazaar.launchpad.net/~dabisu/sakura/sakura/revision/596 > ok?
I've included the diff below in a more standard format (the patch file should be created with 'make update-patches' rather than come directly from upstream repo, and have a bit of information about where it came from). I just tried sakura to test this, but it's not working at all well for me, either with or without this diff. (And I don't think the diff matters until the vte3 port is updated anyway). About 75% of the time when I try to run it I briefly get a window displayed, then it closes and the process exits, no crash/error message (there is a warning about PCRE2_MULTILINE, but this happens whether it opens the terminal or not). If I am able to open a terminal, when I then open a new tab, there is a high chance of getting the following (sakura:58584): Gtk-WARNING **: 12:17:39.202: VteTerminal 0x973b4322390 reported min size 21 and natural size 2 in get_preferred_height(); natural size must be >= min size (sakura:58584): Gtk-WARNING **: 12:17:39.202: VteTerminal 0x973b4322390 reported min size 12 and natural size 2 in get_preferred_width(); natural size must be >= min size Segmentation fault (core dumped) Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00000973bceee6ae in VteTerminalPrivate::insert_char(unsigned int, bool, bool) () from /usr/local/lib/libvte-2.91.so.2.2 [Current thread is 1 (process 401647)] (gdb) bt #0 0x00000973bceee6ae in VteTerminalPrivate::insert_char(unsigned int, bool, bool) () from /usr/local/lib/libvte-2.91.so.2.2 #1 0x00000973bceefc46 in VteTerminalPrivate::process_incoming() () from /usr/local/lib/libvte-2.91.so.2.2 #2 0x00000973bcf000fa in VteTerminalPrivate::process(bool) () from /usr/local/lib/libvte-2.91.so.2.2 #3 0x00000973bcf00e64 in update_repeat_timeout(void*) () from /usr/local/lib/libvte-2.91.so.2.2 #4 0x00000973634c1433 in g_timeout_dispatch (source=0x973b4066e80, callback=0x400000202000100, user_data=0x0) at gmain.c:4649 #5 0x00000973634c5899 in g_main_dispatch (context=<optimized out>) at gmain.c:3176 #6 g_main_context_dispatch (context=<optimized out>) at gmain.c:3829 #7 0x00000973634c5ca3 in g_main_context_iterate (context=<optimized out>, block=<optimized out>, dispatch=<optimized out>, self=<optimized out>) at gmain.c:3902 #8 0x00000973634c609f in g_main_loop_run (loop=0x973c33bfeb0) at gmain.c:4098 #9 0x000009739e203e58 in gtk_main () at gtkmain.c:1323 #10 0x00000970e9301a3c in main () It's not a general vte3 problem on this machine, for example terminator runs just fine. Index: Makefile =================================================================== RCS file: /cvs/ports/x11/sakura/Makefile,v retrieving revision 1.24 diff -u -p -r1.24 Makefile --- Makefile 27 Jun 2018 21:04:22 -0000 1.24 +++ Makefile 3 Oct 2018 11:13:43 -0000 @@ -5,7 +5,7 @@ COMMENT = GTK and VTE based terminal emu DISTNAME = sakura-${V} EXTRACT_SUFX = .tar.bz2 CATEGORIES = x11 -REVISION = 1 +REVISION = 2 HOMEPAGE = http://www.pleyades.net/david/projects/sakura/ MAINTAINER = Victor Kukshiev <andrey0bolkon...@gmail.com> Index: patches/patch-src_sakura_c =================================================================== RCS file: patches/patch-src_sakura_c diff -N patches/patch-src_sakura_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_sakura_c 3 Oct 2018 11:13:46 -0000 @@ -0,0 +1,66 @@ +$OpenBSD$ + +Fix with newer vte. +https://bugs.launchpad.net/sakura/+bug/1790317 +https://bazaar.launchpad.net/~dabisu/sakura/sakura/revision/596 + +Index: src/sakura.c +--- src/sakura.c.orig ++++ src/sakura.c +@@ -339,6 +339,7 @@ struct terminal { + bool label_set_byuser; + GtkBorder padding; /* inner-property data */ + int colorset; ++ gulong exit_handler_id; + }; + + +@@ -984,31 +985,6 @@ sakura_eof (GtkWidget *widget, void *data) + if (npages==1) { + sakura_config_done(); + } +- +- /* Workaround for libvte strange behaviour. There is not child-exited signal for +- the last terminal, so we need to kill it here. Check with libvte authors about +- child-exited/eof signals */ +- if (gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook))==0) { +- +- term = sakura_get_page_term(sakura, 0); +- +- if (option_hold==TRUE) { +- SAY("hold option has been activated"); +- return; +- } +- +- //SAY("waiting for terminal pid (in eof) %d", term->pid); +- //waitpid(term->pid, &status, WNOHANG); +- /* TODO: check wait return */ +- /* Child should be automatically reaped because we don't use G_SPAWN_DO_NOT_REAP_CHILD flag */ +- g_spawn_close_pid(term->pid); +- +- sakura_del_tab(0); +- +- npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook)); +- if (npages==0) +- sakura_destroy(); +- } + } + + /* This handler is called when window title changes, and is used to change window and notebook pages titles */ +@@ -3167,7 +3143,7 @@ sakura_add_tab() + g_signal_connect(G_OBJECT(term->vte), "bell", G_CALLBACK(sakura_beep), NULL); + g_signal_connect(G_OBJECT(term->vte), "increase-font-size", G_CALLBACK(sakura_increase_font), NULL); + g_signal_connect(G_OBJECT(term->vte), "decrease-font-size", G_CALLBACK(sakura_decrease_font), NULL); +- g_signal_connect(G_OBJECT(term->vte), "child-exited", G_CALLBACK(sakura_child_exited), NULL); ++ term->exit_handler_id = g_signal_connect(G_OBJECT(term->vte), "child-exited", G_CALLBACK(sakura_child_exited), NULL); + g_signal_connect(G_OBJECT(term->vte), "eof", G_CALLBACK(sakura_eof), NULL); + g_signal_connect(G_OBJECT(term->vte), "window-title-changed", G_CALLBACK(sakura_title_changed), NULL); + g_signal_connect_swapped(G_OBJECT(term->vte), "button-press-event", G_CALLBACK(sakura_button_press), sakura.menu); +@@ -3366,6 +3342,7 @@ sakura_del_tab(gint page) + } + + gtk_widget_hide(term->hbox); ++ g_signal_handler_disconnect (term->vte, term->exit_handler_id); + gtk_notebook_remove_page(GTK_NOTEBOOK(sakura.notebook), page); + + /* Find the next page, if it exists, and grab focus */