[Top][All Lists]

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

Re: [PATCH v9 0/2 hurd] Add irqhelp and clean up ddekit

From: Samuel Thibault
Subject: Re: [PATCH v9 0/2 hurd] Add irqhelp and clean up ddekit
Date: Sun, 10 Mar 2024 09:00:58 +0100
User-agent: NeoMutt/20170609 (1.8.3)


Damien Zammit, le dim. 10 mars 2024 02:32:48 +0000, a ecrit:
> No, and I'm glad you asked me to.  It seems that there is a bug in 
> mach_msg_server(),
> it does not exit the while(1) loop if the irq->port is deallocated.

Was that really the last reference to the port.

> Is this server supposed to exit?  It would make sense if it did.
> Should it check the refs on the port perhaps and break out of the loop if 
> there are none left?

When there are not refs left, the port is released and the name may be
reused for another port, so it doesn't make sense to test for "none
left". Also, it would make the msg loop much more expensive by making it
do mach_msg+mach_port_get_refs per loop instead of just mach_msg.

The port name should rather be turned into a dead name, by adding a send
ref to the port and deallocating the receive ref. That way the name
stays allocated, and just cannot be used for reception (unless there
is still another receive ref, thus the question above). The caller of
mach_msg_server can then finish the destruction of the port name.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]