|
From: Philippe W. <phi...@sk...> - 2012-02-19 20:08:51
|
On Sun, 2012-02-19 at 19:30 +0100, Philippe Waroquiers wrote:
> Outer helgrind + inner none goes further, but then the outer generates a SEGV
> when computing a backtrace when the thread 1 is cloning a thread 2.
Adding to the inner none tool --vex-iropt-precise-memory-exns=yes
seems to solve the problem (at least, the 4 threads are starting up).
>
> Any idea if the patch below is the way to go ?
> Or if there is something which I have not understood/did wrong ?
If positive feedback about the below patch, I will clean it up
and modify the README_DEVELOPPERS to speak about
-vex-iropt-precise-memory-exns=yes
Philippe
>
> Philippe
>
> ndex: coregrind/m_redir.c
> ===================================================================
> --- coregrind/m_redir.c (revision 12391)
> +++ coregrind/m_redir.c (working copy)
> @@ -49,6 +49,7 @@
> #include "pub_core_xarray.h"
> #include "pub_core_clientstate.h" // VG_(client___libc_freeres_wrapper)
> #include "pub_core_demangle.h" // VG_(maybe_Z_demangle)
> +#include "pub_core_libcproc.h" // VG_(libdir)
>
> #include "config.h" /* GLIBC_2_* */
>
> @@ -389,6 +390,7 @@
> Bool isText;
> const UChar* newdi_soname;
>
> +
> # if defined(VG_PLAT_USES_PPCTOC)
> check_ppcTOCs = True;
> # endif
> @@ -397,6 +399,23 @@
> newdi_soname = VG_(DebugInfo_get_soname)(newdi);
> vg_assert(newdi_soname != NULL);
>
> +#ifdef ENABLE_INNER
> + {
> + const UChar* newdi_filename;
> + VG_(message)(Vg_DebugMsg, "VALGRIND_LIB %s\n", VG_(libdir));
> + newdi_filename = VG_(DebugInfo_get_filename)(newdi);
> + VG_(message)(Vg_DebugMsg, "checking ignoring redir in %s %s\n", newdi_soname, newdi_filename);
> + /* avoid reading the redirections which are for the outer. */
> + if (VG_(strstr)(newdi_filename, "/vgpreload")) {
> + VG_(message)(Vg_DebugMsg, "contains /vgpreload\n");
> + if( !VG_(strstr)(newdi_filename, (Char*) VG_(libdir))) {
> + VG_(message)(Vg_DebugMsg, "not containing inner VG_(libdir) => ignoring redir in %s\n", newdi_filename);
> + return;
> + }
> + }
> + }
> +#endif
> +
> /* stay sane: we don't already have this. */
> for (ts = topSpecs; ts; ts = ts->next)
> vg_assert(ts->seginfo != newdi);
|