Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

[x86/Linux] Fix "Bad opcode" assert in unwindLazyState #8609

Merged
merged 3 commits into from
Dec 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion compileoptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ if (CLR_CMAKE_PLATFORM_UNIX)
# We cannot enable "stack-protector-strong" on OS X due to a bug in clang compiler (current version 7.0.2)
add_compile_options(-fstack-protector)
else()
add_compile_options(-fstack-protector-strong)
if(NOT CLR_CMAKE_PLATFORM_ARCH_I386)
# x86 unwinder cannot handle stack protection code, yet
# see https://github.com/dotnet/coreclr/issues/8625 for details
add_compile_options(-fstack-protector-strong)
endif(NOT CLR_CMAKE_PLATFORM_ARCH_I386)
endif(CLR_CMAKE_PLATFORM_DARWIN)

add_definitions(-DDISABLE_CONTRACTS)
Expand Down
8 changes: 8 additions & 0 deletions src/vm/i386/gmsx86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,10 @@ void LazyMachState::unwindLazyState(LazyMachState* baseState,
ip += 2;
break;

case 0x34: // XOR AL, imm8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please put both changes in this file under FEATURE_PAL ifdef? I would prefer not to change the behavior for Windows here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

ip += 2;
break;

case 0x31:
case 0x32:
case 0x33:
Expand Down Expand Up @@ -879,6 +883,10 @@ void LazyMachState::unwindLazyState(LazyMachState* baseState,
datasize = b16bit?2:4;
goto decodeRM;

case 0x24: // AND AL, imm8
ip += 2;
break;

case 0x01: // ADD mod/rm
case 0x03:
case 0x29: // SUB mod/rm
Expand Down