public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug tapsets/20618] New: Cannot get the real syscall return code value
@ 2016-09-19  2:57 mysecondaccountabc at gmail dot com
  2016-09-19 15:44 ` [Bug tapsets/20618] " fche at redhat dot com
  2016-09-20  4:34 ` mysecondaccountabc at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: mysecondaccountabc at gmail dot com @ 2016-09-19  2:57 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20618

            Bug ID: 20618
           Summary: Cannot get the real syscall return code value
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: mysecondaccountabc at gmail dot com
  Target Milestone: ---

We need to get the syscall return value and the errno separately. However, when
for instance, the connect syscall is executed in a non-blocking socket and it
returns -1 and errno=115 (EINPROGRESS) all we get in a "probe syscall.*.return"
is:
  returnval() = -115
  retstr = "-115 (EINPROGRESS)"

We couldn't find in any part of the documentation that returnval() or the
syscall return value will be replaced with the errno value, so I wonder if it's
a bug or in any case, how can we get/recover the original syscall return code?

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug tapsets/20618] Cannot get the real syscall return code value
  2016-09-19  2:57 [Bug tapsets/20618] New: Cannot get the real syscall return code value mysecondaccountabc at gmail dot com
@ 2016-09-19 15:44 ` fche at redhat dot com
  2016-09-20  4:34 ` mysecondaccountabc at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fche at redhat dot com @ 2016-09-19 15:44 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20618

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |codonell at redhat dot com,
                   |                            |fche at redhat dot com
         Resolution|---                         |WORKSFORME

--- Comment #1 from Frank Ch. Eigler <fche at redhat dot com> ---
> We couldn't find in any part of the documentation that returnval() or the
> syscall return value will be replaced with the errno value [...]

It turns out that this is an artefact of how linux system calls
work.  A positive/zero return value is success, a negative
return value usually is an error code that the glibc runtime will
shift into the global 'errno'.  At the low systemtap level, the
negative errno -is- the genuine return value from the syscall.

Unfortunately, we don't have convenient probes at the glibc level
to observe the C-level aftereffects properly.  There is a glibc
RFE open (for quite some time now) for them to insert some sys/sdt.h
markers, so that stap could present the cooked results properly.

(RHers, see also https://bugzilla.redhat.com/show_bug.cgi?id=742034 .)

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug tapsets/20618] Cannot get the real syscall return code value
  2016-09-19  2:57 [Bug tapsets/20618] New: Cannot get the real syscall return code value mysecondaccountabc at gmail dot com
  2016-09-19 15:44 ` [Bug tapsets/20618] " fche at redhat dot com
@ 2016-09-20  4:34 ` mysecondaccountabc at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: mysecondaccountabc at gmail dot com @ 2016-09-20  4:34 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20618

--- Comment #2 from Gustavo Moreira <mysecondaccountabc at gmail dot com> ---
Ouch I see, thank you for the quick response.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

end of thread, other threads:[~2016-09-20  4:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-19  2:57 [Bug tapsets/20618] New: Cannot get the real syscall return code value mysecondaccountabc at gmail dot com
2016-09-19 15:44 ` [Bug tapsets/20618] " fche at redhat dot com
2016-09-20  4:34 ` mysecondaccountabc at gmail dot com

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).