我注意到emacs消耗了100%的cpu。 emacs进程的一个片段显示它正在写入以下文本:
Wrong type argument: window-live-p, #<window 3>
Wrong type argument: window-live-p, #<window 3>
Wrong type argument: window-live-p, #<window 3>
Wrong type argument: window-live-p, #<window 3>
Wrong type argument: window-live-p, #<window 3>
等等。
正在将文本写入文件描述符,根据/proc/.../fd/是一个管道。
Emacs仍然具有响应能力,因此这必须是在&#34;背景&#34;上运行的代码。
如何识别哪个代码对此负责并进行调试?
编辑: 我检查了这个文本正在写入的管道号,并做了一个lsof。我看到该文本可能与dconf和gdbus进行交互。
$lsof |grep 6967
sh 7147 myuser 1w FIFO 0,8 0t0 6967 pipe
sh 7147 myuser 2w FIFO 0,8 0t0 6967 pipe
emacs 7148 myuser 1w FIFO 0,8 0t0 6967 pipe
emacs 7148 myuser 2w FIFO 0,8 0t0 6967 pipe
dconf 7148 7149 myuser 1w FIFO 0,8 0t0 6967 pipe
dconf 7148 7149 myuser 2w FIFO 0,8 0t0 6967 pipe
gdbus 7148 7151 myuser 1w FIFO 0,8 0t0 6967 pipe
gdbus 7148 7151 myuser 2w FIFO 0,8 0t0 6967 pipe
$
老实说,实际的strace输出如下:
write(2, "\n", 1) = -1 EPIPE (Broken pipe)
write(2, "W", 1) = -1 EPIPE (Broken pipe)
write(2, "r", 1) = -1 EPIPE (Broken pipe)
write(2, "o", 1) = -1 EPIPE (Broken pipe)
write(2, "n", 1) = -1 EPIPE (Broken pipe)
write(2, "g", 1) = -1 EPIPE (Broken pipe)
write(2, " ", 1) = -1 EPIPE (Broken pipe)
write(2, "t", 1) = -1 EPIPE (Broken pipe)
write(2, "y", 1) = -1 EPIPE (Broken pipe)
write(2, "p", 1) = -1 EPIPE (Broken pipe)
write(2, "e", 1) = -1 EPIPE (Broken pipe)
write(2, " ", 1) = -1 EPIPE (Broken pipe)
write(2, "a", 1) = -1 EPIPE (Broken pipe)
write(2, "r", 1) = -1 EPIPE (Broken pipe)
write(2, "g", 1) = -1 EPIPE (Broken pipe)
write(2, "u", 1) = -1 EPIPE (Broken pipe)
write(2, "m", 1) = -1 EPIPE (Broken pipe)
write(2, "e", 1) = -1 EPIPE (Broken pipe)
write(2, "n", 1) = -1 EPIPE (Broken pipe)
write(2, "t", 1) = -1 EPIPE (Broken pipe)
write(2, ":", 1) = -1 EPIPE (Broken pipe)
write(2, " ", 1) = -1 EPIPE (Broken pipe)
write(2, "w", 1) = -1 EPIPE (Broken pipe)
write(2, "i", 1) = -1 EPIPE (Broken pipe)
write(2, "n", 1) = -1 EPIPE (Broken pipe)
write(2, "d", 1) = -1 EPIPE (Broken pipe)
write(2, "o", 1) = -1 EPIPE (Broken pipe)
write(2, "w", 1) = -1 EPIPE (Broken pipe)
write(2, "-", 1) = -1 EPIPE (Broken pipe)
write(2, "l", 1) = -1 EPIPE (Broken pipe)
write(2, "i", 1) = -1 EPIPE (Broken pipe)
write(2, "v", 1) = -1 EPIPE (Broken pipe)
write(2, "e", 1) = -1 EPIPE (Broken pipe)
write(2, "-", 1) = -1 EPIPE (Broken pipe)
write(2, "p", 1) = -1 EPIPE (Broken pipe)
write(2, ",", 1) = -1 EPIPE (Broken pipe)
write(2, " ", 1) = -1 EPIPE (Broken pipe)
write(2, "#", 1) = -1 EPIPE (Broken pipe)
write(2, "<", 1) = -1 EPIPE (Broken pipe)
write(2, "w", 1) = -1 EPIPE (Broken pipe)
write(2, "i", 1) = -1 EPIPE (Broken pipe)
write(2, "n", 1) = -1 EPIPE (Broken pipe)
write(2, "d", 1) = -1 EPIPE (Broken pipe)
write(2, "o", 1) = -1 EPIPE (Broken pipe)
write(2, "w", 1) = -1 EPIPE (Broken pipe)
write(2, " ", 1) = -1 EPIPE (Broken pipe)
write(2, "3", 1) = -1 EPIPE (Broken pipe)
write(2, ">", 1) = -1 EPIPE (Broken pipe)
write(2, "\n", 1) = -1 EPIPE (Broken pipe)
所以它写的是我最初写的东西,但是一次只写一个字。但是,它似乎是将它写入破损的管道。