Link [ NetBSD | NetBSD OpenGrok source search | PR fulltext-search | Summary of daily snapshot builds | history of daily build result | pkgsrc commit viewer ]


   
        usage: [branch:branch] [user:user] [path@revision] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN sys/arch/arm, if_wm.c@1.234 )




switch to index mode

recent branches: MAIN (45m)  netbsd-10 (4d)  netbsd-9 (4d)  netbsd-8 (9d) 

2024-05-20 20:21:41 UTC Now

2021-08-05 23:23:50 UTC thorpej-futex2 commitmail json YAML

At the end of futex_wait(), when sleepq_block() returns 0, we would like
to assert that l->l_futex == NULL, because all of the code paths that awaken
a blocked thread in sys_futex.c itself clear l->l_futex.  Unfortunately,
there are certain received-a-signal situations (e.g. SIGKILL) where
sleepq_block() will not return an error after being awakened by the signal,
rendering this assertion too strong.

So, rather than going down the rabbit hole of reasoning out and altering
long-standing behavior of the signals code, just don't assert there and
treat a zero-return from sleepq_block() as an aborted futex wait if
l->l_futex != NULL.

(Thanks chs@ for helping chase this one down.)

(thorpej)