Subject: bug#49682: 27.2.50; accept-process-output within accept-process-output hangs emacs

From: Rajeev N <[email-masked]>
Date: Sat, 24 Jul 2021 06:46:25 -0400

Thank for checking.  It always hangs for me in the 1st or 2nd try.  Here is what I get when I send a usr2 signal to emacs process.

Debugger entered--Lisp error: (quit)
  accept-process-output(#<process smtpmail> 0.05)
  network-stream-get-response(#<process smtpmail> 1 "^[0-9]+ .*\15\n")
  network-stream-open-starttls("smtpmail" #<buffer *trace of SMTP session to smtp.gmail.com*> "smtp.gmail.com" 587 (:type starttls :return-list t :warn-unless-encrypted nil :capability-command "EHLO hp\15\n" :end-of-command "^[0-9]+ .*\15\n" :success "^2.*\n" :always-query-capabilities t :starttls-function #f(compiled-function (capabilities) #<bytecode 0x1565a5a06db9>) :client-certificate t :use-starttls-if-possible t))
  open-network-stream("smtpmail" #<buffer *trace of SMTP session to smtp.gmail.com*> "smtp.gmail.com" 587 :type starttls :return-list t :warn-unless-encrypted nil :capability-command "EHLO hp\15\n" :end-of-command "^[0-9]+ .*\15\n" :success "^2.*\n" :always-query-capabilities t :starttls-function #f(compiled-function (capabilities) #<bytecode 0x1565a5a06db9>) :client-certificate t :use-starttls-if-possible t)
  smtpmail-via-smtp(("[email-masked]") #<buffer  smtpmail temp>)
  smtpmail-send-it()
  message-smtpmail-send-it()
  message-multi-smtp-send-mail()
  gnus-agent-send-mail()
  message--send-mail-maybe-partially()
  message-send-mail(nil)
  message-send-via-mail(nil)
  message-send(nil)
  message-send-and-exit(nil)
  funcall-interactively(message-send-and-exit nil)
  call-interactively(message-send-and-exit)
  diary-mail-entries()
  apply(diary-mail-entries nil)
  timer-event-handler([t 24827 60854 498512 nil diary-mail-entries nil nil 704000])