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: vladimir.mezentsev at oracle dot com
Subject: [Bug gprofng/31460] heap tracing causes infinite recursion on calloc with multi-threaded applications
Date: Fri, 22 Mar 2024 06:32:05 +0000

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

--- Comment #5 from Vladimir Mezentsev <vladimir.mezentsev at oracle dot com> 
---
The problem is:
We use pthread_getspecific() and pthread_setspecific() to access thread local
memory.
We use this memory to check that our interposed functions (like malloc, calloc
or free) don't have recursion.
For example, the first time we call calloc(), we call pthread_setspecific() to
create a thread-specific value.
On your 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_getspecific() and
pthread_setspecific().
It works on OL8, but may not work on Ubuntu.
I will try to find Ubuntu machine.

-- 
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]