[panda-users] Minimal variation in replays

Felix Eberstaller felix.eberstaller at students.fh-hagenberg.at
Thu Nov 15 09:36:41 EST 2018


Hi :),

First of all, thank you for the great work on panda. It is truly amazing!

The problem:
It seems that the callback PANDA_CB_BEFORE_BLOCK_EXEC or
PANDA_CB_AFTER_BLOCK_EXEC sometimes is being called too often during
replay ?
Running the same replay and printing out the blocks (pc) leads to
different traces (see appendix).
The variation between the traces is minimal and this has been tested
with the current docker image and r-18-06.
Is this a problem with my setup and is this the recommended way to track
basic block execution during replay ?

Best,
Felix Eberstaller

Appendix:

Bash snippet:

for i in {1..10}; do /panda/build/i386-softmmu/qemu-system-i386 -m 256 
-replay ii_01  -panda dumper  | grep "PC >>" > /tmp/log$i; done ; md5sum
/tmp/log*

Initializing plugin dumper
Initializing plugin dumper
Initializing plugin dumper
Initializing plugin dumper
Initializing plugin dumper
Initializing plugin dumper
Initializing plugin dumper
Initializing plugin dumper
Initializing plugin dumper
Initializing plugin dumper
2c0c8bd2c3ebe82bbc657f78905ac60a  /tmp/log1
b1cfdd0d7ca41c669d765ed12452b276  /tmp/log10
2c0c8bd2c3ebe82bbc657f78905ac60a  /tmp/log2
4217cd4699f4322c40b873213f84a518  /tmp/log3
3d619029a54bd5a9507bbf876ee6d809  /tmp/log4
ee27f65e1ca86cce4e3d792cb78c0a20  /tmp/log5
4217cd4699f4322c40b873213f84a518  /tmp/log6
2c0c8bd2c3ebe82bbc657f78905ac60a  /tmp/log7
4217cd4699f4322c40b873213f84a518  /tmp/log8
3db131b965c8445d4c91aade227af439  /tmp/log9


Diff between two traces:
diff log1 log10
22336a22337
> PC >> c116b903
22339d22339
< PC >> c116b870
70987d70986
< PC >> c12cfadc

diff log6 log9
70987a70988
> PC >> c12cfadc


Code for dumper:

#define __STDC_FORMAT_MACROS
#include "panda/plugin.h"
extern "C" {
bool init_plugin(void *);
void uninit_plugin(void *);
}

int before_block(CPUState* env, TranslationBlock* tb){
    printf("PC >> " TARGET_FMT_lx "\n", tb->pc);
    return 0x1;
}

bool init_plugin(void *self) {
    panda_cb pcb;
    pcb.before_block_exec = before_block;
    panda_register_callback(self, PANDA_CB_BEFORE_BLOCK_EXEC, pcb);
    return true;
}

void uninit_plugin(void *self) { }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
Url : http://mailman.mit.edu/pipermail/panda-users/attachments/20181115/b6958e59/attachment.bin


More information about the panda-users mailing list