Hello again (and thaks for your recent help)


Now I am trying a little bit with exp-ptrcheck and maybe there is something
else I have missunderstood but the fact is that for this simple piece of
code it is not reporting any mistake:

void f ()
{
        char c[10];
        c[11] = 'c';

}


int
main ()
{
        char c[10];
        f ();

        return 0;
}


If I run it with valgrind:

src/valgrind> /local/scratch/bin/valgrind --tool=exp-ptrcheck ./stack
==1716== exp-ptrcheck, a heap, stack & global array overrun detector.
==1716== NOTE: This is an Experimental-Class Valgrind Tool.
==1716== Copyright (C) 2003-2008, and GNU GPL'd, by OpenWorks Ltd et al.
==1716== Using LibVEX rev 1884, a library for dynamic binary translation.
==1716== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP.
==1716== Using valgrind-3.4.1, a dynamic binary instrumentation framework.
==1716== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al.
==1716== For more details, rerun with: -v
==1716==
==1716==
==1716== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

There are not mistakes reported.. but if I compile with
-fstack-protector-all

src/valgrind>  g++ -ggdb3 -fstack-protector-all -o stack stack.cc
src/valgrind> ./stack
*** stack smashing detected ***: ./stack terminated
Abort

There is something that is really wrong with the binary..

Could you help me please? I understood ptrcheck was able to detect stack
overruns..


Thank you very much

Roberto
------------------------------------------------------------------------------
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to