I am using the *instr passed to the drmgr_register_bb_instrumentation_event(NULL,
event_app_instruction, NULL);
I am passing the instr to a clean call for each first instr in bb.
The same basic blocks are recorded correctly in a thread log, but the same blocks again can have weird addresses in another thread log.
I checked the instr_is_app and you can see a new trace below. 1 means it is instr is app. The confusing part here is I got same instructions correct in some places, and incorrect in other threads. Also, as you can see, I log the last instruction if it is CBR and in CBR logs the takens are correct. This happens in both version 7 and version 8. And also, if I run the same binary multiple (enough) times, sometimes I got all addresses correct.
4K BB log is correct then a sequence
.......
BB | 0x40224e | 1
CBR | 0x40224e | TAKEN:0x402255 | NOTTAKEN:0x402257
BB | 0x15 | 1 (This should be 0x402255)
BB | 0x0 | 1 (This should be 0x402265)
CBR:0x402265 | TAKEN:0x402275 | NOTTAKEN:0x40226e
BB | 0x2a | 1 (This should be 0x402275)