On Thu, Aug 6, 2020 at 11:02 AM Nadav Har'El <[email protected]> wrote:

> The assert was there to make a rare random crash into a reliable crash.
> The thing is
> that symbol resolution needs to take a mutex, because in very rare cases
> it might be
> running in parallel to someone loading an additional shared object. This
> taking of a mutex
> may block the thread, and when in non-preemptable state, will cause a
> crash at that
> point. So the idea of the assert is to make you aware of this problem much
> earlier,
> before you start seeing it once a year in the field.
>

By the way, if this problem really bothered us, it should be possible with
relatively small effort to
make symbol-resolution lock-free. We actually have the list of objects
protected by RCU,
not a mutex (see commit 68afb68ee84769db064949839ee50bff08145c6e)
so it is already possible to do most of the lookup in a lock-free manner,
and we just
need to replace the last remaining mutexes in the resolv_pltgot code, which
might not
be difficult.

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/CANEVyjv81m6VXVi9OLsrhDYxfi2QSOc44WtiEA2PWbkKpPbkuQ%40mail.gmail.com.

Reply via email to