-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stoke testcase sometimes misses a "line" (8 bytes) of valid memory addresses #27
Comments
I don't think this is a stoke bug. After following your instructions, disassembling ./testcase using objdump shows this source for myhello:
which is generated from your source:
Notice that gcc has introduced calls to push and pop, which are implicitly affecting rsp. The first row in your example is where the value of rbp is being pushed/popped. The second is where both of your movls are going. If you want to embed assembly, a safer way to do this is by compiling a separate translation unit for myhello:
Compiling this in a separate translation unit:
Declaring myhello as extern in testcase.cc
And then linking against myhello.o
|
Gah. Sorry to take your time. I think I had originally tried your Berkeley On 06/16/2014 05:22 PM, eric schkufza wrote:
|
Go for it. You can check out some of my example directories for examples of On Tue, Jun 17, 2014 at 6:26 AM, Berkeley Churchill <
|
HOTFIX
I have no idea what's causing this.
To reproduce, checkout the feature-stego branch, and navigate to /examples/flowershell
gcc -std=c99 testcase.c -o testcase
stoke testcase --config testcase.conf
To see there's a problem
stoke debug sandbox --target bins/hello.s --index 0 --testcases testcase.tc
You'll notice that all the testcases will have:
[ 00007fff 71855778 - 00007fff 71855760 ]
[ 2 valid rows shown ]
00007fff 71855770 v v v v v v v v 00 00 00 00 00 00 00 00
00007fff 71855760 v v v v v v v v 00 00 00 00 00 00 00 00
(or similar)
but they really need to have
[ 00007fff 71855778 - 00007fff 71855760 ]
[ 3 valid rows shown ]
00007fff 71855770 v v v v v v v v 00 00 00 00 00 00 00 00
00007fff 71855768 v v v v v v v v 00 00 00 00 00 00 00 00
00007fff 71855760 v v v v v v v v 00 00 00 00 00 00 00 00
I'm actually not sure if the two rows included are needed at all -- I'm touching exactly the 8 bytes of memory on the second line.
The text was updated successfully, but these errors were encountered: