Comments (9)
The issue is, arpl
is a oneByteMap instruction that becomes movslq
when it is REX prefixed. We don't have any way of differentiating between REX and non REX prefixed instructions.
from dyninst.
Current fix seems to lead to an assertion failure at
4591c1: 48 63 ff movslq %edi,%rdi
from dyninst.
Could you post that stacktrace of your issue? I'm getting an assert in instructionAPI and I think your assert was in common.
from dyninst.
Here it is.
#0 0x00007ffff5b8e5d7 in raise () from /lib64/libc.so.6
#1 0x00007ffff5b8fcc8 in abort () from /lib64/libc.so.6
#2 0x00007ffff5b87546 in __assert_fail_base () from /lib64/libc.so.6
#3 0x00007ffff5b875f2 in __assert_fail () from /lib64/libc.so.6
#4 0x00007ffff67a835f in NS_x86::ia32_decode (capa=capa@entry=1, addr=<optimized out>, instruct=...) at /p/paradyn/development/xmeng/dyninstapi/dyninst_development/dyninst/common/src/arch-x86.C:8703
#5 0x00007ffff7643817 in Dyninst::InstructionAPI::InstructionDecoder_x86::doIA32Decode (this=0x13e1790, b=...)
at /p/paradyn/development/xmeng/dyninstapi/dyninst_development/dyninst/instructionAPI/src/InstructionDecoder-x86.C:1714
#6 0x00007ffff7643d59 in Dyninst::InstructionAPI::InstructionDecoder_x86::decodeOpcode (this=<optimized out>, b=...)
at /p/paradyn/development/xmeng/dyninstapi/dyninst_development/dyninst/instructionAPI/src/InstructionDecoder-x86.C:1772
#7 0x00007ffff77542b4 in Dyninst::InstructionAPI::InstructionDecoderImpl::decode (this=0x13e1790, b=...) at /p/paradyn/development/xmeng/dyninstapi/dyninst_development/dyninst/instructionAPI/src/InstructionDecoderImpl.C:56
#8 0x00007ffff763de49 in Dyninst::InstructionAPI::InstructionDecoder_x86::decode (this=<optimized out>, b=...)
at /p/paradyn/development/xmeng/dyninstapi/dyninst_development/dyninst/instructionAPI/src/InstructionDecoder-x86.C:1836
#9 0x00007ffff763dc5c in Dyninst::InstructionAPI::InstructionDecoder::decode (this=this@entry=0x7fffffffd240) at /p/paradyn/development/xmeng/dyninstapi/dyninst_development/dyninst/instructionAPI/src/InstructionDecoder.C:65
#10 0x00007ffff7b662ac in Dyninst::InsnAdapter::IA_IAPI::isStackFramePreamble (this=this@entry=0x7fffffffd310) at /p/paradyn/development/xmeng/dyninstapi/dyninst_development/dyninst/parseAPI/src/IA_x86.C:415
#11 0x00007ffff79c5c1c in Dyninst::ParseAPI::Parser::init_frame (this=this@entry=0x111b7c0, frame=...) at /p/paradyn/development/xmeng/dyninstapi/dyninst_development/dyninst/parseAPI/src/Parser.C:781
#12 0x00007ffff79c7534 in Dyninst::ParseAPI::Parser::parse_vanilla (this=this@entry=0x111b7c0) at /p/paradyn/development/xmeng/dyninstapi/dyninst_development/dyninst/parseAPI/src/Parser.C:273
#13 0x00007ffff79c789d in Dyninst::ParseAPI::Parser::parse (this=0x111b7c0) at /p/paradyn/development/xmeng/dyninstapi/dyninst_development/dyninst/parseAPI/src/Parser.C:157
#14 0x0000000000400f11 in main (argc=<optimized out>, argv=<optimized out>) at indirect.cpp:74
from dyninst.
I think I figured it out, there was a table indexing issue where the decoder went passed the end of the table (oops).
from dyninst.
We are moving on the right direction, but not there yet. Objdump shows:
9b4da2: 4c 63 cb movslq %ebx,%r9
I got
9b4da2 : movslq RBX, R9
The operand order and the operand size (ebx vs rbx) seem different.
from dyninst.
You're right, I added them in AT&T syntax order and dyninst was uses Intel order.
from dyninst.
I don't think there will be any semantics for that instruction because I just added it to dyninst, is that okay?
from dyninst.
After adding that change, I am now getting an assert in the x86 instruction semantics:
#0 0x00007ffff4a51a28 in raise () from /usr/lib64/libc.so.6
#1 0x00007ffff4a5362a in abort () from /usr/lib64/libc.so.6
#2 0x00007ffff4a4a227 in __assert_fail_base () from /usr/lib64/libc.so.6
#3 0x00007ffff4a4a2d2 in __assert_fail () from /usr/lib64/libc.so.6
#4 0x00007ffff7a241ad in X86_64InstructionSemantics<Dyninst::DataflowAPI::SymEvalPolicy_64, Dyninst::DataflowAPI::Handle>::read8 (this=0x7fffffffb230, e=0x3ca2860)
at /home/detter/Workspace/xmeng-test/dataflowAPI/src/../rose/x86_64InstructionSemantics.h:186
#5 0x00007ffff79cecbe in X86_64InstructionSemantics<Dyninst::DataflowAPI::SymEvalPolicy_64, Dyninst::DataflowAPI::Handle>::translate (this=0x7fffffffb230, insn=0x39d1200)
at /home/detter/Workspace/xmeng-test/dataflowAPI/src/../rose/x86_64InstructionSemantics.h:753
#6 0x00007ffff799d375 in X86_64InstructionSemantics<Dyninst::DataflowAPI::SymEvalPolicy_64, Dyninst::DataflowAPI::Handle>::processInstruction (this=0x7fffffffb230, insn=0x39d1200)
at /home/detter/Workspace/xmeng-test/dataflowAPI/src/../rose/x86_64InstructionSemantics.h:2732
#7 0x00007ffff7999e8d in Dyninst::DataflowAPI::SymbolicExpansion::expandX86_64 (
rose_insn=0x39d1200, policy=...)
at /home/detter/Workspace/xmeng-test/dataflowAPI/src/SymbolicExpansion.C:60
#8 0x00007ffff7a54c07 in Dyninst::DataflowAPI::SymEval::expandInsn (insn=...,
addr=9390605, res=std::map with 1 elements = {...})
at /home/detter/Workspace/xmeng-test/dataflowAPI/src/SymEval.C:455
#9 0x00007ffff7a52d69 in Dyninst::DataflowAPI::SymEval::expand (
res=std::map with 1 elements = {...}, failedInsns=std::set with 0 elements,
applyVisitors=false) at /home/detter/Workspace/xmeng-test/dataflowAPI/src/SymEval.C:93
#10 0x00007ffff7a52b94 in Dyninst::DataflowAPI::SymEval::expand (assignment=...,
applyVisitors=false) at /home/detter/Workspace/xmeng-test/dataflowAPI/src/SymEval.C:74
#11 0x00007ffff78a24c3 in JumpTablePred::ExpandAssignment (this=0x7fffffffcaf0, assign=...)
at /home/detter/Workspace/xmeng-test/parseAPI/src/JumpTablePred.C:402
#12 0x00007ffff78a0b8d in JumpTablePred::addNodeCallback (this=0x7fffffffcaf0, ap=...,
visitedEdges=std::set with 0 elements)
at /home/detter/Workspace/xmeng-test/parseAPI/src/JumpTablePred.C:193
#13 0x00007ffff793f511 in Dyninst::Slicer::updateAndLink (this=0x7fffffffcbd0, g=...,
dir=Dyninst::Slicer::backward, cand=..., cache=..., p=...)
at /home/detter/Workspace/xmeng-test/dataflowAPI/src/slicing.C:398
#14 0x00007ffff793e8a6 in Dyninst::Slicer::sliceInternalAux (this=0x7fffffffcbd0, g=...,
dir=Dyninst::Slicer::backward, p=..., cand=..., skip=false,
visited=std::map with 4 elements = {...},
singleCache=std::map with 5 elements = {...}, cache=std::map with 0 elements)
at /home/detter/Workspace/xmeng-test/dataflowAPI/src/slicing.C:231
#15 0x00007ffff793ee61 in Dyninst::Slicer::sliceInternalAux (this=0x7fffffffcbd0, g=...,
dir=Dyninst::Slicer::backward, p=..., cand=..., skip=false,
visited=std::map with 4 elements = {...},
singleCache=std::map with 5 elements = {...}, cache=std::map with 0 elements)
at /home/detter/Workspace/xmeng-test/dataflowAPI/src/slicing.C:307
#16 0x00007ffff793ee61 in Dyninst::Slicer::sliceInternalAux (this=0x7fffffffcbd0, g=...,
dir=Dyninst::Slicer::backward, p=..., cand=..., skip=false,
visited=std::map with 4 elements = {...},
singleCache=std::map with 5 elements = {...}, cache=std::map with 0 elements)
at /home/detter/Workspace/xmeng-test/dataflowAPI/src/slicing.C:307
#17 0x00007ffff793ee61 in Dyninst::Slicer::sliceInternalAux (this=0x7fffffffcbd0, g=...,
dir=Dyninst::Slicer::backward, p=..., cand=..., skip=false,
visited=std::map with 4 elements = {...},
singleCache=std::map with 5 elements = {...}, cache=std::map with 0 elements)
at /home/detter/Workspace/xmeng-test/dataflowAPI/src/slicing.C:307
#18 0x00007ffff793ee61 in Dyninst::Slicer::sliceInternalAux (this=0x7fffffffcbd0, g=...,
dir=Dyninst::Slicer::backward, p=..., cand=..., skip=true,
visited=std::map with 4 elements = {...},
singleCache=std::map with 5 elements = {...}, cache=std::map with 0 elements)
at /home/detter/Workspace/xmeng-test/dataflowAPI/src/slicing.C:307
#19 0x00007ffff793e56b in Dyninst::Slicer::sliceInternal (this=0x7fffffffcbd0,
dir=Dyninst::Slicer::backward, p=...)
at /home/detter/Workspace/xmeng-test/dataflowAPI/src/slicing.C:195
#20 0x00007ffff7943bc8 in Dyninst::Slicer::backwardSlice (this=0x7fffffffcbd0,
predicates=...) at /home/detter/Workspace/xmeng-test/dataflowAPI/src/slicing.C:1394
#21 0x00007ffff78d0869 in IndirectControlFlowAnalyzer::NewJumpTableAnalysis (
this=0x7fffffffd080, outEdges=std::vector of length 0, capacity 0)
at /home/detter/Workspace/xmeng-test/parseAPI/src/IndirectAnalyzer.C:45
#22 0x00007ffff78823ed in Dyninst::InsnAdapter::IA_x86Details::parseJumpTable (
this=0x2d8c8b0, currFunc=0x1288f90, currBlk=0x39c3930,
outEdges=std::vector of length 0, capacity 0)
at /home/detter/Workspace/xmeng-test/parseAPI/src/IA_x86Details.C:1002
#23 0x00007ffff78744bb in Dyninst::InsnAdapter::IA_IAPI::parseJumpTable (this=0x3e41450,
currFunc=0x1288f90, currBlk=0x39c3930, outEdges=std::vector of length 0, capacity 0)
at /home/detter/Workspace/xmeng-test/parseAPI/src/IA_IAPI.C:958
#24 0x00007ffff7872c29 in Dyninst::InsnAdapter::IA_IAPI::getNewEdges (this=0x3e41450,
outEdges=std::vector of length 0, capacity 0, context=0x1288f90, currBlk=0x39c3930,
num_insns=605, plt_entries=0xe6a0d8, knownTargets=std::set with 174 elements = {...})
at /home/detter/Workspace/xmeng-test/parseAPI/src/IA_IAPI.C:681
#25 0x00007ffff7803389 in Dyninst::ParseAPI::Parser::ProcessCFInsn (this=0xe69fe0,
frame=..., cur=0x39c3930, ah=...)
at /home/detter/Workspace/xmeng-test/parseAPI/src/ParserDetails.C:425
#26 0x00007ffff781146d in Dyninst::ParseAPI::Parser::parse_frame (this=0xe69fe0,
frame=..., recursive=true)
at /home/detter/Workspace/xmeng-test/parseAPI/src/Parser.C:1119
#27 0x00007ffff780dc11 in Dyninst::ParseAPI::Parser::parse_frames (this=0xe69fe0,
work=std::vector of length 3, capacity 8 = {...}, recursive=true)
at /home/detter/Workspace/xmeng-test/parseAPI/src/Parser.C:406
#28 0x00007ffff780d03c in Dyninst::ParseAPI::Parser::parse_at (this=0xe69fe0, region=
0xebaf80, target=9368576, recursive=true, src=Dyninst::ParseAPI::ONDEMAND)
at /home/detter/Workspace/xmeng-test/parseAPI/src/Parser.C:211
#29 0x00007ffff780d21e in Dyninst::ParseAPI::Parser::parse_at (this=0xe69fe0,
target=9368576, recursive=true, src=Dyninst::ParseAPI::ONDEMAND)
at /home/detter/Workspace/xmeng-test/parseAPI/src/Parser.C:241
#30 0x00007ffff784d00c in Dyninst::ParseAPI::CodeObject::parse (this=0xe5fef0,
target=9368576, recursive=true)
at /home/detter/Workspace/xmeng-test/parseAPI/src/CodeObject.C:165
#31 0x000000000040251a in main (argc=2, argv=0x7fffffffe568) at src/main.cpp:91
assert message:
dyn_dump: /home/detter/Workspace/xmeng-test/dataflowAPI/src/../rose/x86_64InstructionSemantics.h:186: WordType<8ul> X86_64InstructionSemantics<Policy, WordType>::read8(SgAsmExpression*) [with Policy = Dyninst::DataflowAPI::SymEvalPolicy_64; WordType = Dyninst::DataflowAPI::Handle]: Assertion `!"Bad position in register"' failed.
from dyninst.
Related Issues (20)
- formatting x86_64 instruction incorrectly makes kN registers masks in some cases
- Symtab reads wrong debug inline info for Intel EM_INTELGT GPU binary HOT 12
- Dyninst doesn't continue parsing AMDGPU code after a procedure call
- `FunctionBase::getInlines()` Assertion fails for Fortran binary build HOT 3
- Unable to read all instructions of elf format HOT 12
- RoseOperation::extractOP dealt incorrectly
- Rose logicalNot implemented as 1's complement
- Dyninst generates unnecessary spill code (pnnl/memgaze)
- Fails to build with cmake when specifying custom elfutils dir HOT 2
- Segfault at exit of the profiled program when trying Tau with Dyninst 12.3.0 on IBM64 HOT 1
- Regression from 12.3.0 to master with line map and inline info HOT 12
- segmentation fault although doing nothing about instrumentaion HOT 3
- Get map file before and after instrumentation HOT 9
- Issue with static instrumentaion on `bodytrack` HOT 4
- Wrong Backedges in Loops HOT 2
- Dyninst dwarf parsing results in uncaught exception.
- The `Parser::parse_gap_heuristic(CodeRegion * cr)` function causes the Assertion `!findFuncByEntry(cr,curAddr)` failed.
- Race in Parser::set_edge_parsing_status HOT 2
- Inconsistencies in data structures produced by Dyninst HOT 2
- aarch64 stackwalking needs work. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dyninst.