fix abi problem#99
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes an ABI (Application Binary Interface) conflict between pylibseekdb (built with ABI=0) and onnxruntime (built with ABI=1) that causes a coredump when both libraries are loaded in certain orders. The solution imports onnxruntime before any code that might load pylibseekdb, ensuring the ABI=1 library is loaded first.
- Adds an early import of
onnxruntimein the package's__init__.pyto establish proper library loading order - Includes explanatory comment documenting the ABI conflict and workaround strategy
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import importlib.metadata | ||
|
|
||
| # Note: pylibseekdb built with ABI=0 and onnxruntime built with ABI=1, so there's a conflict between the two libraries. | ||
| # pylibseekdb is built both with ABI=0 and the -Bsymbolic flag, so we can load libraries with ABI=1 first |
There was a problem hiding this comment.
Grammar issue: The word "both" is awkwardly placed. It should be "pylibseekdb is built with both ABI=0 and the -Bsymbolic flag" or simply remove "both" since it's not necessary when using "and".
| # pylibseekdb is built both with ABI=0 and the -Bsymbolic flag, so we can load libraries with ABI=1 first | |
| # pylibseekdb is built with both ABI=0 and the -Bsymbolic flag, so we can load libraries with ABI=1 first |
| """ | ||
| import importlib.metadata | ||
|
|
||
| # Note: pylibseekdb built with ABI=0 and onnxruntime built with ABI=1, so there's a conflict between the two libraries. |
There was a problem hiding this comment.
Grammar issue: "pylibseekdb built with" should be "pylibseekdb is built with" for correct sentence structure.
| # Note: pylibseekdb built with ABI=0 and onnxruntime built with ABI=1, so there's a conflict between the two libraries. | |
| # Note: pylibseekdb is built with ABI=0 and onnxruntime is built with ABI=1, so there's a conflict between the two libraries. |
Summary
close #98
If python dlopen pylibseekdb and then other libraries with ABI=1, then it would coredump.
For details, please refer to #98
Solution Description
Force pyseekdb load a library with ABI=1 flag before opening pylibseekdb.