-
Notifications
You must be signed in to change notification settings - Fork 566
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
CRASH (TOT suite/tests/common/decode) linux 32-bit test_modrm16 #105
Comments
From [email protected] on April 04, 2009 09:46:02 I'm going to disable the common.decode* tests for linux for now to get the test suite |
Re-evaluating as part of #1025: Mangling of far memref w/ 16-bit base or index reg fails: need 2nd scratch regCLOSED: [2021-01-21 Thu 16:14]
It has to spill a 2nd scratch b/c you can't combine 16-bit and 32-bit.
Mangling of far memref storing into xsp fails: can't pick xsp as index reg for part of manglingCLOSED: [2021-01-21 Thu 16:15]
That one we can fix by ruling out the dead reg if it's xsp. Enable test_data16_mbr on Linux 32-bit => immed signedness issueCLOSED: [2021-01-21 Thu 16:15]
First problem on enabling is:
Yet it does exist:
Huh, on re-run:
Non-det: must be the top bit of the immediate? Casting to short solves it. Enable test_data16_mbr on Linux 64-bitCLOSED: [2021-01-21 Thu 16:49] Infinite loop on test_data16_mbr_8. The code has a my_setjmp wrapper: that seems problematic, as there's an |
Fixes several issues as part of enabling the common.decode (and common.decode-stress) tests for 32-bit Linux: + Fix addr16 far ref mangling bugs: - We need a 2nd scratch reg for 16-bit addressing registers, with two steps to add to the segment base. - Xsp cannot be an index reg. + Enable test_data16_mbr on 32-bit Linux - Fix signedness problem in data16-call mangling code. - Update test and template. + Enable test_data16_mbr on 64-bit Linux - Eliminate the my_setjmp() layer, which adds an exposed retaddr on the longjmp return path. Fixes #105
From [email protected] on April 02, 2009 11:26:52
this was PR 305335: linux CRASH suite/tests/common/decode 32-bit test_modrm16
we never had time to track it down before but now we think we know what's
going on
pasting emails here that explain the bug and repercussions/solutions:
From: Derek Bruening
OK, let me know if I have this right: we end up executing from some data
region used by libc's sscanf, which we thus make read-only for code cache
consistency. But since we ourselves use libc's sscanf we end up tripping
our own write watchpoint and can't make forward progress.
Wow, that's a cool bug. Nice job tracking it down.
Some thoughts:
an interesting twist on the existing transparency dogma.
manner. E.g., if we had our own copy of sscanf inside our own library,
we would disallow the app from executing from it (we'd pretend it hit a
fault) and would not have this bug. The problem is that we're running
code from libc but we're not treating it as part of DR.
"__isoc99_sscanf@@GLIBC_2.7". If we can easily stop using sscanf it
would solve multiple problems.
heavyweight routines we use are only during init or exit. I was assuming
that the string routines, which are used in fragile locations, are very
clean and don't go writing to global data. That seems to not be the case
for sscanf.
consider libc.so part of DR when assigning blame: related issue
what this _IO_vfscanf code (if it's really in that routine at +1700) is
doing and what that memory region is but might not be worth the time.
segments (I mention this in Debugging.wiki). This seems like a major
missing feature so I hope there is a way and I've somehow overlooked it.
pathological transfer to a data section that we use, and make the decode
test a little better behaved to focus on decoding: which is what you were
suggesting earlier.
Note that one way to avoid using sscanf at runtime is to rely on the
all_memory_areas list, which was supposed to replace the /proc/self/maps
reading but has had some bugs/issues in the past where it gets out of sync
with the maps file. Xref issue #91 (need to watch SYS_brk), PR 213256
(kernel merging regions => mismatch), and PR 246897 (where we switched back
to using maps file on queries).
On Thu, Apr 02, 2009 at 12:38:20AM -0400, Qin Zhao wrote:
Original issue: http://code.google.com/p/dynamorio/issues/detail?id=105
The text was updated successfully, but these errors were encountered: