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

Add llvm libunwind callback to suppress exceptions on apple silicon #254

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aaronj0
Copy link
Collaborator

@aaronj0 aaronj0 commented May 2, 2024

Adding fix from

This adds the find_dynamic_unwind_sections callback, used by libunwind to fix the libc++abi: terminating due to uncaught exception of type int on apple silicon. This returns fake_mach_header as the header for all JIT'd code.

The checks are performed during library loading and unloading time, and so have been added during interpreter creation and destruction called in CppInterOp.cpp, via the leaked compat::Interpreter class

Copy link

github-actions bot commented May 2, 2024

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
Copy link

github-actions bot commented May 2, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link

github-actions bot commented May 2, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link

codecov bot commented May 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.70%. Comparing base (cff06c7) to head (3a6db23).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #254   +/-   ##
=======================================
  Coverage   72.69%   72.70%           
=======================================
  Files           8        8           
  Lines        2963     2964    +1     
=======================================
+ Hits         2154     2155    +1     
  Misses        809      809           
Files Coverage Δ
lib/Interpreter/Compatibility.h 88.65% <ø> (ø)
lib/Interpreter/CppInterOp.cpp 79.37% <100.00%> (+0.01%) ⬆️
Files Coverage Δ
lib/Interpreter/Compatibility.h 88.65% <ø> (ø)
lib/Interpreter/CppInterOp.cpp 79.37% <100.00%> (+0.01%) ⬆️

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

#include "llvm/Support/Casting.h"
#include "llvm/Support/Path.h"

/home/maximus/cppyy-interop-dev/CppInterOp/llvm-project/compiler-rt/lib/orc/macho_platform.cpp
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: expected unqualified-id [clang-diagnostic-error]

/home/maximus/cppyy-interop-dev/CppInterOp/llvm-project/compiler-rt/lib/orc/macho_platform.cpp
^

Copy link

github-actions bot commented May 3, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link

github-actions bot commented May 3, 2024

clang-tidy review says "All clean, LGTM! 👍"

@vgvassilev vgvassilev force-pushed the libunwind-fix branch 2 times, most recently from a7ae7ef to be0085b Compare May 3, 2024 08:31
Copy link

github-actions bot commented May 3, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link

github-actions bot commented May 3, 2024

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
Copy link

github-actions bot commented May 3, 2024

clang-tidy review says "All clean, LGTM! 👍"

@vgvassilev
Copy link
Contributor

@mcbarton, our cache sizes nowadays allow for having 1-2 osx-x86 builds. Are they easy to bring back?

@mcbarton
Copy link
Collaborator

mcbarton commented May 3, 2024

@mcbarton, our cache sizes nowadays allow for having 1-2 osx-x86 builds. Are they easy to bring back?

@vgvassilev Yes, they are easy to bring back. I'll put in a PR which brings them back.

@vgvassilev
Copy link
Contributor

@mcbarton, our cache sizes nowadays allow for having 1-2 osx-x86 builds. Are they easy to bring back?

@vgvassilev Yes, they are easy to bring back. I'll put in a PR which brings them back.

Nice! Thanks for the speed-of-light reply and PR!

@aaronj0 aaronj0 self-assigned this May 3, 2024
@aaronj0 aaronj0 marked this pull request as draft May 3, 2024 11:03
Copy link

github-actions bot commented May 3, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link

github-actions bot commented May 8, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link

clang-tidy review says "All clean, LGTM! 👍"

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

dlsym(RTLD_DEFAULT, "__unw_remove_find_dynamic_unwind_sections"))
unw_remove_find_dynamic_unwind_sections(find_dynamic_unwind_sections);
#endif
sInterpreter.release();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: the value returned by this function should be used [bugprone-unused-return-value]

      sInterpreter.release();
      ^
Additional context

lib/Interpreter/CppInterOp.cpp:109: cast the expression to void to silence this warning

      sInterpreter.release();
      ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants