This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Is gprof profiling (-pg) reentrant/thread-safe?
- From: "Stu Juengst" <juengst at rubiconlabs dot io>
- To: "libc-help at sourceware dot org" <libc-help at sourceware dot org>
- Date: Tue, 3 May 2016 14:36:45 +0000
- Subject: Is gprof profiling (-pg) reentrant/thread-safe?
- Authentication-results: sourceware.org; auth=none
I was seeing some mysterious segmentation faults in my multi-threaded Linux application which was built with the -pg option for gprof profiling. They went away when I turned -pg off. I took a look at the mcount source for the version of glibc that I'm using (2.2.5) and see that it is updating linked lists in a single global structure (_gmonparam) with no synchronization mechanism to keep multiple threads from accessing this structure simultaneously. Am I missing something, or is gprof profiling not reentrant/thread-safe?
Thanks,
Stu Juengst