Closed JerryLui closed 1 year ago
I think I've seen this before too, I was unable to figure out why. The only thing I can think of is objects being de-allocated and threading not playing nice together.
Yeah, there seems to be some issues with threading and virtualbox. I get the following exception when trying to run PyCharm debugger or Flask from console on the same code.
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\site-packages\vboxapi\__init__.py", line 449, in __init__
None)
pywintypes.com_error: (-2147221008, 'CoInitialize has not been called.', None, None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/JerryL/Documents/Aptiv/Python/VASP/grand_compile_auto/dev/issue_oXctp_not_defined.py", line 20, in run
self.vbox = virtualbox.VirtualBox()
File "C:\Program Files\Python36\lib\site-packages\virtualbox\library_ext\vbox.py", line 22, in __init__
manager = virtualbox.Manager()
File "C:\Program Files\Python36\lib\site-packages\virtualbox\__init__.py", line 143, in __init__
self.manager = vboxapi.VirtualBoxManager(mtype, mparams)
File "C:\Program Files\Python36\lib\site-packages\vboxapi\__init__.py", line 991, in __init__
self.platform = PlatformMSCOM(dPlatformParams)
File "C:\Program Files\Python36\lib\site-packages\vboxapi\__init__.py", line 455, in __init__
print("Warning: CoInitializeSecurity failed: ", oXctp);
NameError: name 'oXctp' is not defined
I no longer have time to maintain this library, so am closing this issue.
I found a similiar issue reported https://github.com/SethMichaelLarson/virtualbox-python/issues/52 but I wasn't able to reproduce that issue. Instead I found the error when running vbox in a thread.
ENVIRONMENT
master
branch?SUMMARY
During the second iteration of the while loop, where the th variable gets reassigned, the python app crashes and produces a Win32 exception. The crash seems to stem from release and reassignment of the
self.session
andself.vbox
variables.STEPS TO REPRODUCE
EXPECTED RESULTS
New vbox and sessions should be able to start after powering down the first session.
ACTUAL RESULTS