bug#81514: 32.0.50; Eglot messages progress reporter shows errors

"Jacek Świerk" <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
I can reproduce it with clangd on the following C++ repository:
https://github.com/rui314/mold. It doesn't happen every time but often 
enough:

Debugger entered--Lisp error: (wrong-type-argument sequencep 100)
   ((20 . [1785337541.907988 nil nil "[eglot] mold 
backgroundIndexProgress: indexing..." 1 0.2 nil nil]) 20 100)
   progress-reporter-do-update((20 . [1785337541.907988 nil nil "[eglot] 
mold backgroundIndexProgress: indexing..." 1 0.2 nil nil]) 100 nil)
   eglot--reporter-update((20 . [1785337541.907988 nil nil "[eglot] mold 
backgroundIndexProgress: indexing..." 1 0.2 nil nil]) 100 nil)
   #f(compiled-function (arg1 arg2 arg3 arg4 &rest rest) #<bytecode 
0xa1216d65848076a>)(#<eglot-lsp-server 1022b7360904> 
"backgroundIndexProgress" 100 nil)
   #f(compiled-function (arg1 arg2 &rest rest) "Handle $/progress 
notification identified by TOKEN from SERVER." #<bytecode 
-0xf68beacb9f43862>)(#<eglot-lsp-server 1022b7360904> $/progress :token 
"backgroundIndexProgress" :value (:kind "end"))
   apply(#f(compiled-function (arg1 arg2 &rest rest) "Handle $/progress 
notification identified by TOKEN from SERVER." #<bytecode 
-0xf68beacb9f43862>) #<eglot-lsp-server 1022b7360904> $/progress (:token 
"backgroundIndexProgress" :value (:kind "end")))
   eglot-handle-notification(#<eglot-lsp-server 1022b7360904> $/progress 
:token "backgroundIndexProgress" :value (:kind "end"))
   apply(eglot-handle-notification #<eglot-lsp-server 1022b7360904> 
$/progress (:token "backgroundIndexProgress" :value (:kind "end")))
   #f(compiled-function (server method params) #<bytecode 
0x1f1b657efb0838aa>)(#<eglot-lsp-server 1022b7360904> $/progress (:token 
"backgroundIndexProgress" :value (:kind "end")))
   jsonrpc-connection-receive(#<eglot-lsp-server 1022b7360904> (:jsonrpc 
"2.0" :method "$/progress" :params (:token "backgroundIndexProgress" 
:value (:kind "end"))))
   #f(compiled-function (conn msg) #<bytecode 
0x4e6153735258fd3>)(#<eglot-lsp-server 1022b7360904> (:jsonrpc "2.0" 
:method "$/progress" :params (:token "backgroundIndexProgress" :value 
(:kind "end"))))
   apply(#f(compiled-function (conn msg) #<bytecode 0x4e6153735258fd3>) 
(#<eglot-lsp-server 1022b7360904> (:jsonrpc "2.0" :method "$/progress" 
:params (:token "backgroundIndexProgress" :value (:kind "end")))))
   timer-event-handler([t 27242 5829 902968 nil #f(compiled-function 
(conn msg) #<bytecode 0x4e6153735258fd3>) (#<eglot-lsp-server 
1022b7360904> (:jsonrpc "2.0" :method "$/progress" :params (:token 
"backgroundIndexProgress" :value (:kind "end")))) nil 894000 nil])

The LSP message that causes it looks like this from the 
(eglot-events-buffer):
<-- $/progress 
{"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"end"}}}

Based on my understanding of Eglot code, Eglot creates a non-numeric 
progress
reporter because MIN-VALUE and MAX-VALUE arguments are not provided. 
However, it
looks like Eglot updates the created progress reporter as it were numeric:
(eglot--reporter-update pr pcnt msg)

For the {"kind": "end"} notification, pcnt is set to 100 and msg is nil. 
After
commit b6849229003, the pulsing reporter forwards (or update-text value) as
UPDATE-TEXT. That evaluates to 100. Then progress-reporter-echo-area tries
(concat (if update-text " " "") update-text) which triggers the shown error.

On 7/29/26 3:21 PM, Stéphane Marks wrote:
> On Wed, Jul 29, 2026 at 7:37 AM Eli Zaretskii <[email protected]> wrote:
>
>     > From: "Jacek Świerk" <[email protected]>
>     > Date: Wed, 29 Jul 2026 09:41:39 +0200
>     >
>     > When Eglot is configured with `eglot-report-progress` set to
>     `messages`, it
>     > reports an error while trying to use the progress reporter in a
>     nontrivial
>     > project.
>     >
>     > Reproduction using rust-analyzer:
>     > 1. Clone https://github.com/BurntSushi/ripgrep
>     > 2. Open ripgrep/crates/core/main.rs
>     > 3. M-: (setopt eglot-report-progress 'messages)
>     > 4. M-x toggle-debug-on-error
>     > 5. M-x eglot
>     >
>     > Debugger entered--Lisp error: (wrong-type-argument sequencep 100)
>     >    progress-reporter-echo-area((7 . [1785304002.532535 nil nil
>     "[eglot]
>     > ripgrep rustAnalyzer/Building compile-time-deps: Building
>     > compile-time-deps..." 1 0.2 nil nil]) 7 100)
>     >    progress-reporter-do-update((7 . [1785304002.532535 nil nil
>     "[eglot]
>     > ripgrep rustAnalyzer/Building compile-time-deps: Building
>     > compile-time-deps..." 1 0.2 nil nil]) 100 nil)
>     >    eglot--reporter-update((7 . [1785304002.532535 nil nil "[eglot]
>     > ripgrep rustAnalyzer/Building compile-time-deps: Building
>     > compile-time-deps..." 1 0.2 nil nil]) 100 nil)
>     >    #f(compiled-function (arg1 arg2 arg3 arg4 &rest rest) #<bytecode
>     > 0x1c7b74ccff3232d6>)(#<eglot-lsp-server 1008c31da7cc>
>     > "rustAnalyzer/Building compile-time-deps" 100 nil)
>     >    #f(compiled-function (arg1 arg2 &rest rest) "Handle $/progress
>     > notification identified by TOKEN from SERVER." #<bytecode
>     > -0x35b89fe1a323862>)(#<eglot-lsp-server 1008c31da7cc> $/progress
>     :token
>     > "rustAnalyzer/Building compile-time-deps" :value (:kind "end"))
>     >    apply(#f(compiled-function (arg1 arg2 &rest rest) "Handle
>     $/progress
>     > notification identified by TOKEN from SERVER." #<bytecode
>     > -0x35b89fe1a323862>) #<eglot-lsp-server 1008c31da7cc> $/progress
>     (:token
>     > "rustAnalyzer/Building compile-time-deps" :value (:kind "end")))
>     >    eglot-handle-notification(#<eglot-lsp-server 1008c31da7cc>
>     $/progress
>     > :token "rustAnalyzer/Building compile-time-deps" :value (:kind
>     "end"))
>     >    apply(eglot-handle-notification #<eglot-lsp-server 1008c31da7cc>
>     > $/progress (:token "rustAnalyzer/Building compile-time-deps" :value
>     > (:kind "end")))
>     >    #f(compiled-function (server method params) #<bytecode
>     > 0x1f1068c682e838aa>)(#<eglot-lsp-server 1008c31da7cc> $/progress
>     (:token
>     > "rustAnalyzer/Building compile-time-deps" :value (:kind "end")))
>     >    jsonrpc-connection-receive(#<eglot-lsp-server 1008c31da7cc>
>     (:jsonrpc
>     > "2.0" :method "$/progress" :params (:token "rustAnalyzer/Building
>     > compile-time-deps" :value (:kind "end"))))
>     >    #f(compiled-function (conn msg) #<bytecode
>     > 0x1bafe9b6d4ce09dc>)(#<eglot-lsp-server 1008c31da7cc> (:jsonrpc
>     "2.0"
>     > :method "$/progress" :params (:token "rustAnalyzer/Building
>     > compile-time-deps" :value (:kind "end"))))
>     >    apply(#f(compiled-function (conn msg) #<bytecode
>     0x1bafe9b6d4ce09dc>)
>     > (#<eglot-lsp-server 1008c31da7cc> (:jsonrpc "2.0" :method
>     "$/progress"
>     > :params (:token "rustAnalyzer/Building compile-time-deps" :value
>     (:kind
>     > "end")))))
>     >    timer-event-handler([t 27241 37827 781121 nil
>     #f(compiled-function
>     > (conn msg) #<bytecode 0x1bafe9b6d4ce09dc>) (#<eglot-lsp-server
>     > 1008c31da7cc> (:jsonrpc "2.0" :method "$/progress" :params (:token
>     > "rustAnalyzer/Building compile-time-deps" :value (:kind
>     "end")))) nil
>     > 734000 nil])
>     >
>     > This seems to be introduced by the following commit
>     >
>     https://github.com/emacs-mirror/emacs/commit/b6849229003f214570acedfa7e2755051c0e4305
>     > and most likely affects Emacs 31 as well.
>
>     Thanks.
>
>     Stéphane, please look into fixing this.
>
>
> I don't use rust so I don't have that toolchain installed.  I tried to 
> trigger this condition using clangd on src/emacs.c and it works fine.  
> Perhaps my clangd configuration does not emit the asynchronous 
> notifications that touch that eglot code path.  If we can create a 
> recipe that works with clangd that would be ideal.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.