bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gprofng/31460] heap tracing causes infinite recursion on calloc wit


From: cvs-commit at gcc dot gnu.org
Subject: [Bug gprofng/31460] heap tracing causes infinite recursion on calloc with multi-threaded applications
Date: Mon, 25 Mar 2024 23:42:36 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=31460

--- Comment #9 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Vladimir Mezentsev
<vmezents@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=99c3fe52d237eae546d7de484d0cfbd615ac192c

commit 99c3fe52d237eae546d7de484d0cfbd615ac192c
Author: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
Date:   Sat Mar 23 18:31:03 2024 -0700

    gprofng: fix infinite recursion on calloc with multi-threaded applications

    libcollector uses pthread_getspecific() and pthread_setspecific() to access
    thread local memory. libcollector uses this memory to check that
    interposed functions (like malloc, calloc or free) don't have recursion.
    The first time we call calloc(), we call pthread_setspecific() to create
    a thread-specific value.
    On Ubuntu machine, pthread_setspecific() calls calloc(), and we cannot
intercept
    such recursion.
    gcc supports thread-local storage. For example,
      static __thread int reentrance = 0;
    I rewrote code using this instead of pthread_setspecific().

    gprofng/ChangeLog
    2024-03-23  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

            PR gprofng/31460
            * libcollector/heaptrace.c: Use the __thread variable to check for
            * reentry. Clean up code.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]