I thought it was about time to try and merge the various local fixes that I have been using to improve the success of the stress-ng test cases. The issue that this patch fixes was originally reported via https://lists.debian.org/debian-hurd/2025/08/msg00058.html.
In summary: 1) the RPC message header is modified within the call to mach_msg_trap from _hurd_intr_rpc_mach_msg() 2) the RPC eventually fails with EINTR returning to the mig generated code 3) that code calls __mig_dealloc_reply_port(InP->Head.msgh_reply_port) 4) __mig_dealloc_reply_port tests the supplied port is the same as the TLS which fails the assertion This assertion occurs infrequently during the process termination phase of the stress-ng test. It is most commonly raised by the stress-ng processes themselves. I have also witnessed this occurring within an ext2fs process which is more consequential. In those cases the assertion is not immediately apparent as the handling of the SIGABRT causes a deadlock within ext2fs and a probable system freeze. There are several other places within _hurd_intr_rpc_mach_msg() that restore content before resuming the RPC. This patch restores all the safeguarded state: rcv_name, remote_port, msgid, msgh_bits and save_data. My test case did not actually require restoration of msgid or remote_port but it seemed sensible to me to restore them anyway to cater for the event that they might be modified by other test scenarios or any future alterations to the server side of the message handling. The other parts of the code restore them so consistency seemed appropriate. Regards, Mike.
