Re: [PATCH glibc-2.44] Fix __pthread_timedblock for hurd

Samuel Thibault <[email protected]>
Newsgroups gmane.os.hurd.bugs
Organization I am not organized
Message-ID <aojB9JBMm-Vzz1As@end>
Damien Zammit, le ven. 21 août 2026 08:44:24 +0000, a ecrit:
> In glibc pt-timedblock.c:
> 
>    if ((MSG_OPTIONS & MACH_RCV_INTERRUPT) != 0 && err == 
> MACH_RCV_INTERRUPTED)
>      return EINTR;
> 
> But MSG_OPTIONS is defined as 0, so this makes __pthread_timedblock 
> uninterruptible?

Yes, and that is expected, see the standard for pthread_mutex_timedlock
/ cond_timedwait: 

These functions shall not return an error code of [EINTR].

pthread locking functions are not interruptible. Only sem_wait is
interruptible.

> I am getting mach_msg_trap after mach_msg is sent and then a hang, if 
> you look at thread 11 in the previous backtrace.

But the question is: what was supposed to interrupt your timed block? Is
the condition of wake-up valid or not? Is the timeout value meaningful?

> I can't figure out if pt-timedblock-intr.c is selected or not at compile 
> time in glibc.
> Both versions seem to be in the htl/Makefile.

Both are compiled, yes. pt-timedblock-intr.c simply define the
interruptible __pthread_timedblock_intr version, which was probably used
before it got reimplemented into the current version.

Samuel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.