DynamoRIO / DynamoRIO/dynamorio

invalid instruction handling: same across plaforms, and cleanly presented to clients

Open
#1,000 3 comments 0 reactions 0 assignees View on GitHub
Component-API Migrated Priority-Medium Type-Feature Usability
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 18h
Merged PRs (30d)
30

Description

_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on December 03, 2012 17:25:27_

on windows we don't pass an invalid instr to the app: we assume we know
that it's invalid and we forge the exception

on linux: we set up a bb w/ an invalid instr which we then execute, mainly
b/c we can't easily emulate a core dump from user mode.

short-term: hide the invalid instr from the client to match windows and
avoid issues w/ clients handling invalid instrs.

long-term: client may want to change the instr, so we should present the
bb. we then need to decide how the API should handle them:

1) instruct clients to always check for invalid instrs before doing any
queries on them. change our samples to do so. could use an iterator
that skips both meta and invalid (xref issue #998 ).

2) make all of our IR routines all
gracefully handle them. for some cases, like iterating over operands,
this is appealing: an invalid instr just has 0 operands. but this
doesn't seem a feasible solution in general, b/c some routines, like
instr_length(), need to return an error: and then the client has to check
for errors anyway. but we should probably make some IR routines handle
them rather than requiring a check in the caller.

3) Qin's proposal: have a separate bb event for invalid instrs
(we separate to own bb).

_Original issue: http://code.google.com/p/dynamorio/issues/detail?id=1000_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.