You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing a dynamic library using C++ and utilizing ctypes in Python to call functions from this library. When I try to initialize absl::Log within the DLL, I encounter the following error:
OSError: exception: access violation reading 0x0000000000000000
This issue only occurs on Windows with MSVC; the same code works fine on macOS with the Clang compiler.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1721963952.103176 15648 main.cpp:17] initializing absl log
Traceback (most recent call last):
File "c:\Users\Jiawei\Desktop\og\absl\test\main.py", line 6, in <module>
oglib.initializeAbslLoggingPy()
OSError: exception: access violation reading 0x0000000000000000
If I build an executable on Windows with the following code, it works fine.
Describe the issue
I am developing a dynamic library using C++ and utilizing ctypes in Python to call functions from this library. When I try to initialize absl::Log within the DLL, I encounter the following error:
OSError: exception: access violation reading 0x0000000000000000
This issue only occurs on Windows with MSVC; the same code works fine on macOS with the Clang compiler.
Below is a demo code to illustrate the issue.
main.cpp
CMakeLists.txt
main.py
error message
If I build an executable on Windows with the following code, it works fine.
Steps to reproduce the problem
cmake ..
cmake --build .
copy the built main.dll file to the same folder with main.py
python main.py
What version of Abseil are you using?
tried both GIT_TAG 20230125.3 and 20240116.2
What operating system and version are you using?
windows 10
What compiler and version are you using?
microsoft visual studio 2022
What build system are you using?
microsoft visual studio 2022
Additional context
the same code works fine on macOS with the Clang compiler
The text was updated successfully, but these errors were encountered: