jwiegley / emacs-async

Simple library for asynchronous processing in Emacs
GNU General Public License v3.0
829 stars 68 forks source link

stack overflow in regexp engine in some settings #183

Closed malb closed 6 months ago

malb commented 6 months ago

The new password prompt regexp causes a stack overflow in the regexp engine for me, so I added a length check before:

(with-current-buffer (process-buffer proc)
    (when (and prompt-for-pwd
               (boundp 'tramp-password-prompt-regexp)
               tramp-password-prompt-regexp
               (length< string 512) ;; <- NEW
               (string-match tramp-password-prompt-regexp string))
      (process-send-string
       proc (concat (read-passwd (match-string 0 string)) "\n")))
    (goto-char (point-max))
    (save-excursion
      (insert string))

FWIW The code that triggers this is that I use async to load bibtex-completion-cache here: https://github.com/malb/emacs.d/blob/master/malb.org#bibtex-completion--helm-bibtex

thierryvolpiatto commented 6 months ago

"Martin R. Albrecht" @.***> writes:

  1. ( ) text/plain (*) text/html

The new password prompt regexp causes a stack overflow in the regexp engine for me, so I added a length check before:

(with-current-buffer (process-buffer proc) (when (and prompt-for-pwd (boundp 'tramp-password-prompt-regexp) tramp-password-prompt-regexp (length< string 512) ;; <- NEW (string-match tramp-password-prompt-regexp string)) (process-send-string proc (concat (read-passwd (match-string 0 string)) "\n"))) (goto-char (point-max)) (save-excursion (insert string))

FWIW The code that triggers this is that I use async to load bibtex-completion-cache here: https://github.com/malb/emacs.d/blob/master/malb.org#bibtex-completion--helm-bibtex

If you don't need being prompted for password, you can let-bind async-prompt-for-password around your async-start call.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.*Message ID: @.***>

-- Thierry

malb commented 6 months ago

That did the trick, thanks!