|
From: Josef W. <Jos...@gm...> - 2003-12-18 20:12:22
|
On Thursday 18 December 2003 19:17, Josef Weidendorfer wrote:
> Where should I allocate space for this flag?
> Or better: How to get rid of the permission check, i.e. the "%fs:" segment?
Followup:
Of course, with --pointercheck=no, I can avoid the %fs prefix. But in this
case, this should be avoided even with --pointercheck=yes, as this is a
STORE instruction generated by the tool.
As LOAD/STORE always does a bound check, there are 3 possibilities:
* I add an extended UCode for this,
* We add LOAD/STORE variants that explicitly do no bound checks, which
can be used by tools.
* Add a flag to LOAD/STORE if a boundcheck should explicitly avoided.
I got a crash when I use valgrind with --pointercheck=no. This has nothing to
do with my tool.
E.g. a valgrind --tool=none --pointercheck=no gives me:
================================================
==12818== For more details, rerun with: -v
==12818==
valgrind: vg_scheduler.c:1172 (vgPlain_scheduler): Assertion `done_this_time
>= 0' failed.
==12818== at 0xB8029A61: vgPlain_skin_assert_fail (vg_mylibc.c:1161)
==12818== by 0xB8029A60: assert_fail (vg_mylibc.c:1157)
==12818== by 0xB8029A9E: vgPlain_core_assert_fail (vg_mylibc.c:1168)
==12818== by 0xB800EECC: vgPlain_scheduler (vg_scheduler.c:1216)
sched status:
Thread 1: status = Runnable, associated_mx = 0x0, associated_cv = 0x0
==12818== at 0x81000C10: (within /lib/ld-2.3.2.so)
==================================================
That's before the first BB is executed. Looking at vg_scheduler.c:
1171 done_this_time = (Int)dispatch_ctr_SAVED - (Int)VG_(dispatch_ctr) -1;
1172 vg_assert(done_this_time >= 0);
done_this_time should be the number of BB executed in the inner loop, isn't
it? But why the "-1" ? Somehow with "--pointercheck=no", done_this_time can
be -1 the first time, and thus the assertion failed.
So I simply removed the "-1".
Now I get another SEGFAULT crash. Using gdb, I found out that in vg_dispatch.S
there is a check for clo_checkpointer,assuming a integer type, but Bool is a
"unsigned char". Change the 2 checks, e.g. the first check to
movb VG_(clo_pointercheck), %al
testb %al,%al
, and valgrind runs fine with --pointercheck=no.
Even my skin runs fine now.
Cheers,
Josef
|