I have valgrind's strange error while running a program:
int main()
{
__asm("movl %eax,%ds:0(%ebp)");
return 0;
}
And there are no valgrind's error messages as usually in incorrect =
program, "Segmentation fault" only :(
Without 'ds:' valgrind run correctly.
I use latest valgrind from CVS-head/
Valgrind output follow:
[dim@nrepus valgrind]$ valgrind --tool=3Dmemcheck -v ./a.out
=3D=3D10751=3D=3D Memcheck, a memory error detector for x86-linux.
=3D=3D10751=3D=3D Copyright (C) 2002-2004, and GNU GPL'd, by Julian =
Seward.
=3D=3D10751=3D=3D Using valgrind-2.1.2.CVS, a program supervision =
framework for x86-linux.
=3D=3D10751=3D=3D Copyright (C) 2000-2004, and GNU GPL'd, by Julian =
Seward.
=3D=3D10751=3D=3D Valgrind library directory: /usr/local/lib/valgrind
=3D=3D10751=3D=3D Command line
=3D=3D10751=3D=3D ./a.out
=3D=3D10751=3D=3D Startup, with flags:
=3D=3D10751=3D=3D --tool=3Dmemcheck
=3D=3D10751=3D=3D -v
=3D=3D10751=3D=3D Contents of /proc/version:
=3D=3D10751=3D=3D Linux version 2.4.20-28.8smp =
(bhc...@da...) (gcc version 3.2 20020903 (Red Hat =
Linux 8.0 3.2-7)) #1 SMP Thu Dec 18 12:25:21 EST 2003
[skip]
=3D=3D10751=3D=3D Process terminating with default action of signal 11 =
(SIGSEGV)
=3D=3D10751=3D=3D at 0x8048304: main (in =
/u2/home/dim/src/valgrind/a.out)
=3D=3D10751=3D=3D
=3D=3D10751=3D=3D ERROR SUMMARY: 0 errors from 0 contexts (suppressed: =
11 from 1)
--10751--
--10751-- supp: 11 Ugly strchr error in /lib/ld-2.3.2.so
=3D=3D10751=3D=3D malloc/free: in use at exit: 0 bytes in 0 blocks.
=3D=3D10751=3D=3D malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
=3D=3D10751=3D=3D
--10751-- TT/TC: 0 tc sectors discarded.
--10751-- 891 chainings, 0 unchainings.
--10751-- translate: new 1292 (23589 -> 307530; ratio 130:10)
--10751-- discard 0 (0 -> 0; ratio 0:10).
--10751-- dispatch: 18973 jumps (bb entries), of which 2992 (15%) were =
unchained.
--10751-- 25/1333 major/minor sched events. 1292 tt_fast =
misses.
--10751-- reg-alloc: 325 t-req-spill, 57555+2598 orig+spill uis, 7254 =
total-reg-r.
--10751-- sanity: 14 cheap, 1 expensive checks.
--10751-- ccalls: 4746 C calls, 53% saves+restores avoided (14832 =
bytes)
--10751-- 6321 args, avg 0.85 setup instrs each (1788 bytes)
--10751-- 0% clear the stack (14235 bytes)
--10751-- 2282 retvals, 26% of reg-reg movs avoided (1184 =
bytes)
Segmentation fault
Dmitry G. Dyachenko
http://CryptoPro.ru
|