bool LivenessAnalyzer::query(Location loc, Type type, const MachRegister& machReg, bool &live) not mapping valid register name on ppc64 #1165
Labels
dataflowAPI
This issue is directly related to dataflowAPI
PowerPC
user-reported
This issue was reported by someone outside of the core Dyninst developers
Projects
I was trying to track down the cause for MachRegister ppc64::r3 not being properly indexed the following code in dataflowAPI/src/liveness.C:
bool LivenessAnalyzer::query(Location loc, Type type, const MachRegister& machReg, bool &live){
bitArray liveRegs;
if (query(loc, type, liveRegs)){
int index = getIndex(machReg);
assert(index >= 0);
live = liveRegs[index];
return true;
}
return false;
}
I would expect that the valid register name would have an entry in the bit vector, but it results in throwing the assert:
stap: /builddir/build/BUILD/dyninst-11.0.0/dyninst-11.0.0/dataflowAPI/src/liveness.C:418: bool LivenessAnalyzer::query(Dyninst::ParseAPI::Location, LivenessAnalyzer::Type, const Dyninst::MachRegister&, bool&): Assertion `index >= 0' failed.
Seeing this with the newly released systemtap-4.6 that is using dyninst liveness analysis to warn if a register modified in guru mode will have no effect. On a rhel8 system with new systemtap-4.6 one can reproduce with:
stap -gvp4 -e 'probe kernel.function("*do_fork").return {$return = -1}'
Pass 1: parsed user script and 509 library scripts using 143488virt/108224res/21568shr/84096data kb, in 760usr/20sys/776real ms.
can't find 0x28080310
can't find 0x28080310
can't find 0x28080310
can't find 0x28080310
can't find 0x28080310
can't find 0x28080310
can't find 0x28080310
can't find 0x28080310
stap: /builddir/build/BUILD/dyninst-11.0.0/dyninst-11.0.0/dataflowAPI/src/liveness.C:418: bool LivenessAnalyzer::query(Dyninst::ParseAPI::Location, LivenessAnalyzer::Type, const Dyninst::MachRegister&, bool&): Assertion `index >= 0' failed.
Aborted (core dumped)
I have been looking through the dyninst code to see if there might be some reason that the ppc64 valid register doesn't get mapped properly. I haven't found a specific cause, but I did run across the following in common/src/dyn_regs.C:267 that looks questionable as it mixes ppc64 and aarch64 stuff:
The text was updated successfully, but these errors were encountered: