-
Notifications
You must be signed in to change notification settings - Fork 143
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
Remove illegal instruction from tests #210
Remove illegal instruction from tests #210
Conversation
The code segment (CS) register cannot be explicitly loaded, unlike the other segment registers. The instruction `mov cs, rax` is thus illegal, and triggered a SIGILL for each test case, causing all tests to spuriously succeed.
The commit that first added this included an illegal instruction, which caused false positives and hid the fact that this is redundant.
This reverts commit 9a9f370. The bug in lifting-bits#205 is what made it seem like the underlying issue here had been addressed.
I'm seeing lots of failures for
|
I think what is happening is that the |
@pgoodman I just did one last double-check on my local box right now with fully-rebuilt Docker images, and actually am getting some of the CI errors— I think I had some stale state when locally testing the last commit. I'm going to try it (a) without checking the CS register, (b) without saving any segment registers. |
This could be an artefact of the test runner being a 64-bit program, even when running the 32-bit tests. Specifically, we'll need to figure out if the running |
What I'm getting at is that, the |
@pgoodman that's consistent with what I see locally on a totally fresh image: I'm saving all the segment registers except CS, and all tests pass. I could amend the last commit to save all the seg registers except CS, and we could open a separate issue for the 32/64-bit(?) CS situation. |
Okay, not including the CS register gets rid of almost all of the CI test failures (on that run, anyway). Locally, I observe no test failures if I exclude the CS register. |
61c4f3d
to
ca8b92c
Compare
I've amended the last commit to exclude CS, which ensures we have only CI failures for now. |
37566e9
to
bd3779c
Compare
bd3779c
to
57a1cb2
Compare
tests/X86/Run.cpp
Outdated
// CPUID.(EAX=07H,ECX=0H):EBX[bit 13] = 1 | ||
// | ||
// Where "bit 13" is a 0-based index. | ||
static bool AreFCSAndFDSDeprecated() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(void)
as param list.
@@ -458,6 +490,14 @@ static void RunWithFlags(const test::TestInfo *info, | |||
memset(lifted_state->x87.fxsave.st, 0, kill_size); | |||
memset(native_state->x87.fxsave.st, 0, kill_size); | |||
|
|||
#if 32 == ADDRESS_SIZE_BITS | |||
// If FCS and FDS are deprecated, don't compare them. | |||
if (AreFCSAndFDSDeprecated()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (32 == ADDRESS_SIZE_BITS && ...)
, that way we don't get a compiler warning about AreFCSAndFDSDeprecated
being unused.
57a1cb2
to
4d1bcd6
Compare
@@ -458,6 +490,14 @@ static void RunWithFlags(const test::TestInfo *info, | |||
memset(lifted_state->x87.fxsave.st, 0, kill_size); | |||
memset(native_state->x87.fxsave.st, 0, kill_size); | |||
|
|||
#if 32 == ADDRESS_SIZE_BITS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant to remove the #if
and just depend on the actual if
:-P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that makes more sense (-:
The reason I used #if
is because the referenced fields don't exist in 64-bit mode, so you get a compiler error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh duh! I didn't make that connection.. lol. So then the additional check in the if
is unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently not? One moment...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, yes, the #if
is necessary, I just assumed you were talking about some other warning I missed. Reverting the redundant expression.
4d1bcd6
to
14b7877
Compare
Tests pass locally for me, but CI fails right now, likely due to #187 being hidden by #205.