]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix assertion violations when displaying thread-related error
authorEli Zaretskii <eliz@gnu.org>
Mon, 17 Apr 2017 06:47:39 +0000 (09:47 +0300)
committerEli Zaretskii <eliz@gnu.org>
Mon, 17 Apr 2017 06:47:39 +0000 (09:47 +0300)
* src/process.c (Faccept_process_output): Don't assume a thread's
name is always a string.

src/process.c

index 2f2e5c1b2515a9a631492decdebc033a32a8f532..b81c7b459e3d53886d1620c3ef41fa43ada74eab 100644 (file)
@@ -4563,8 +4563,16 @@ is nil, from any process) before the timeout expired.  */)
       /* Can't wait for a process that is dedicated to a different
         thread.  */
       if (!EQ (proc->thread, Qnil) && !EQ (proc->thread, Fcurrent_thread ()))
-       error ("Attempt to accept output from process %s locked to thread %s",
-              SDATA (proc->name), SDATA (XTHREAD (proc->thread)->name));
+       {
+         Lisp_Object proc_thread_name = XTHREAD (proc->thread)->name;
+
+         if (STRINGP (proc_thread_name))
+           error ("Attempt to accept output from process %s locked to thread %s",
+                  SDATA (proc->name), SDATA (proc_thread_name));
+         else
+           error ("Attempt to accept output from process %s locked to thread %p",
+                  SDATA (proc->name), XTHREAD (proc->thread));
+       }
     }
   else
     just_this_one = Qnil;