Subject: Re: bug#40323: 28.0.50; error in process filter: Invalid search bound (wrong side of point)

From: Noam Postavsky <[email-masked]>
Date: Mon, 20 Apr 2020 22:29:54 -0400

Jacob Lagares Pozo <[email-masked]> writes:

> I should probably make a simple program that prints a bunch of stuff
> and then hangs, so I can have predictable and reproducible output,
> that might help.

It occurs to me that you should see a "non-local exit" in the trace when
the error triggers, and the traces just before that should hopefully
show the swapping of marker positions occuring.

> So what do you exactly mean by that the process is ending normally?

Oh, hmm, I was still a bit confused.  I thought the (:comint-pmark nil)
meant the marker was deleted, but actually it's just because around the
call to comint-output-filter a different buffer is current (which makes
the check in the tracing function fail).  Maybe one more tweak to the
tracing function:

    (defun bug-40323-get-comint-output-marker ()
      (list :comint-pmark
            (let ((buf (and (markerp comint-last-output-start)
                            (marker-buffer comint-last-output-start))))
              (when (buffer-live-p buf)
                (cons
                 comint-last-output-start
                 (process-mark (get-buffer-process buf)))))))