GNU bug report logs -
#79201
30.1.90; set-process-thread can permanently break fd_callback_info slots
Previous Next
Full log
Message #14 received at 79201 <at> debbugs.gnu.org (full text, mbox):
> Cc: 79201 <at> debbugs.gnu.org, dmitry <at> gutov.dev, app-emacs-dev <at> janestreet.com
> Date: Fri, 08 Aug 2025 16:34:10 -0400
> From: Spencer Baugh via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> Here's a patch to fix it by initializing these fields.
Thanks, but I don't think this is right. First,
update_processes_for_thread_death clears the .thread member of
fd_callback_info of those processes that were locked to the dying
thread. Second, wait_reading_process_output_unwind clears the
.waiting_thread member of fd_callback_info for all descriptors, when
we exit wait_reading_process_output (which is called by
accept-process-output). And finally, IMO it is wrong for the add_*_fd
functions to overwrite these two members, because they are set and
reset by other functions, mainly those which compute the wait mask for
the pselect call. add_*_fd should not touch these members.
I believe in this case update_processes_for_thread_death doesn't do
its job because your scenario kills the process before the thread
dies, and update_processes_for_thread_death only looks at the
processes that are in Vprocess_alist. So it is possible that all
that's missing is that delete_read_fd and delete_write_fd (which are
called from deactivate_process) should clear the .thread member of
fd_callback_info corresponding to the process's input and output
descriptors.
If that doesn't fix the issue with your reproducer, please investigate
why, and let's take it from there.
This bug report was last modified today.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.