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

Memory leaks in 14.3.0 development code #2102

Closed
4 tasks done
yantosca opened this issue Jan 4, 2024 · 4 comments · Fixed by #2104 · May be fixed by geoschem/HEMCO#255
Closed
4 tasks done

Memory leaks in 14.3.0 development code #2102

yantosca opened this issue Jan 4, 2024 · 4 comments · Fixed by #2104 · May be fixed by geoschem/HEMCO#255
Assignees
Labels
category: Bug Something isn't working deferred Issues/PRs that we cannot work on right away stale No recent activity on this issue

Comments

@yantosca
Copy link
Contributor

yantosca commented Jan 4, 2024

Name and Institution (Required)

Name: Bob Yantosca
Institution:

Confirm you have reviewed the following documentation

Description of your issue or question

I ran the 14.3.0-alpha.6 code (head commit: e4145fe) with the memory sanitizer option (cmake -DSANITIZE=y) and found the folloiwng memory leaks.

=================================================================
==1495473==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 107464 byte(s) in 133 object(s) allocated from:
    #0 0x14815712993f in __interceptor_malloc ../../.././libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x1bd566d in __hco_filedata_mod_MOD_filedata_init /n/holyscratch01/jacob_lab/ryantosca/tests/cloudj/test_memory/CodeDir/src/HEMCO/src/Core/hco_filedata_mod.F90:174
    #2 0x202020202020201f  (<unknown module>)

Direct leak of 29248 byte(s) in 8 object(s) allocated from:
    #0 0x14815712993f in __interceptor_malloc ../../.././libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x10c438e in __histcontainer_mod_MOD_histcontainer_create /n/holyscratch01/jacob_lab/ryantosca/tests/cloudj/test_memory/CodeDir/src/GEOS-Chem/History/histcontainer_mod.F90:319
    #2 0x202020202020201f  (<unknown module>)

Direct leak of 3720 byte(s) in 1 object(s) allocated from:
    #0 0x14815712993f in __interceptor_malloc ../../.././libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x18f6ae1 in __state_chm_mod_MOD_init_state_chm /n/holyscratch01/jacob_lab/ryantosca/tests/cloudj/test_memory/CodeDir/src/GEOS-Chem/Headers/state_chm_mod.F90:803

Direct leak of 3160 byte(s) in 1 object(s) allocated from:
    #0 0x14815712993f in __interceptor_malloc ../../.././libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x18fe162 in __state_chm_mod_MOD_init_state_chm /n/holyscratch01/jacob_lab/ryantosca/tests/cloudj/test_memory/CodeDir/src/GEOS-Chem/Headers/state_chm_mod.F90:1027

SUMMARY: AddressSanitizer: 143592 byte(s) leaked in 143 allocation(s).

I believe the first two leaks are known issues but the last two are a result of recent modifications. I will track these down and release a PR to fix the leaks.

Tagging @msulprizio @lizziel

@yantosca yantosca added category: Bug Something isn't working memory labels Jan 4, 2024
@yantosca yantosca self-assigned this Jan 4, 2024
@yantosca
Copy link
Contributor Author

yantosca commented Jan 4, 2024

Also the memory checker printed these warnings:

/n/holyscratch01/jacob_lab/ryantosca/tests/cloudj/test_memory/CodeDir/src/GEOS-Chem/KPP/fullchem/fullchem_HetStateFuncs.F90:671: runtime error: load of null pointer of type 'real(kind=8)'
/n/holyscratch01/jacob_lab/ryantosca/tests/cloudj/test_memory/CodeDir/src/GEOS-Chem/KPP/fullchem/fullchem_HetStateFuncs.F90:671: runtime error: load of null pointer of type 'real(kind=8)

@yantosca yantosca added the deferred Issues/PRs that we cannot work on right away label Jan 10, 2024
@yantosca
Copy link
Contributor Author

NOTE: We have fixed memory leaks caused by modifications by Cloud-J (#3 and #4 above). The remaining memory leaks may take longer to figure out.

Copy link

stale bot commented Mar 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. If there are no updates within 7 days it will be closed. You can add the "never stale" tag to prevent the Stale bot from closing this issue.

@stale stale bot added the stale No recent activity on this issue label Mar 13, 2024
@yantosca
Copy link
Contributor Author

We can close out this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Bug Something isn't working deferred Issues/PRs that we cannot work on right away stale No recent activity on this issue
Projects
None yet
1 participant