On Wed, 2015-10-28 at 13:23 +0000, Marco Cisternino wrote:
> Then I give gdb
> 
> continue
> 
> After few seconds gdb says
> Program received signal SIGTRAP, Trace/breakpoint trap.
> 0x0000000006018417 in __libc_writev (fd=9, vector=0x6af6710, count=3)
> at ../sysdeps/unix/sysv/linux/writev.c:50
> 50    ../sysdeps/unix/sysv/linux/writev.c: File o directory non
> esistente.
> where "non esistente" means "doesn't exist"
> I don't really know what happens.
> Could you help me understand, please?

--vgdb-error=0 tells valgrind to stop at the begin of
execution of your program and has to wait for gdb.
It also indicates that valgrind has to give control to gdb
for each error encountered.
You can also put breakpoints in your program, if you want.

You then succesfully connected gdb to valgrind, and the continue
command you gave has continued the execution (till the first error).

After that, valgrind stopped with a SIGTRAP.
Normally, this means that valgrind has detected an error,
and is giving back the control to gdb, so that you can investigate
the error. The error message is shown on the stderr of your
valgrind command.
In gdb, you can use the various normal gdb commands
(e.g. examine the variables, ...).
You can also use several valgrind specific 'monitor commands':
see e.g. 
http://www.valgrind.org/docs/manual/mc-manual.html#mc-manual.monitor-commands
and
http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.valgrind-monitor-commands
for more info about memcheck and valgrind monitor commands.

Possibly but unlikely, the SIGTRAP could have other causes
(e.g. a real trap instruction).

So, very probably, the above shows that Valgrind detected an error
in the usage of the writev syscall (probably writing uninitialised
data).

Philippe 



------------------------------------------------------------------------------
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to