<div dir="ltr">> One thing you could do is to make something like an rcu_assign_data()<br>> that does the assignment and checks rcu_read_ongoing().  Alternatively,<br>> if you are willing to put infrequent random delays in rcu_read_unlock(),<br>> an address sanitizer might detect the resulting use-after-free.<div><br></div><div>Sorry for being late to answer :/</div><div>I have thought of that but it's so easy to just not use rcu_assign_data() or a equivalent read function to check if the read is done within a read section. Maybe it's the best possible option</div><div><br></div><div>Thanks</div><div>Thobias</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">tor. 4. sep. 2025 kl. 20:06 skrev Thobias Knudsen <<a href="mailto:thobknu@gmail.com">thobknu@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>> I am confuse about the overall discussion here.  Are we talking about<br>> static checking of RCU pointers usage or runtime checking?<br>> <br>> Is is possible to see the implementation you made so I can understand<br>> better?</div><div><br></div>Sorry for being late to answer :/<div>The library overrides a subset of urcu and lfht functions with macros and replaces them with other functions which checks in runtime if the functions are called in the correct order.</div><div>here is the code: <a href="https://github.com/ThobiasKnudsen/urcu_lfht_safe" target="_blank">https://github.com/ThobiasKnudsen/urcu_lfht_safe</a><br><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">ons. 3. sep. 2025 kl. 03:35 skrev Olivier Dion <<a href="mailto:odion@efficios.com" target="_blank">odion@efficios.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, 02 Sep 2025, Thobias Knudsen via lttng-dev <<a href="mailto:lttng-dev@lists.lttng.org" target="_blank">lttng-dev@lists.lttng.org</a>> wrote:<br>
> Yes but all read/write operations doesn't have the syntax of a function as<br>
> you used in the example here i.e. use(...). When it is a function you can<br>
> easily just change the implementation to check if it is called inside a<br>
> read section. Some reads and writes are usually done by this syntax (a = b)<br>
> and '=' cannot be overridden.<br>
><br>
> BTW just saying that what we're talking about now is not the original<br>
> topic, but if someone has an elegant solution to this that would be<br>
> nice!<br>
<br>
I am confuse about the overall discussion here.  Are we talking about<br>
static checking of RCU pointers usage or runtime checking?<br>
<br>
Is is possible to see the implementation you made so I can understand<br>
better?<br>
<br>
Thanks,<br>
Olivier<br>
-- <br>
Olivier Dion<br>
EfficiOS Inc.<br>
<a href="https://www.efficios.com" rel="noreferrer" target="_blank">https://www.efficios.com</a><br>
<br>
</blockquote></div>
</blockquote></div>