[all-commits] [llvm/llvm-project] dde26e: [libunwind][AIX] Call dlclose only when dlsym() fa...

Xing Xue via All-commits all-commits at lists.llvm.org
Sat Oct 19 15:41:27 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dde26e361f50df4b999ac117222c74f2c100f817
      https://github.com/llvm/llvm-project/commit/dde26e361f50df4b999ac117222c74f2c100f817
  Author: Xing Xue <xingxue at outlook.com>
  Date:   2024-10-19 (Sat, 19 Oct 2024)

  Changed paths:
    M libunwind/src/UnwindCursor.hpp

  Log Message:
  -----------
  [libunwind][AIX] Call dlclose only when dlsym() fails (#112768)

The personality routine `__xlcxx_personality_v0` in `libc++abi` is
hard-coded in the unwinder as the handler for EH in applications
generated by the legacy IBM C++ compiler. The symbol is resolved
dynamically using `dlopen` to avoid a hard dependency of `libunwind` on
`libc++abi` for cases such as non-C++ applications. However, `dlclose`
was incorrectly called after `dlsym` succeeded, potentially invalidating
the function pointer obtained from `dlsym` when the memory allocated for
the `dlopen` is reclaimed. This PR changes to call `dlclose` only when
`dlsym` fails.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list