gtk_accessible_text_get_contents: assertion 'end >= start' failed, take 2
This is basically the same as #6597 (closed), except it's happening in a different place now. Here I do Ctrl+T Ctrl+V in Epiphany Tech Preview (GNOME nightly runtime, so very recent GTK main commit) to create a tab then attempt to paste into the address bar. Problem is in paste_received() in gtktext.c, pos=34 and length=-1. -1 is simply the default value; we mistakenly only write to it if priv->truncate_multiline
is TRUE.
Unfortunately I don't actually know how to reproduce it. It normally does not crash because it bails in the if (!self->realized)
condition in gtk_at_context_update_text_contents(). Otherwise, it will crash. I don't know why the AT context will be sometimes realized and sometimes not, though; I guess it's just a race condition? The problem seems clear enough from code inspection, though, so I will go ahead and submit an optimistic merge request anyway.
#0 g_logv (log_domain=0x7fd73eb921e9 "Gtk", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7ffc41fc8aa0)
at ../glib/gmessages.c:1277
#1 0x00007fd73f54ea73 in g_log
(log_domain=log_domain@entry=0x7fd73eb921e9 "Gtk", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7fd73f5aa2f7 "%s: assertion '%s' failed") at ../glib/gmessages.c:1315
#2 0x00007fd73f54fafd in g_return_if_fail_warning
(log_domain=log_domain@entry=0x7fd73eb921e9 "Gtk", pretty_function=pretty_function@entry=0x7fd73ebeb280 <__func__.12> "gtk_accessible_text_get_contents", expression=expression@entry=0x7fd73eb976fc "end >= start") at ../glib/gmessages.c:3000
#3 0x00007fd73e6ea792 in gtk_accessible_text_get_contents (self=self@entry=0x55e310d20850, start=start@entry=34, end=end@entry=33)
at ../gtk/gtkaccessibletext.c:134
#4 0x00007fd73e998c1e in gtk_at_spi_context_update_text_contents (end=33, start=34, change=<optimized out>, context=0x55e310d28f10 [GtkAtSpiContext])
at ../gtk/a11y/gtkatspicontext.c:1663
#5 gtk_at_spi_context_update_text_contents (context=0x55e310d28f10 [GtkAtSpiContext], change=<optimized out>, start=34, end=33)
at ../gtk/a11y/gtkatspicontext.c:1632
#6 0x00007fd73e6eb182 in gtk_accessible_text_update_contents
(self=self@entry=0x55e310d20850, change=change@entry=GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT, start=34, end=33) at ../gtk/gtkaccessibletext.c:571
#7 0x00007fd73e869821 in paste_received (clipboard=<optimized out>, result=<optimized out>, data=0x55e310d20850) at ../gtk/gtktext.c:5427
#8 0x00007fd73f3b235b in g_task_return_now (task=task@entry=0x55e316c9ec80 [GTask]) at ../gio/gtask.c:1361
#9 0x00007fd73f3b2395 in complete_in_idle_cb (task=0x55e316c9ec80) at ../gio/gtask.c:1375
#10 0x00007fd73f543767 in g_main_dispatch (context=context@entry=0x55e31084e950) at ../glib/gmain.c:3348
#11 0x00007fd73f545907 in g_main_context_dispatch_unlocked (context=0x55e31084e950) at ../glib/gmain.c:4197
#12 g_main_context_iterate_unlocked (context=context@entry=0x55e31084e950, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
at ../glib/gmain.c:4262
#13 0x00007fd73f5460b3 in g_main_context_iteration (context=context@entry=0x55e31084e950, may_block=may_block@entry=1) at ../glib/gmain.c:4327
#14 0x00007fd73f3e440d in g_application_run (application=0x55e310878b00 [EphyShell], argc=<optimized out>, argv=<optimized out>)
at ../gio/gapplication.c:2712
#15 0x000055e30f8c413e in main (argc=<optimized out>, argv=<optimized out>) at ../src/ephy-main.c:461