c4-project / c4f

The C4 Concurrent C Fuzzer
MIT License
13 stars 1 forks source link

Fuzzer action: randomly promote atomic actions to RMWs #170

Open MattWindsor91 opened 4 years ago

MattWindsor91 commented 4 years ago

For example, of the form

x = atomic_load(&y, mo)
// ->
x = RANDOM;
atomic_compare_exchange(&y, &x, x, mo, mo);

This might be a difficult thing to angle in, because at the moment these loads tend not to appear in situations where we can easily just do this rewrite.

There may be a way to RMW stores, too, but I can't think of anything that's immediately obvious and wouldn't require a lot of extra dependency tracking. Except in dead code.