[lttng-dev] userspace-rcu-0.8.6 problems on MacOSX

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Tue Mar 17 18:04:29 EDT 2015


----- Original Message -----
> 
> Thanks Mathieu! With all the latest fixes, liburcu master can now
> compile as-is on Mac.
> 
> 
> On 2015-03-15 9:17 PM, Mathieu Desnoyers wrote:
> >
> >> However, by doing so those tests now hang on my Mac test system (whereas
> >> before they would get skipped). Is it possible those tests don't even
> >> work on Mac?
> > Do they really hang, or just take a very long time to run ?
> > Can you reproduce this easily ?
> >
> >
> 
> Quite reproducible, yes. I let 'make regtest' run for a couple hours,
> and it stuck at:
> 
> cd ../benchmark && ./runall.sh && cd ..
> Executing batch RCU test
> ./test_urcu_gc 4 4 10 -d 0 -b 1
> 
> 
> Running the last command by hand also hangs. It's using very little CPU
> in both cases.

Here is the fix.

commit db21eff94739900b1ab51d231dfb281ead0a0fa5
Author: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Date:   Tue Mar 17 17:53:21 2015 -0400

    Fix: compat_futex_noasync race condition
    
    The Userspace RCU compatibility layer around sys_futex has a race
    condition which makes pretty much all "benchmark" tests hang pretty
    quickly on non-Linux systems (tested on Mac OS X).
    
    I narrowed it down to a bug in compat_futex_noasync: this compat layer
    uses a single pthread mutex and condition variable for all callers,
    independently of their uaddr. The FUTEX_WAKE performs a pthread cond
    broadcast to all waiters. FUTEX_WAIT must then compare *uaddr with val
    to see which thread has been awakened.
    
    Unfortunately, the check was not done again after each return from
    pthread_cond_wait(), thus causing the race.
    
    This race affects threads using the futex_noasync() compatibility layer
    concurrently, thus it affects only on non-Linux systems.
    
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>

It's in master, backported to stable-0.7 and stable-0.8.

We really need to gear up our CI with MacOSX support. I just bought
a mac mini for this purpose.

Thanks for the testing!

Mathieu


-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list