This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: preserving errno across user space probes?


On 04/22/2013 02:07 PM, Eric Wong wrote:
> Hi, do user space probes write to errno at all?  I don't expect they
> would, but I'd like to be certain.
> 
> I'd rather not need redundant code to preserve errno on my own.

With kernel uprobes, errno should not be affected at all (unless you're
explicitly setting it, of course).

With --runtime=dyninst in systemtap 2.0, we were not properly saving
errno, so it was quite possible that errno could be clobbered as the
runtime or your tapset calls used glibc functions.  In systemtap 2.1 (w/
commit 944c9a7a) we do save/restore errno, so you shouldn't need to do
anything.

It occurs to me know that --runtime=dyninst users might *want* to affect
errno, but the save/restore will actually defeat this.  If people do
want this, we'll need some tapset get/set functions to influence the
program's real value.

For that matter, even setting registers currently won't work in Dyninst
mode, due to limitations in how registers are presented to us.  We
should fix this eventually too, but it will require changes in Dyninst
itself.  A couple of us are going to their annual meeting next week, so
I'll try to remember to bring this up.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]