Hello,

Milos Nikic, le mer. 16 sept. 2026 11:24:41 -0700, a ecrit:
> Here is a patch attached that tries to do what you suggested.

Applied, thanks!

> @@ -33,18 +33,18 @@ _ports_complete_deallocate (struct port_info *pi)
>  
>        pthread_rwlock_wrlock (&_ports_htable_lock);
>        refcounts_references (&pi->refcounts, &result);
> -      if (result.hard > 0 || result.weak > 0)
> +      if (result.hard > 0 || result.weak > 1)
>          {
>            /* A reference was reacquired through a hash table lookup.
> -             It's fine, we didn't touch anything yet. */
> -          /* XXX: This really shouldn't happen.  */
> -          assert_backtrace (! "reacquired reference w/o send rights");
> +             It's fine, we didn't touch anything yet.  */
>            pthread_rwlock_unlock (&_ports_htable_lock);
>            return;
>          }
>  
>        hurd_ihash_locp_remove (&_ports_htable, pi->ports_htable_entry);
>        hurd_ihash_locp_remove (&pi->bucket->htable, pi->hentry);
> +      /* Drop the reference held by the hash tables.  */
> +      refcounts_deref_weak (&pi->refcounts, &result);

It doesn't hurt, but I don't think it is really needed to drop that weak
ref? We free pi below anyway. Or is there some other check below?

Samuel

Reply via email to