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

Register LLVM handlers for bad-alloc / OOM #122574

Merged
merged 3 commits into from
Mar 17, 2024
Merged

Commits on Mar 15, 2024

  1. Register LLVM handlers for bad-alloc / OOM

    LLVM's default bad-alloc handler may throw if exceptions are enabled,
    and `operator new` isn't hooked at all by default. Now we register our
    own handler that prints a message similar to fatal errors, then aborts.
    We also call the function that registers the C++ `std::new_handler`.
    cuviper committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    0ade5a1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    adf57a7 View commit details
    Browse the repository at this point in the history
  3. Install the bad-alloc handler before fatal errors

    The bad-alloc installer was incorrectly asserting that the other handler
    isn't set yet, instead of checking its own, but we can avoid that by
    changing the order we install them.
    
    Ref: llvm/llvm-project#83040
    cuviper committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    8d374b1 View commit details
    Browse the repository at this point in the history