Skip to content

Commit

Permalink
i#4923: Add missing rseq mangling translation case
Browse files Browse the repository at this point in the history
Adds translation of the save of input registers to rseq sequences.

This fixes a hang on detach in the api.ir test on AArch64, which we
remove from the flaky list here.

Manually tested by running api.rseq 200x on the Jenkins machine.
Previously the test failed every single time there.

Issue: #4923, #4316, #4669
Fixes #4923
  • Loading branch information
derekbruening committed Feb 11, 2022
1 parent 532f5e7 commit 02330f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 13 additions & 1 deletion core/translate.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* **********************************************************
* Copyright (c) 2010-2021 Google, Inc. All rights reserved.
* Copyright (c) 2010-2022 Google, Inc. All rights reserved.
* Copyright (c) 2000-2010 VMware, Inc. All rights reserved.
* **********************************************************/

Expand Down Expand Up @@ -182,6 +182,18 @@ instr_is_rseq_mangling(dcontext_t *dcontext, instr_t *inst)
offsetof(dcontext_t, rseq_entry_state) +
sizeof(reg_t) * (dst - DR_REG_START_GPR))
return true;
} else if (instr_get_opcode(inst) == IF_X86_ELSE(OP_mov_st, OP_str) &&
opnd_is_reg(instr_get_src(inst, 0)) &&
opnd_is_base_disp(instr_get_dst(inst, 0))) {
reg_id_t dst = opnd_get_reg(instr_get_src(inst, 0));
opnd_t memref = instr_get_dst(inst, 0);
int disp = opnd_get_disp(memref);
if (reg_is_gpr(dst) && reg_is_pointer_sized(dst) &&
opnd_get_index(memref) == DR_REG_NULL &&
disp ==
offsetof(dcontext_t, rseq_entry_state) +
sizeof(reg_t) * (dst - DR_REG_START_GPR))
return true;
}
# ifdef AARCH64
if (instr_get_opcode(inst) == OP_mrs &&
Expand Down
1 change: 0 additions & 1 deletion suite/runsuite_wrapper.pl
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@
'code_api|linux.fib-conflict-early' => 1,
'code_api|linux.mangle_asynch' => 1,
'code_api|tool.drcachesim.phys' => 1, # i#4922
'code_api|api.rseq' => 1, # i#4923
'code_api|tool.drcachesim.TLB-threads' => 1, # i#4928
'code_api|tool.drcachesim.threads' => 1, # i#4928
'code_api,tracedump_text,tracedump_origins,syntax_intel|common.loglevel' => 1, # i#1807
Expand Down

0 comments on commit 02330f7

Please sign in to comment.