Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mach hardware exception forwarding #105003

Merged
merged 3 commits into from
Jul 17, 2024

Commits on Jul 17, 2024

  1. 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.
    janvorli committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    568b3b2 View commit details
    Browse the repository at this point in the history
  2. Simplify the RestoreState

    janvorli committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    fee489b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9f38c18 View commit details
    Browse the repository at this point in the history