public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* preserving errno across user space probes?
@ 2013-04-22 21:07 Eric Wong
  2013-04-22 21:30 ` Josh Stone
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Wong @ 2013-04-22 21:07 UTC (permalink / raw)
  To: systemtap

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.

Thanks for any answer you may provide.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: preserving errno across user space probes?
  2013-04-22 21:07 preserving errno across user space probes? Eric Wong
@ 2013-04-22 21:30 ` Josh Stone
  0 siblings, 0 replies; 2+ messages in thread
From: Josh Stone @ 2013-04-22 21:30 UTC (permalink / raw)
  To: Eric Wong; +Cc: systemtap

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-22 21:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-22 21:07 preserving errno across user space probes? Eric Wong
2013-04-22 21:30 ` Josh Stone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).