libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libunwind] Re: multiple dynamic list-info addresses?


From: David Mosberger
Subject: [libunwind] Re: multiple dynamic list-info addresses?
Date: Wed, 31 Mar 2004 10:19:34 -0800

>>>>> On Wed, 31 Mar 2004 11:39:14 -0600 (CST), Todd L Miller <address@hidden> 
>>>>> said:

  Todd> True, but the situation doesn't improve much when you have two
  Todd> processes fighting over the same unwind list, either. :) I'm
  Todd> not sure how one does cross-process locking
  Todd> (/tmp/dynamic-unwind-<remote-pid>?), but I'm sure I don't have
  Todd> time to implement it.

Only one process can attach to another process at any given time, so
the only potential fight is between the process itself (the "target")
and the process that's attached via ptrace (the "attacher").  The
attacher can (and probably would anyhow) stop the target before trying
to register dynamic unwind info, so the only problem is if the target
is in the middle of registering dynamic unwind info itself.  It's
certainly possible to invent a protocol to handle this situation.  For
example, the most obvious one would be to single-step the target until
the registration is done (this shouldn't be as horrible as it sounds,
because _U_dyn_register() is a rather short routine).  To make this
work, you only need to be able to check whether the unwind-list lock
is taken.

  Todd> Anyway, it's something I wouldn't have thought of, and I'm glad
  Todd> you let me know.  It may just stew on my "known problems" list for a
  Todd> while, but that's OK.

I don't know the context of your tool/application, so you're the best
judge of that, but perhaps you could avoid linking in libunwind of you
find that the target already has a dynamic unwind list?

        --david


reply via email to

[Prev in Thread] Current Thread [Next in Thread]