Aim to improve thread safety of stacktrace generation.

This commit is contained in:
Richard Frith-Macdonald 2023-01-24 11:35:14 +00:00
parent 7c52bd7c21
commit 35a763f3cb
2 changed files with 8 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2022-01-24 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSException.m:
Wrap bfd backtrace code in a lock, just in case something in there
is not thread-safe.
2022-01-08 Richard Frith-Macdonald <rfm@gnu.org>
* ChangeLog: Update for new release

View file

@ -1188,6 +1188,7 @@ GSPrivateReturnAddresses(NSUInteger **returns)
a = [[NSMutableArray alloc] initWithCapacity: count];
GS_MUTEX_LOCK(traceLock);
for (i = 0; i < count; i++)
{
GSFunctionInfo *aFrame = nil;
@ -1246,6 +1247,7 @@ GSPrivateReturnAddresses(NSUInteger **returns)
[a addObject: [aFrame description]];
}
symbols = [a copy];
GS_MUTEX_UNLOCK(traceLock);
[a release];
#elif defined(_WIN32)
void **ptrs = (void**)&returns[FrameOffset];