binutils-gdb/gprofng/libcollector
Vladimir Mezentsev 99c3fe52d2 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.
2024-03-25 16:29:41 -07:00
..
aclocal.m4 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
CHK_LIBC_OBJ Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
collector.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
collector.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
collectorAPI.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
configure Change version to 2.42.50 and regenerate files 2024-01-15 15:13:36 +00:00
configure.ac Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
descendants.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
dispatcher.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
envmgmt.c gprofng: Remove unused macros 2024-02-01 13:22:52 -08:00
gethrtime.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
heaptrace.c gprofng: fix infinite recursion on calloc with multi-threaded applications 2024-03-25 16:29:41 -07:00
hwprofile.c gprofng: Remove unused macros 2024-02-01 13:22:52 -08:00
hwprofile.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
iolib.c gprofng: Remove unused macros 2024-02-01 13:22:52 -08:00
iotrace.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
jprofile.c gprofng: Remove unused macros 2024-02-01 13:22:52 -08:00
libcol_hwcdrv.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
libcol_hwcfuncs.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
libcol_util.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
libcol_util.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
libcol-i386-dis.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
libgprofng.ver Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
linetrace.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
Makefile.am Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
Makefile.in Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
memmgr.c gprofng: Remove unused macros 2024-02-01 13:22:52 -08:00
memmgr.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
mmaptrace.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
profile.c gprofng: Remove unused macros 2024-02-01 13:22:52 -08:00
synctrace.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
tsd.c gprofng: Remove unused macros 2024-02-01 13:22:52 -08:00
tsd.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
unwind.c gprofng: Remove unused macros 2024-02-01 13:22:52 -08:00