[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1050685: elpa-debian-el: Error when using debian-bug on certain binary package: (wrong-type-argument processp nil)



tag -1 - unreproducible
thanks

David Bremner <bremner@unb.ca> writes:

> Manphiz <manphiz@gmail.com> writes:
>
>> Hmm, indeed I cannot reproduce this with "emacs -Q" either.  Will see
>> what could have caused this.  Any tips on debugging?
>
> The only thing I can think of is to bisect the packages you have
> enabled/loaded.

Finally got some time to debug this.  So it turns out that these
lines[1] that tries to run "debian-bug-script" may fail before
debian-bug tries to get the process status, which results in
bug-script-process being nil.  As for why the script may fail, in my
case, the package I tried to reportbug on - linux-image-6.4.0-3-amd64 -
has some custom logic that will ask additional questions to gather more
information, such as whether to include dmesg, whether to include
network interface info, etc., which will wait for a user input before
proceeding.  In the meantime, I have installed with-editor which will
try to export a custom EDITOR envvar in term-exec-hook as suggested[2],
and if the terminal is waiting a user input, it will cause the process
to fail due to the command from with-editor.

(As a possible cause has been found I'm taking the liberty to remove the
unreproducible tag, even though it is not cause by debian-bug itself.)

So in this case, it was indeed an external addon that triggered this
error as David said.  However, as the comment indicated[3], it should
properly handle process termination, or any addon that tries to
manipulate a term process may cause debian-bug to fail.  I have prepared
a merge request[4] trying to handle process termination as suggested but
in quite a crude way, so any suggestion is appreciated..

Another finding is that in 28.x, if the term buffer have any further
questions to ask, debian-bug seems to consider the process stuck and
would just ignore everything and proceed.  In 29.x however, the term
buffer seems to be able to accept user input and can process the output
accordingly - even if the script requires sudo and prompt for password,
and debian-bug can properly include the output in the generated email
for bug report.  So with the merge request[4] it would instead skip all
potential additional information unfortunately.

As we do want to handle process termination better, while trying to keep
process from failing, I think temporarily disable term-exec-hook when
processing the output and restore after the report is generated should
probably work in most cases.  Just wondering whether this is acceptable
in the process of debian-bug?

[1] https://salsa.debian.org/manphiz/debian-el/-/blob/master/debian-bug.el#L892-893
[2] https://gitlab.com/xiyueden/emacs.d/-/blob/master/init.el?ref_type=heads#L460-463
[3] https://salsa.debian.org/manphiz/debian-el/-/blob/master/debian-bug.el#L897
[4] https://salsa.debian.org/emacsen-team/debian-el/-/merge_requests/11

-- 
Manphiz


Reply to: