Skip to content

Fix the crash that occurs on the second attempt to instantiate the FMU - #213

Merged
markaren merged 1 commit into
NTNU-IHB:masterfrom
zefir-o:fixCrashOnSecondInstantiation
Aug 7, 2024
Merged

Fix the crash that occurs on the second attempt to instantiate the FMU#213
markaren merged 1 commit into
NTNU-IHB:masterfrom
zefir-o:fixCrashOnSecondInstantiation

Conversation

@zefir-o

Copy link
Copy Markdown
Contributor

if the first instance was destroyed. This crash is reproducible on recent Python versions. Although the documentation does not explicitly mention avoiding the use of PyFinalize more than once per process, doing so can lead to a crash in reality. To address this issue, keep the PyState alive until the library is unloaded.

if the first instance was destroyed. This crash is reproducible on recent Python versions.
Although the documentation does not explicitly mention avoiding the use of PyFinalize
more than once per process, doing so can lead to a crash in reality.
To address this issue, keep the PyState alive until the library is unloaded.
@zefir-o

Copy link
Copy Markdown
ContributorAuthor

@MinsGoing FYI

@zefir-o

Copy link
Copy Markdown
ContributorAuthor

@markaren Please review the fix for the issue mentioned (for some reason) here zefir-o/co2_tracker#8
There was a crash attempting to instantiate the second instance of FMU.

@MinsGoing

Copy link
Copy Markdown

@igor-epam It's working, thank you for your help. @markaren Please review the fix for the problem.

@Nils12345678901234567

Copy link
Copy Markdown

When I run an very simple FMU created with PythonFMU in MATLAB Simulink (R2024a) it always crashes on the second run.

Could this be the same problem?

When will a new version of PythonFMU be released?

@zefir-o@markaren

@zefir-o

Copy link
Copy Markdown
ContributorAuthor

@Nils12345678901234567 This fix is for the issue caused by the previous PR. It was never released though. If you are using the version from the pip, then it's a different issue.

@MinsGoing

Copy link
Copy Markdown

@Nils12345678901234567 You need to manually git clone repository and then install it

@StephenSmith25StephenSmith25 mentioned this pull request Sep 11, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@zefir-o@MinsGoing@Nils12345678901234567@markaren