Repository navigation
Commit 1606484
Fix mach hardware exception forwarding (#105003)
* Fix mach hardware exception forwarding
A recent change to enable AVX512 register state processing in the mach
exception handling on macOS x64 has broken a PAL test and also a case
when a hardware exception occurs in 3rd party native code.
In both cases runtime hangs, another exception occurs while forwarding
the exception message and that ends up happenning infinitely.
The problem is caused by the fact that the MachMessageInfo has grown,
since we've changed a field containing float state to contain avx512
state instead. But the buffer that stores the message is of fixed size
of 1500 bytes and it is not sufficient.
I have grown the buffer size to the necessary size, but there was another
issue lurking behind the first one. The MachExceptionInfo::RestoreState
was trying to restore the float state always as x86_FLOAT_STATE instead
of choosing x86_FLOAT_STATE, x86_AVX_STATE or x86_AVX512_STATE depending
of which of them was stored. So the thread_set_state was failing.
This change fixes both of the problems.
* Simplify the RestoreState
* Set the message buffer to the size of the mach_msg_t plus trailer size1 parent 19b7dc9 commit 1606484
2 files changed
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1325 | 1325 | | |
1326 | 1326 | | |
1327 | 1327 | | |
1328 | | - | |
| 1328 | + | |
1329 | 1329 | | |
1330 | 1330 | | |
1331 | 1331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | 189 | | |
195 | 190 | | |
196 | 191 | | |
| |||
298 | 293 | | |
299 | 294 | | |
300 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
301 | 299 | | |
302 | 300 | | |
303 | 301 | | |
| |||
0 commit comments