|
From: <di...@cr...> - 2005-07-13 09:18:18
|
Hello,=20
I try Valgrind from SVN and error arise. Valgrind 2.4.0 work with it.
vex x86->IR: unhandled instruction bytes: 0xF0 0xF 0xC7 0xF
Look as valgrind-3.0.0.SVN cannot support "lock; cmpxchg8b (%%edi)"
Program text and valgrind output follow.
Thank
Dmitry Djachenko
------------------program text
#define LONGLONG long long
#define ll_low(x) *(((long*)&(x))+0)
#define ll_high(x) *(((long*)&(x))+1)
static inline int lfmmCASLL (LONGLONG volatile * dest, LONGLONG xchg, =
LONGLONG compare)
{
char s =3D 0;
__asm__ __volatile__( "push %%ebx\n\t"
"mov %3, %%ebx\n\t"
"lock; cmpxchg8b (%%edi)\n\t"
"setz %0\n\t"
"pop %%ebx"
: "=3Da"(s)
: "D"(dest), "A" (compare), "r"(ll_low(xchg)), "c"(ll_high(xchg))
: "memory", "cc" );
return s;
}
int
main ()
{
volatile LONGLONG s =3D 1, oldval, newval;
do {
newval =3D oldval =3D s;
newval++;
} while (!lfmmCASLL (&s, newval, oldval));
return 0;
}
---------------------------------------------
--------------- Full V. output
=3D=3D4148=3D=3D Memcheck, a memory error detector.
=3D=3D4148=3D=3D Copyright (C) 2002-2005, and GNU GPL'd, by Julian =
Seward et al.
=3D=3D4148=3D=3D Using LibVEX rev 1270, a library for dynamic binary =
translation.
=3D=3D4148=3D=3D Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks =
LLP.
=3D=3D4148=3D=3D Using valgrind-3.0.0.SVN, a dynamic binary =
instrumentation framework.
=3D=3D4148=3D=3D Copyright (C) 2000-2005, and GNU GPL'd, by Julian =
Seward et al.
--4148-- Valgrind library directory: /usr/local/lib/valgrind
--4148-- Command line
--4148-- ./a.out
--4148-- Startup, with flags:
--4148-- --tool=3Dmemcheck
--4148-- --num-callers=3D60
--4148-- --leak-check=3Dyes
--4148-- --show-reachable=3Dyes
--4148-- --track-fds=3Dyes
--4148-- -v
--4148-- Contents of /proc/version:
--4148-- Linux version 2.4.20-8 (bhc...@po...) =
(gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 Thu Mar 13 =
17:54:28 EST 2003
--4148-- Reading syms from /.automount/nrepus/u2/home/dim/tmp/a.out =
(0x8048000)
--4148-- Reading syms from /lib/ld-2.3.2.so (0x1B8E4000)
--4148-- Reading syms from /usr/local/lib/valgrind/stage2 (0xB0000000)
--4148-- Reading suppressions file: /usr/local/lib/valgrind/default.supp
=3D=3D4148=3D=3D
--4148-- Reading syms from /usr/local/lib/valgrind/vg_preload_core.so =
(0x1B8FB000)
--4148-- Reading syms from /usr/local/lib/valgrind/vgpreload_memcheck.so =
(0x1B8FD000)
--4148-- REDIR: 0x1B8F54A0 (index) redirected to 0x1B900470 (index)
--4148-- REDIR: 0x1B8F5640 (strlen) redirected to 0x1B9006D0 (strlen)
--4148-- Reading syms from /lib/libc-2.3.2.so (0x1B917000)
--4148-- Reading syms from /lib/libdl-2.3.2.so (0x1BA50000)
--4148-- REDIR: 0x1B991500 (rindex) redirected to 0x1B900380 (rindex)
vex x86->IR: unhandled instruction bytes: 0xF0 0xF 0xC7 0xF
=3D=3D4148=3D=3D
=3D=3D4148=3D=3D Process terminating with default action of signal 4 =
(SIGILL)
=3D=3D4148=3D=3D Illegal opcode at address 0x80483CA
=3D=3D4148=3D=3D at 0x80483CA: lfmmCASLL (cmpxchg.c:8)
=3D=3D4148=3D=3D by 0x804839E: main (cmpxchg.c:27)
--4148-- REDIR: 0x1B989F40 (free) redirected to 0x1B8FF4FF (free)
=3D=3D4148=3D=3D
=3D=3D4148=3D=3D FILE DESCRIPTORS: 3 open at exit.
=3D=3D4148=3D=3D Open file descriptor 2: /dev/pts/3
=3D=3D4148=3D=3D <inherited from parent>
=3D=3D4148=3D=3D
=3D=3D4148=3D=3D Open file descriptor 1: /dev/pts/3
=3D=3D4148=3D=3D <inherited from parent>
=3D=3D4148=3D=3D
=3D=3D4148=3D=3D Open file descriptor 0: /dev/pts/3
=3D=3D4148=3D=3D <inherited from parent>
=3D=3D4148=3D=3D
=3D=3D4148=3D=3D
=3D=3D4148=3D=3D ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 18 =
from 1)
--4148--
--4148-- supp: 18 Ugly strchr error in /lib/ld-2.3.2.so
=3D=3D4148=3D=3D malloc/free: in use at exit: 0 bytes in 0 blocks.
=3D=3D4148=3D=3D malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
=3D=3D4148=3D=3D
=3D=3D4148=3D=3D No malloc'd blocks -- no leaks are possible.
--4148-- memcheck: sanity checks: 0 cheap, 1 expensive
--4148-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--4148-- memcheck: auxmaps: 0 searches, 0 comparisons
--4148-- memcheck: secondaries: 9 issued (576k, 0M)
--4148-- memcheck: secondaries: 18 accessible and distinguished (1152k, =
1M)
--4148-- tt/tc: 2790 tt lookups requiring 2815 probes
--4148-- tt/tc: 2754 fast-cache updates, 2 flushes
--4148-- translate: new 1377 (28789 -> 462616; ratio 160:10) [0 =
scs]
--4148-- translate: dumped 0 (0 -> ??)
--4148-- translate: discarded 0 (0 -> ??)
--4148-- scheduler: 24764 jumps (bb entries).
--4148-- scheduler: 0/1417 major/minor sched events.
--4148-- sanity: 1 cheap, 1 expensive checks.
--4148-- exectx: 4999 lists, 13 contexts (avg 0 per list)
--4148-- exectx: 23 searches, 10 full compares (434 per 1000)
--4148-- exectx: 0 cmp2, 61 cmp4, 0 cmpAll
Illegal instruction
|