Subject: bug#30182: Update

From: martin rudalics <[email-masked]>
Date: Sat, 27 Jan 2018 09:26:15 +0100

I checked in a fix to the basic routine deciding which text to show in
the tooltip.  Please retry with latest master.

If the crash still occurs please proceed as follows:

(1) Try with `x-gtk-use-system-tooltips' nil.  This should tell
     whether GTK tooltip handling interferes with our routines.

(2) Try the attached diff.  When the crash occurs please do

     p old_len_0
     p new_len_0

     in the debugger and post the values it prints.  This should tell
     whether a timer is added while we construct the list for the copy.
     Undo the change after you're done.

Thank you, martin
diff --git a/src/fns.c b/src/fns.c
index 47457e4..6fea5cd 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -546,6 +546,9 @@ struct textprop_rec
   struct textprop_rec  *textprops = NULL;
   /* Number of elements in textprops.  */
   ptrdiff_t num_textprops = 0;
+
+  EMACS_INT old_len_0, new_len_0;
+
   USE_SAFE_ALLOCA;
 
   tail = Qnil;
@@ -643,7 +646,11 @@ struct textprop_rec
 
   /* Create the output object.  */
   if (target_type == Lisp_Cons)
-    val = Fmake_list (make_number (result_len), Qnil);
+    {
+      old_len_0 = XFASTINT (Flength (args[0]));
+      val = Fmake_list (make_number (result_len), Qnil);
+      new_len_0 = XFASTINT (Flength (args[0]));
+    }
   else if (target_type == Lisp_Vectorlike)
     val = Fmake_vector (make_number (result_len), Qnil);
   else if (some_multibyte)