https://bugs.kde.org/show_bug.cgi?id=494327
            Bug ID: 494327
           Summary: Crash when building Helgrind with #define
                    TRACE_PTH_FNS 1
    Classification: Developer tools
           Product: valgrind
           Version: 3.24 GIT
          Platform: Other
                OS: FreeBSD
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: helgrind
          Assignee: jsew...@acm.org
          Reporter: pjfl...@wanadoo.fr
  Target Milestone: ---

I get this segfault:

==68279== Process terminating with default action of signal 11 (SIGSEGV):
dumping core
==68279==  Bad permissions for mapped region at address 0x1FFEDFFFF8
==68279==    at 0x49B4F5C: vfprintf_l (in /lib/libc.so.7)
==68279==    by 0x49ADA3E: fprintf (in /lib/libc.so.7)
==68279==    by 0x4857A7E: mutex_lock_WRK (hg_intercepts.c:931)
==68279==    by 0x49AB6D6: flockfile (in /lib/libc.so.7)
==68279==    by 0x49B4FB1: vfprintf_l (in /lib/libc.so.7)
==68279==    by 0x49ADA3E: fprintf (in /lib/libc.so.7)
==68279==    by 0x4857A7E: mutex_lock_WRK (hg_intercepts.c:931)
==68279==    by 0x49AB6D6: flockfile (in /lib/libc.so.7)
==68279==    by 0x49B4FB1: vfprintf_l (in /lib/libc.so.7)
==68279==    by 0x49ADA3E: fprintf (in /lib/libc.so.7)
==68279==    by 0x4857A7E: mutex_lock_WRK (hg_intercepts.c:931)
==68279==    by 0x49AB6D6: flockfile (in /lib/libc.so.7)

The code

static int mutex_lock_WRK(pthread_mutex_t *mutex)
{
   int    ret;
   OrigFn fn;
   VALGRIND_GET_ORIG_FN(fn);
   if (TRACE_PTH_FNS) {
      fprintf(stderr, "<< pthread_mxlock %p", mutex); fflush(stderr);
   }

My guess here is that FreeBSD libc fprintf makes a call to pthread_mutex_lock
with the result that the code gets stuck in infinite recursion.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to