GNU bug report logs - #43099
28.0.50; process-send-string broken on osx

Previous Next

Package: emacs;

Reported by: Daniel Sutton <dan <at> dpsutton.com>

Date: Sat, 29 Aug 2020 05:27:02 UTC

Severity: normal

Tags: help

Found in version 28.0.50

To reply to this bug, email your comments to 43099 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#43099; Package emacs. (Sat, 29 Aug 2020 05:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Sutton <dan <at> dpsutton.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 29 Aug 2020 05:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daniel Sutton <dan <at> dpsutton.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; process-send-string broken on osx
Date: Sat, 29 Aug 2020 00:26:35 -0500
[Message part 1 (text/plain, inline)]
I'm diagnosing some issues with inf-clojure which is based on comint
mode. When sending clojure forms with long docstrings, the repl would
would output "^G^G^G..." quite a bit and become unresponsive. This
problem is seemingly only present on OSX. I've tracked down the smallest
reproduction to be the following:

```
(let ((process (start-process "testing" "*process-output*" nil)))
  (process-send-string process

"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii")
  (stop-process process))
```

This prints out "^G^G ..." (repeated many times) in *process-output* on
OSX and prints the expected multiple "i"s on GNU/linux. A
similar interesting example of buggy behavior is

```
(let ((process (start-process "testing" "*process-output*" nil)))
  (process-send-string process
                       "hi")
  (stop-process process))
```

On OSX this leaves the buffer empty while on GNU/Linux this prints the
expected "hi". This bug seemingly affects all users of comint on OSX due
to its usage of process-send-string. One can demonstrate this by trying
to evaluate the preceding "iiii..." string in a scheme buffer (for
example `(run-scheme "chez")`. This is also demonstrated by trying to
evaluate a form like `(+ 1 1 1 ...)` which is sufficiently long.


In GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin19.6.0, NS appkit-1894.60
Version 10.15.6 (Build 19G73))
of 2020-08-11 built on dan-mbp.local
Repository revision: 0d0aad213f941efc0fa0ec032e37dc9c2b08c9fb
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1894
System Description:  Mac OS X 10.15.6

Recent messages:
Checking 57 files in /Users/dan/projects/emacs/lisp/eshell...
Checking 71 files in /Users/dan/projects/emacs/lisp/erc...
Checking 34 files in /Users/dan/projects/emacs/lisp/emulation...
Checking 182 files in /Users/dan/projects/emacs/lisp/emacs-lisp...
Checking 24 files in /Users/dan/projects/emacs/lisp/cedet...
Checking 59 files in /Users/dan/projects/emacs/lisp/calendar...
Checking 87 files in /Users/dan/projects/emacs/lisp/calc...
Checking 107 files in /Users/dan/projects/emacs/lisp/obsolete...
Checking for load-path shadows...done
Mark set

Configured features:
JPEG TIFF GIF PNG RSVG GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS NS MODULES THREADS JSON PDUMPER LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Message

Minor modes in effect:
  recentf-mode: t
  global-magit-file-mode: t
  magit-file-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  mml-mode: t
  async-bytecomp-package-mode: t
  projectile-mode: t
  shell-dirtrack-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  ivy-rich-mode: t
  ivy-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  delete-selection-mode: t
  company-quickhelp-mode: t
  company-quickhelp-local-mode: t
  global-company-mode: t
  company-mode: t
  which-key-mode: t
  minions-mode: t
  pixel-scroll-mode: t
  save-place-mode: t
  winner-mode: t
  show-paren-mode: t
  global-auto-revert-mode: t
  auto-compile-on-load-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  auto-fill-function: yas--auto-fill
  transient-mark-mode: t
  abbrev-mode: t

Load-path shadows:
~/projects/dev/clojure-mode/clojure-mode hides
/Users/dan/.emacs.d/elpa/clojure-mode-20200419.559/clojure-mode

