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

pycubool tries to load its logs as its shared library #14

Open
TimPushkin opened this issue Dec 5, 2022 · 0 comments
Open

pycubool tries to load its logs as its shared library #14

TimPushkin opened this issue Dec 5, 2022 · 0 comments

Comments

@TimPushkin
Copy link

setup_default_logger() creates log files with names in format "cubool-*.textlog" in pycubool's install directory. After this, when pycubool is initialized the next time, if CUBOOL_PATH is not set, pycubool iterates over the files in its install directory and takes the first one with "cubool" in its name which sometimes leads to the log file being chosen over the actual shared library file.

Consequently, this leads to a crash on pycubool import with error like this:

    import pycubool as cb
<...>/python3.10/site-packages/pycubool/__init__.py:29: in <module>
    init_wrapper()
<...>/python3.10/site-packages/pycubool/wrapper.py:28: in init_wrapper
    singleton = Wrapper()
<...>/python3.10/site-packages/pycubool/wrapper.py:60: in __init__
    self.loaded_dll = bridge.load_and_configure(self.load_path)
<...>/python3.10/site-packages/pycubool/bridge.py:172: in load_and_configure
    lib = ctypes.cdll.LoadLibrary(cubool_lib_path)
/usr/lib/python3.10/ctypes/__init__.py:452: in LoadLibrary
    return self._dlltype(name)
/usr/lib/python3.10/ctypes/__init__.py:374: in __init__
    self._handle = _dlopen(self._name, mode)
E   OSError: <...>/python3.10/site-packages/pycubool/cubool-05-12-22--15-57-28.textlog: invalid ELF header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant