Bug 13440 - cast.exp fails on s390x umod cast in (kernel) begin probe
Summary: cast.exp fails on s390x umod cast in (kernel) begin probe
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Josh Stone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-26 14:21 UTC by Mark Wielaard
Modified: 2011-11-30 11:50 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2011-11-26 14:21:26 UTC
cast.exp will fail on s390x with a ERROR: kernel read fault at 0x000000004128dbba (addr) near identifier '@cast' at .../testsuite/systemtap.base/cast.stp:37:17

This is because that line does:

cast_data = @cast(get_sockaddr(data), "sockaddr", "<sys/socket.h>")->sa_data[0]

make_typequery will see the "<sys/socket.h>" and assume this is a user mode cast and generates a umod, not a kmod. dwarf_cast_query::handle_query_module() sees the umod and installs the uderef for user mode address access. This will then fail (correctly?) fail to access the address as user data.

We could fix the test by using "kernel<linux/socket.h>" which will generate a kmod instead of a umod. But the comment in the testcase seems to assume you can use a umod @cast in a begin probe.

I think we should not try to provide user space access in begin/end probes through casts and the test should be rewritten if it wants to also test umod casts.
Comment 1 Josh Stone 2011-11-26 19:08:32 UTC
Yes indeed, that test is making an assumption about user memory that doesn't hold.  I'll have to refactor that piece to a context with a real user address...
Comment 2 Josh Stone 2011-11-28 21:13:45 UTC
Please test s390x again with commit bc0251a6.
Comment 3 Mark Wielaard 2011-11-30 11:50:35 UTC
2.6.32-220.el6.s390x
Systemtap translator/driver (version 1.7/0.152 commit release-1.6-519-g174c4d7)

executing: stap /root/systemtap/testsuite/systemtap.base/cast-user.stp /root/sys
temtap/testsuite/cast-user.exe -c /root/systemtap/testsuite/cast-user.exe
PASS: cast-user
testcase /root/systemtap/testsuite/systemtap.base/cast-user.exp completed in 4 s
econds
Running /root/systemtap/testsuite/systemtap.base/cast.exp ...
executing: stap /root/systemtap/testsuite/systemtap.base/cast.stp
PASS: systemtap.base/cast.stp
testcase /root/systemtap/testsuite/systemtap.base/cast.exp completed in 4 seconds