* [Bug runtime/21996] New: on 32-bit f26, we're getting dyninst errors when using intptr_t
@ 2017-08-23 16:13 dsmith at redhat dot com
2017-08-23 16:35 ` [Bug runtime/21996] " dsmith at redhat dot com
0 siblings, 1 reply; 2+ messages in thread
From: dsmith at redhat dot com @ 2017-08-23 16:13 UTC (permalink / raw)
To: systemtap
https://sourceware.org/bugzilla/show_bug.cgi?id=21996
Bug ID: 21996
Summary: on 32-bit f26, we're getting dyninst errors when using
intptr_t
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: runtime
Assignee: systemtap at sourceware dot org
Reporter: dsmith at redhat dot com
Target Milestone: ---
We're getting dyninst compile errors on 4.12.5-300.fc26.i686+PAE:
====
# stap -p4 -e 'probe process("/bin/ls").begin { print("ls begin") }'
--runtime=dyninst
/usr/local/share/systemtap/runtime/vsprintf.c: In function
‘_stp_vsprint_memory’:
/tmp/stapp2dMC2/stap_9b5821bc23dbd7ecd0e5e5915c67fcbc_904_src.c:3:27: error:
format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has
type ‘int’ [-Werror=format=]
#define STAP_MSG_LOC2C_01 "read fault [man error::fault] at 0x%lx"
^
/tmp/stapp2dMC2/stap_9b5821bc23dbd7ecd0e5e5915c67fcbc_904_src.c:3:27: note: in
definition of macro ‘STAP_MSG_LOC2C_01’
#define STAP_MSG_LOC2C_01 "read fault [man error::fault] at 0x%lx"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/share/systemtap/runtime/dyninst/loc2c-runtime.h:40:6: note: in
expansion of macro ‘DEREF_FAULT’
DEREF_FAULT(ptr); \
^~~~~~~~~~~
/usr/local/share/systemtap/runtime/vsprintf.c:364:16: note: in expansion of
macro ‘uread’
c_tmp = uread((unsigned char *)(ptr));
^~~~~
/tmp/stapp2dMC2/stap_9b5821bc23dbd7ecd0e5e5915c67fcbc_904_src.c:3:27: error:
format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has
type ‘int’ [-Werror=format=]
#define STAP_MSG_LOC2C_01 "read fault [man error::fault] at 0x%lx"
^
/tmp/stapp2dMC2/stap_9b5821bc23dbd7ecd0e5e5915c67fcbc_904_src.c:3:27: note: in
definition of macro ‘STAP_MSG_LOC2C_01’
#define STAP_MSG_LOC2C_01 "read fault [man error::fault] at 0x%lx"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/share/systemtap/runtime/dyninst/loc2c-runtime.h:40:6: note: in
expansion of macro ‘DEREF_FAULT’
DEREF_FAULT(ptr); \
^~~~~~~~~~~
/usr/local/share/systemtap/runtime/dyninst/loc2c-runtime.h:75:15: note: in
expansion of macro ‘uread’
#define kread uread
^~~~~
/usr/local/share/systemtap/runtime/vsprintf.c:366:16: note: in expansion of
macro ‘kread’
c_tmp = kread((unsigned char *)(ptr));
^~~~~
/tmp/stapp2dMC2/stap_9b5821bc23dbd7ecd0e5e5915c67fcbc_904_src.c:3:27: error:
format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has
type ‘int’ [-Werror=format=]
#define STAP_MSG_LOC2C_01 "read fault [man error::fault] at 0x%lx"
^
/tmp/stapp2dMC2/stap_9b5821bc23dbd7ecd0e5e5915c67fcbc_904_src.c:3:27: note: in
definition of macro ‘STAP_MSG_LOC2C_01’
#define STAP_MSG_LOC2C_01 "read fault [man error::fault] at 0x%lx"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/share/systemtap/runtime/dyninst/loc2c-runtime.h:40:6: note: in
expansion of macro ‘DEREF_FAULT’
DEREF_FAULT(ptr); \
^~~~~~~~~~~
/usr/local/share/systemtap/runtime/vsprintf.c:378:13: note: in expansion of
macro ‘uread’
*str++ = uread((unsigned char *)(ptr));
^~~~~
/tmp/stapp2dMC2/stap_9b5821bc23dbd7ecd0e5e5915c67fcbc_904_src.c:3:27: error:
format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has
type ‘int’ [-Werror=format=]
#define STAP_MSG_LOC2C_01 "read fault [man error::fault] at 0x%lx"
^
/tmp/stapp2dMC2/stap_9b5821bc23dbd7ecd0e5e5915c67fcbc_904_src.c:3:27: note: in
definition of macro ‘STAP_MSG_LOC2C_01’
#define STAP_MSG_LOC2C_01 "read fault [man error::fault] at 0x%lx"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/share/systemtap/runtime/dyninst/loc2c-runtime.h:40:6: note: in
expansion of macro ‘DEREF_FAULT’
DEREF_FAULT(ptr); \
^~~~~~~~~~~
/usr/local/share/systemtap/runtime/dyninst/loc2c-runtime.h:75:15: note: in
expansion of macro ‘uread’
#define kread uread
^~~~~
/usr/local/share/systemtap/runtime/vsprintf.c:380:20: note: in expansion of
macro ‘kread’
*str++ = kread((unsigned char *)(ptr));
^~~~~
cc1: all warnings being treated as errors
WARNING: gcc exited with status: 1
Pass 4: compilation failed. [man error::pass4]
====
Here's what's going on.
DEREF_FAULT is defined in runtime/loc2c-runtime.h as:
====
#define DEREF_FAULT(addr) ({ \
snprintf(c->error_buffer, sizeof(c->error_buffer), \
STAP_MSG_LOC2C_01, (intptr_t)(addr)); \
c->last_error = c->error_buffer; \
goto deref_fault; \
})
====
STAP_MSG_LOC2C_01 is defined in translate.cxx as:
====
#define STAP_MSG_LOC2C_01 "read fault [man error::fault] at 0x%lx"
====
So, back in DEREF_FAULT(), the format string expects that 'addr' get cast to a
long (since the format string has '%lx').
On a 32-bit platform, sizeof(int) == sizeof(long) == 4 bytes == 32 bits. An
'intptr_t' is defined as an integer type capable of holding a pointer. So, on a
32-bit platform, that could be an 'int' or a 'long'. On F26 i686,
/usr/include/stdint.h defines it as an 'int'. Defining 'intptr_t' as an int is
fine, since it can hold a pointer (32-bits or 4 bytes). But, that print format
string expects it to be a long, hence the error.
(Note that this didn't happen with the pre-bpf code.)
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug runtime/21996] on 32-bit f26, we're getting dyninst errors when using intptr_t
2017-08-23 16:13 [Bug runtime/21996] New: on 32-bit f26, we're getting dyninst errors when using intptr_t dsmith at redhat dot com
@ 2017-08-23 16:35 ` dsmith at redhat dot com
0 siblings, 0 replies; 2+ messages in thread
From: dsmith at redhat dot com @ 2017-08-23 16:35 UTC (permalink / raw)
To: systemtap
https://sourceware.org/bugzilla/show_bug.cgi?id=21996
David Smith <dsmith at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #1 from David Smith <dsmith at redhat dot com> ---
Fixed in commit b38701fac.
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-23 16:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23 16:13 [Bug runtime/21996] New: on 32-bit f26, we're getting dyninst errors when using intptr_t dsmith at redhat dot com
2017-08-23 16:35 ` [Bug runtime/21996] " dsmith at redhat 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).