Features:
(shadow sort mail-extr emacsbug sendmail novice cl-print apropos tabify
eieio-opt speedbar ezimage dframe recentf tree-widget magit-bookmark
magit-submodule magit-obsolete magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-files magit-refs magit-status
magit magit-repos magit-apply magit-wip magit-log which-func magit-diff
smerge-mode magit-core magit-autorevert magit-margin magit-transient
magit-process magit-mode git-commit transient magit-git magit-section
magit-utils crm log-edit message rfc822 mml mml-sec epa epg epg-config
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mailabbrev
mail-utils gmm-utils mailheader pcvs-util add-log with-editor
async-bytecomp async loccur cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs bug-reference help-fns
radix-tree crux vc-git diff-mode all-the-icons-dired smart-mode-line
rich-minority projectile grep ibuf-ext ibuffer ibuffer-loaddefs
company-oddmuse company-keywords company-etags company-gtags
company-dabbrev-code company-dabbrev company-files company-capf
company-cmake company-xcode company-clang company-semantic company-eclim
company-template company-bbdb exec-path-from-shell ediprolog
haskell-mode haskell-cabal haskell-utils haskell-font-lock
haskell-indentation haskell-string haskell-sort-imports haskell-lexeme
haskell-align-imports haskell-complete-module haskell-ghc-support
flymake-proc flymake dabbrev haskell-customize cider tramp-sh
cider-debug cider-browse-ns cider-mode cider-inspector cider-completion
cider-profile cider-eval cider-repl-history pulse cider-repl
cider-resolve cider-test cider-overlays cider-stacktrace cider-doc
cider-browse-spec cider-clojuredocs cider-eldoc cider-client
cider-common etags fileloop cider-connection cider-util cider-popup
sesman-browser nrepl-client tramp tramp-loaddefs trampver
tramp-integration files-x tramp-compat shell parse-time iso8601 ls-lisp
nrepl-dict cider-compat inf-clojure thingatpt assess m-buffer
m-buffer-at m-buffer-macro clojure-mode derived align imenu
flycheck-clj-kondo buttercup warnings ert ewoc debug backtrace
buttercup-compat sesman vc vc-dispatcher spinner queue pkg-info url-http
url url-proxy url-privacy url-expand url-methods url-history mailcap
url-auth mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr url-cookie url-domsuf url-util url-gw nsm rmc puny lisp-mnt
epl parseedn parseclj-parser parseclj-lex a yasnippet fish-mode flycheck
rainbow-delimiters paredit counsel xdg xref project swiper ivy-rich ivy
ivy-faces ivy-overlay colir pcre2el rxt re-builder rx htmlize ox-reveal
cl ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn
nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar
ox-html table ox-ascii ox-publish ox org-element avl-tree generator
org-tempo org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-footnote org-src ob-comint org-pcomplete pcomplete org-list
org-faces org-entities time-date noutline outline org-version
ob-emacs-lisp ob-core ob-eval org-table ol org-keys org-compat org-macs
org-loaddefs find-func cal-menu calendar cal-loaddefs tempo pdf-tools
compile comint ansi-color pdf-view bookmark text-property-search pp
jka-compr pdf-cache pdf-info tq pdf-util format-spec image-mode dired
dired-loaddefs exif undo-tree diff browse-kill-ring delsel all-the-icons
all-the-icons-faces data-material data-weathericons data-octicons
data-fileicons data-faicons data-alltheicons memoize company-quickhelp
pos-tip company pcase hydra lv diminish which-key brin-theme
gruvbox-theme gruvbox sublime-themes kaolin-themes kaolin-themes-lib
autothemer dash solarized-theme solarized solarized-faces color hl-line
moody minions pixel-scroll advice saveplace winner ring paren autorevert
filenotify edmacro kmacro resize-window cl-extra help-mode server
auto-compile packed use-package use-package-ensure use-package-delight
use-package-diminish use-package-bind-key bind-key easy-mmode
use-package-core finder-inf cus-edit cus-start cus-load wid-edit info
package easymenu browse-url url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core term/tty-colors frame
minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite charscript charprop case-table epa-hook jka-cmpr-hook help
simple abbrev obarray cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
threads kqueue cocoa ns lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 781232 166059)
(symbols 48 49330 50)
(strings 32 223936 15043)
(string-bytes 1 6578514)
(vectors 16 79064)
(vector-slots 8 1690412 127179)
(floats 8 1118 737)
(intervals 56 28290 2564)
(buffers 992 34))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43099; Package emacs. (Sat, 29 Aug 2020 06:02:01 GMT) Full text and rfc822 format available.

Message #8 received at 43099 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Sutton <dan <at> dpsutton.com>
To: 43099 <at> debbugs.gnu.org
Subject: related bug
Date: Sat, 29 Aug 2020 01:01:42 -0500
[Message part 1 (text/plain, inline)]
I believe bug 3248 ( https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32438 )
is related. Its discussing similar behavior in shell-mode which is comint
based.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43099; Package emacs. (Sat, 29 Aug 2020 15:42:02 GMT) Full text and rfc822 format available.

Message #11 received at 43099 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Daniel Sutton <dan <at> dpsutton.com>
Cc: 43099 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#43099: related bug
Date: Sat, 29 Aug 2020 17:41:47 +0200 (CEST)
On Sat, Aug 29, 2020 at 01:01:42AM -0500, Daniel Sutton wrote:
> I believe bug 3248 ( https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32438 )
> is related. Its discussing similar behavior in shell-mode which is comint
> based.

In that thread Charles traced it to this commit:

  commit 2b0a91e78f83fb446cc38efb99399e83ad2cded3
  Author: Stefan Monnier <monnier <at> iro.umontreal.ca>
  Date:   Mon Apr 12 22:07:48 2010 -0400

      Try to solve the problem of spurious EOF chars in long lines of text
      sent to interactive subprocesses.
      * sysdep.c (child_setup_tty): Do not enable ICANON any more.
      (system_process_attributes): Remove unused var `ttotal'.
      * process.c (send_process): Don't bother breaking long line with EOF
      chars when talking to ttys any more.
      (wait_reading_process_output): Output a warning when called in such
      a way that it could block without being interruptible.

so I've cc'd Stefan in, even though it was a long time ago, in case he
has any insight.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43099; Package emacs. (Sun, 30 Aug 2020 03:53:02 GMT) Full text and rfc822 format available.

Message #14 received at 43099 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alan Third <alan <at> idiocy.org>
Cc: Daniel Sutton <dan <at> dpsutton.com>, 43099 <at> debbugs.gnu.org
Subject: Re: bug#43099: related bug
Date: Sat, 29 Aug 2020 23:52:05 -0400
> so I've cc'd Stefan in, even though it was a long time ago, in case he
> has any insight.

The only insight I can give is that I don't understand ttys;
Reverting my commit may fix the problem you see but will introduce
other problems.
I couldn't find anyone that was able to help me figure out what to do.


        Stefan





Added tag(s) help. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Mon, 11 Oct 2021 13:26:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 254 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.