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

[BUG] ARKodeSetDefaults Memory Leaks and Inconsistencies #554

Open
Steven-Roberts opened this issue Aug 12, 2024 · 0 comments · Fixed by #560
Open

[BUG] ARKodeSetDefaults Memory Leaks and Inconsistencies #554

Steven-Roberts opened this issue Aug 12, 2024 · 0 comments · Fixed by #560

Comments

@Steven-Roberts
Copy link
Collaborator

Current Behavior:

When ARKodeSetDefaults is called, some of the implementations NULL out Butcher tables and the nonlinear solver without freeing:

step_mem->Be = NULL; /* no Butcher tables */
step_mem->Bi = NULL;
step_mem->NLS = NULL; /* no nonlinear solver object */

step_mem->B = NULL; /* no Butcher table */

step_mem->MRIC = NULL; /* no slow->fast coupling */
step_mem->NLS = NULL; /* no nonlinear solver object */

(SPRKStep appears ok)

Also ERKStep is the only implementation that resets the adaptivity controller.

Expected Behavior:

Objects should be freed and the workspace size should be updated appropriately.
Also, ARKStep and ERKStep should be consistent about handling of adaptivity controller when ARKodeSetDefaults called.

Steps To Reproduce:

Call ARKodeSetDefaults after setting a Butcher table or nonlinear solver.

I've confirmed a memory leak with valgrind when ARKodeSetDefaults is called after ARKStepSetTableNum. Haven't tested further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants