Bug 670646 - Markers using %rbx register incorrectly masked to low byte
Summary: Markers using %rbx register incorrectly masked to low byte
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemtap
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Frank Ch. Eigler
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 670647
TreeView+ depends on / blocked
 
Reported: 2011-01-18 21:50 UTC by William Cohen
Modified: 2011-02-15 21:31 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 670647 (view as bug list)
Environment:
Last Closed: 2011-02-15 21:31:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description William Cohen 2011-01-18 21:50:23 UTC
When attempting to build an executable of Ruby that includes systemtap marker
using SystemTap 1.4 some arguments for markers were truncated to 8 bits in
size.

The problem is caused by the
sdt_uprobe_var_expanding_visitor::get_register_width() function "%rbx" as being
a bytes sized (8 bit) register rather that a full 64-bit registers.


To replicate problem on rhel6 or fedora:

1) install systemtap-1.4 on the machine
2a) make sure that the systemtap dtrace is available in /usr/bin/dtrace
2b) make sure that the uprobes modules is available, as root:

  make -C /usr/share/systemtap/runtime/uprobes

3) download the 
http://people.redhat.com/wcohen/ruby-1.8.7.299-6.el6.dtrace_4.src.rpm
3) build and install the ruby rpms
4) Verify that probes are available with:

 stap  -L  'process("/usr/lib64/libruby.so.1.8").mark("*")

5) Use the following script to demonstrate the problem 

 stap  -e  'probe
process("/usr/lib64/libruby.so.1.8").function("rb_class2name").return
{printf("$return=0x%x %s\n", $return, user_string($return))} probe
process("/usr/lib64/libruby.so.1.8").mark("function__entry"){printf("$arg1=0x%x\n",
$arg1)}'

in another window run a ruby program for example

 ruby ~/rpmbuild/BUILD/ruby-1.8.7.299/ruby-1.8.7-p299/sample/biorhythm.rb 

See something like the following out from the systemtap script where $arg1 is
just the low 8 bits of the pointer:

$return=0x9d4450 Hash
$arg1=0x50
$return=0x9c5c30 String
$arg1=0x30

Comment 1 Fedora Update System 2011-01-20 17:58:55 UTC
systemtap-1.4-2.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/systemtap-1.4-2.fc14

Comment 2 Fedora Update System 2011-01-20 18:00:17 UTC
systemtap-1.4-2.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/systemtap-1.4-2.fc13

Comment 3 Fedora Update System 2011-02-15 21:24:35 UTC
systemtap-1.4-2.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 4 Fedora Update System 2011-02-15 21:27:48 UTC
systemtap-1.4-2.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Frank Ch. Eigler 2011-02-15 21:31:32 UTC
fix in f13 through rawhide


Note You need to log in before you can comment on or make changes to this bug.