tracealign_driver phase 1 stack depth error

22 views
Skip to first unread message

hakon

unread,
Apr 4, 2012, 6:59:03 PM4/4/12
to BitBlaze User Discussion group
Hi,

I am having trouble aligning large traces. I have a good and a bad
trace of about 14 GB each.
The traces contain only one thread, and they were started on the same
function.
If I extract the first million instructions from each trace, alignment
works perfectly.
Also phase 0 works fine.
But giving the full traces to phase 1 gives the following error after
parsing all CFG-files:

Found cached functions list. Loaded 2493 functions.
Found cached address to count table. Loaded 110767 mappings.
Found cached ijmp to targets table. Loaded targets of 409 indirect
jumps.
Sucesfully loaded all trace data from cache. Finshed preprocessing
step.
Succesfully opened trace file bad.trace
Succesfully opened trace file good.trace

ALIGNMENT RESULTS:

Fatal error: exception Failure("Error: cf_stack depths don't match @
#00000001 ~ #00000001")
Raised at file "pervasives.ml", line 22, characters 22-33

If I specify -start-ctrs 32,32 which is passed the first call
instruction, alignment works until the first divergence:

ALIGNMENT RESULTS:

ALIGNED @ T0:#00000032-00000123 (00000092 insts) ~
T1:#00000032-00000123 (00000092 insts)
DISALIGNED @ ~
T1:#00000124-00000131 (00000008 insts) T0
Fatal error: exception Failure("Error: cf_stack depths don't match @
#00000139 ~ #00000147")
Raised at file "pervasives.ml", line 22, characters 22-33

The same two traces could be aligned without errors from instruction 1
to a million, giving several aligned and disaligned regions.
Is there a way to fix the stack depth somehow?

Cheers

Noah

unread,
Apr 16, 2012, 9:04:10 PM4/16/12
to BitBlaze User Discussion group
Hi Hakon,

As suggested by the error message, the alignment algorithm is
terminating because the alignment stacks have different sizes at an
instruction pair that the algorithm thinks is aligned (at each such
instruction pair, the stacks should be identical). This could be
caused by a number of factors, the most common of which is if you
started the alignment at different instructions. However, your second
run, which ran successfully until instruction pair (139, 147) seems to
rule this out.

The next thing I would suggest doing is make sure you delete all the
CFG and cache files (stored in folder tracealign_cache), recreate the
index for each trace (using the -createindex option in trace_reader),
and re-run phase 0 for both traces before running phase 1; many weird
problems can occur if the tracealign tool is reading stale data
generated from a different version of the trace files.

If this doesn't correct the problem, the easiest way for me to debug
it is for you to send me the traces. Since they are rather large, I
would suggest trimming them to the first few hundred instructions, so
that I can replicate the problem around instructions 139 and 147. You
can trim the traces using the trace_reader as follows:

$ trace_reader -trace good.trace -last 200 -o good.trimmed.trace
(do the same with bad.trace)

-- Noah
Reply all
Reply to author
Forward
0 new messages