1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
From a01acb182005e85a766fe05bdc5ce81c78b49586 Mon Sep 17 00:00:00 2001
From: Mikhail Labiuk <m.labiuk@samsung.com>
Date: Mon, 19 Feb 2018 19:08:50 +0300
Subject: [PATCH 27/47] Revert "Prevent memory allocation in signal handler"
This reverts commit fa6087f0c2856215e7141259b56e75b46746f74d.
---
src/pal/src/exception/seh-unwind.cpp | 6 ++----
src/pal/src/exception/signal.cpp | 2 +-
src/pal/src/include/pal/seh.hpp | 3 +--
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/pal/src/exception/seh-unwind.cpp b/src/pal/src/exception/seh-unwind.cpp
index eba2c80..7746bbb 100644
--- a/src/pal/src/exception/seh-unwind.cpp
+++ b/src/pal/src/exception/seh-unwind.cpp
@@ -620,14 +620,12 @@ Function:
Parameters:
exceptionRecord - output pointer to the allocated exception record
contextRecord - output pointer to the allocated context record
- allocationProhibited - input flag to avoid memory allocation in critical situations
--*/
VOID
-AllocateExceptionRecords(EXCEPTION_RECORD** exceptionRecord, CONTEXT** contextRecord, BOOL allocationProhibited)
+AllocateExceptionRecords(EXCEPTION_RECORD** exceptionRecord, CONTEXT** contextRecord)
{
ExceptionRecords* records;
- if (allocationProhibited ||
- (posix_memalign((void**)&records, alignof(ExceptionRecords), sizeof(ExceptionRecords)) != 0) )
+ if (posix_memalign((void**)&records, alignof(ExceptionRecords), sizeof(ExceptionRecords)) != 0)
{
size_t bitmap;
size_t newBitmap;
diff --git a/src/pal/src/exception/signal.cpp b/src/pal/src/exception/signal.cpp
index 90da207..bf48619 100644
--- a/src/pal/src/exception/signal.cpp
+++ b/src/pal/src/exception/signal.cpp
@@ -808,7 +808,7 @@ static bool common_signal_handler(int code, siginfo_t *siginfo, void *sigcontext
ucontext = (native_context_t *)sigcontext;
g_common_signal_handler_context_locvar_offset = (int)((char*)&signalContextRecord - (char*)__builtin_frame_address(0));
- AllocateExceptionRecords(&exceptionRecord, &contextRecord, true);
+ AllocateExceptionRecords(&exceptionRecord, &contextRecord);
exceptionRecord->ExceptionCode = CONTEXTGetExceptionCodeForSignal(siginfo, ucontext);
exceptionRecord->ExceptionFlags = EXCEPTION_IS_SIGNAL;
diff --git a/src/pal/src/include/pal/seh.hpp b/src/pal/src/include/pal/seh.hpp
index 5edc214..3ac93d6 100644
--- a/src/pal/src/include/pal/seh.hpp
+++ b/src/pal/src/include/pal/seh.hpp
@@ -84,10 +84,9 @@ Function:
Parameters:
exceptionRecord - output pointer to the allocated Windows exception record
contextRecord - output pointer to the allocated Windows context record
- allocationProhibited - input flag to avoid memory allocation in critical situations
--*/
VOID
-AllocateExceptionRecords(EXCEPTION_RECORD** exceptionRecord, CONTEXT** contextRecord, BOOL allocationProhibited=false);
+AllocateExceptionRecords(EXCEPTION_RECORD** exceptionRecord, CONTEXT** contextRecord);
#if !HAVE_MACH_EXCEPTIONS
// TODO: Implement for Mach exceptions. Not in CoreCLR surface area.
--
2.7.4
|