This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug runtime/3079] New: deref macro cannot read 64-bit values on 32-bit x86
- From: "joshua dot i dot stone at intel dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 16 Aug 2006 23:19:26 -0000
- Subject: [Bug runtime/3079] New: deref macro cannot read 64-bit values on 32-bit x86
- Reply-to: sourceware-bugzilla at sourceware dot org
On 32-bit x86, this fails:
function deref64:long() %{
int64_t a = 42;
THIS->__retvalue = deref(sizeof(a), &a);
if (0) {
deref_fault:
CONTEXT->last_error = "bad stuff happened";
}
%}
probe begin {
printf("%d\n", deref64())
exit()
}
Error messages:
...
{standard input}: Assembler messages:
{standard input}:8811: Error: suffix or operands invalid for `movq'
{standard input}:8815: Error: suffix or operands invalid for `xor'
...
This results from improper use of __get_user_asm(). In 32-bit mode, 'mov' and
'xor' cannot deal with 64-bit quantities.
Probably the fix will need to make two 32-bit calls to __get_user_asm to get the
whole 64-bit quantity (nothing says this needs to be atomic anyway). There's
still a problem with the "return-value" of deref, an intptr_t, as it can't hold
a 64-bit value. And we can't change the return type to int64_t, because that
won't cleanly typecast to pointers.
I imagine the semantics of deref will need to change a bit, perhaps to something
like this:
#define deref(var) deref_ex(typeof(var), sizeof(var), &(var))
#define deref_ex(type, size, addr) ... /* return type is (type) */
I will probably tackle this bug myself, but I wanted to solicit ideas/feedback
from others before I try it...
--
Summary: deref macro cannot read 64-bit values on 32-bit x86
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: runtime
AssignedTo: systemtap at sources dot redhat dot com
ReportedBy: joshua dot i dot stone at intel dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=3079
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.