[LTP] [PATCH] pause01: race condition

Cyril Hrubis chrubis@suse.cz
Wed Apr 6 12:43:55 CEST 2016


Hi!
> > Alarm may come before pause() is called, and be hiddenly dropped by go()
> > handler. Next pause() call hangs test forever.
> > 
> > Next hack helps me, though it's not a proper fix. Frankly, I don't
> > realise how to fix the test properly because sequence of settimer() and
> > pause() is not atomic, and any il_value we choose is not safe.
> 
> I've seen this hang once in past. At the time I was thinking
> we use 2 processes. Parent will fork a child and wait.
> Just before child calls pause() we signal parent and
> parent will call tst_process_state_wait() to wait until
> child process falls asleep (on pause() call).
> Then parent can send a signal to child and check it wakes up.

I was about to suggest the same.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list