-
Notifications
You must be signed in to change notification settings - Fork 74
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
Calling mph.start()
crashes Python session after Windows update
#157
Comments
You can run the test suite with logging enabled: |
Thanks for this and for this great software in general. Due to time constraints, I ended up running it on a different client (where it works). I am sorry to not have been able to get to the root of this. But I am sure that your debugging instructions will help someone else in the future. |
Windows update for .NET framework
We noticed that on one machine, MPh-py stopped working after the above update. This may be unrelated. Output from test suite
So maybe the JVM is not starting up as intended? |
Seems like it. And apparently it crashes out of the Python session completely. You should be able to reproduce the crash in an interactive Python prompt. I just get the Python prompt back when I do this:
But the crash is due to JPype or Java, not MPh, so there's nothing I can do about it. Don't think the Windows update is a problem per se. If anything, this is a conflict with DLLs on your system that Java is trying to load, and fails. Along the lines of #49, though not exactly that as it's been fixed. This here looks like "can't fix". |
Running these commands in the interactive prompt shows me the same behavior as for you. I am still in the interactive prompt after execution of
Out of curiosity, when I then try to start mph, the following happens:
|
That makes sense if you were still in the same Python session. Were you? JPype seemed to crash in your test because you'd otherwise expect the log to continue like so:
I don't see why it doesn't crash when you do that manually. Maybe try also loading the Comsol Java classes. Something like: import jpype
jpype.startJVM(
'C:/Program Files/COMSOL/COMSOL60/Multiphysics/java/win64/jre/bin/server/jvm.dll',
classpath='C:/Program Files/COMSOL/COMSOL60/Multiphysics/apiplugins/*'
)
print('Success.') I say "something like" because I have Comsol installed in a different location, so edited in the path you have it at. The above is the only code that MPh runs between the last log message you saw in your test run and the next log message which it never got to: Lines 181 to 186 in e24c9cc
|
Yes, it was the same Python session.
Running
exits without error and throws me back into my shell. The |
Well, I see no reason why this happens and have no idea how to fix that. It's almost certainly a bug in JPype, rather than Java, but would be difficult to debug, even if reproducible, and if there was someone with the technical expertise (which I don't have) and access to Comsol. For what it's worth, I see "2023-11 Cumulative Update for Windows 11 Version 22H2 for x64-based Systems (KB5032190)" in my update history. It's not the exact same update, since it's for Windows 11, but fixes the same issues. I don't have access to a Windows 10 system with Comsol installed. I don't know why a Windows update would make Java crash when classes are loaded. Comsol's Java classes do have external dependencies, i.e. dynamically linked system libraries, but problems there usually lead to a I'll leave this issue open, since it's unresolved, and so people can comment here if they have something relevant to add. |
mph.start()
crashes Python session
mph.start()
crashes Python sessionmph.start()
crashes Python session after Windows update
I encountered a crash in dynamic loader over a missing dependency (in that case ggogle protobuf missing). I am not sure why a missing dependency is causing a crash where it was causing a proper exception previously. My assumption is there has been a change of behavious in the JVM which is now yielding an exception at an unexpected point leading to the failure. Fixing the dependency problem solved the issue, but I have not had time to find the crash source. |
Setup
Windows 10 10.0.19045 Build 19045
conda create -n mphtest
conda activate mphtest
pip install MPh
Running without installed COMSOL
(mphtest) D:\\mydir\\> python
>>> import mph
>>> mph.start()
Results in
RuntimeError: Could not locate any Comsol installation
Running with fresh Comsol 6.0 installation
Fresh install of COMSOL 6.0
(mphtest) D:\\mydir\\> python
>>> import mph
>>> mph.start()
Windows hourglass symbol next to pointer shows up after 1 to 2 seconds, then python has exited without error and I am back in the shell
(mphtest) D:\\mydir\\>
Question
COMSOL GUI runs fine.
How can I debug this?
The text was updated successfully, but these errors were encountered: