Segmentation fault

17 views
Skip to first unread message

Hem Nalini Morzaria Luna - NOAA Affiliate

unread,
Aug 19, 2024, 11:47:55 PM8/19/24
to Beth Fulton, Atlantis ecosystem model, Isaac Kaplan - NOAA Federal, Alaia Morell, Alberto Rovellini - NOAA Affiliate
Beth:

As part of our PSIMF project I added additional (non-migratory) functional groups to the Puget Sound Model, we now have 79 groups including detritus groups. I made all necessary changes in initial.nc, biology.prm, harvest.prm, run.prm, and functional group.csv. 
However, I can't get the new configuration to run. It triggers a segmentation fault after reading the initial conditions file. I tested version 6718, and some older versions (6704, 6699), I get the same error in all of them.
Running the model through Valgrind shows the fault happens when the running setupMSEBoxModel (see output below).
Do you have any ideas on what I could have missed or why the fault might be occurring?

Thanks

Hem

==242499== Memcheck, a memory error detector
==242499== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==242499== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==242499== Command: atlantisMerged -i AMPS_2024.nc 0 -o AMPS_OUT.nc -r PugetSound_run.prm -f PugetSound_force.prm -p PugetSound_physics.prm -b AMPSbioparam_mv1_2024_V4.prm -h PugetSound_harvest_mfc_tuned.prm -e VMPA_setas_economics.prm -s PugetSoundAtlantisFunctionalGroups_2024.csv -q AMPS_atharvest_2024.prm -m PugetMigrations_mod_bf.csv -d outputFolder
==242499== Parent PID: 214245
==242499==
==242499== Invalid read of size 1
==242499==    at 0x125795: Util_XML_Create_Node (atUtilXML.c:991)
==242499==    by 0x38613B: Convert_Groups_To_XML (atGroupsXML.c:257)
==242499==    by 0x11E03E: Util_Read_Functional_Group_XML (atUtilGroupIO.c:225)
==242499==    by 0x1101D7: setupMSEBoxModel (atlantismain.c:1110)
==242499==    by 0x10E988: main (atlantismain.c:617)
==242499==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==242499==
==242499==
==242499== Process terminating with default action of signal 11 (SIGSEGV)
==242499==  Access not within mapped region at address 0x0
==242499==    at 0x125795: Util_XML_Create_Node (atUtilXML.c:991)
==242499==    by 0x38613B: Convert_Groups_To_XML (atGroupsXML.c:257)
==242499==    by 0x11E03E: Util_Read_Functional_Group_XML (atUtilGroupIO.c:225)
==242499==    by 0x1101D7: setupMSEBoxModel (atlantismain.c:1110)
==242499==    by 0x10E988: main (atlantismain.c:617)
==242499==  If you believe this happened as a result of a stack
==242499==  overflow in your program's main thread (unlikely but
==242499==  possible), you can try to increase the size of the
==242499==  main thread stack using the --main-stacksize= flag.
==242499==  The main thread stack size used in this run was 8388608.
==242499==
==242499== HEAP SUMMARY:
==242499==     in use at exit: 6,262,060 bytes in 75,397 blocks
==242499==   total heap usage: 236,439 allocs, 161,042 frees, 12,040,505 bytes allocated
==242499==
==242499== 153 (96 direct, 57 indirect) bytes in 1 blocks are definitely lost in loss record 3,158 of 3,931
==242499==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==242499==    by 0x397115: add_argument (mapproj.c:582)
==242499==    by 0x39665B: mpInitialise (mapproj.c:331)
==242499==    by 0x184FBF: parseProjectionString (atgeomIO.c:807)
==242499==    by 0x182B85: readMSEBoxModelGeom (atgeomIO.c:130)
==242499==    by 0x11009E: setupMSEBoxModel (atlantismain.c:1077)
==242499==    by 0x10E988: main (atlantismain.c:617)
==242499==
==242499== 185 (88 direct, 97 indirect) bytes in 1 blocks are definitely lost in loss record 3,165 of 3,931
==242499==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==242499==    by 0x397115: add_argument (mapproj.c:582)
==242499==    by 0x396623: mpInitialise (mapproj.c:328)
==242499==    by 0x184FBF: parseProjectionString (atgeomIO.c:807)
==242499==    by 0x182B85: readMSEBoxModelGeom (atgeomIO.c:130)
==242499==    by 0x11009E: setupMSEBoxModel (atlantismain.c:1077)
==242499==    by 0x10E988: main (atlantismain.c:617)
==242499==
==242499== 193 (112 direct, 81 indirect) bytes in 1 blocks are definitely lost in loss record 3,166 of 3,931
==242499==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==242499==    by 0x397115: add_argument (mapproj.c:582)
==242499==    by 0x396746: mpInitialise (mapproj.c:338)
==242499==    by 0x184FBF: parseProjectionString (atgeomIO.c:807)
==242499==    by 0x182B85: readMSEBoxModelGeom (atgeomIO.c:130)
==242499==    by 0x11009E: setupMSEBoxModel (atlantismain.c:1077)
==242499==    by 0x10E988: main (atlantismain.c:617)
==242499==
==242499== 241 (104 direct, 137 indirect) bytes in 1 blocks are definitely lost in loss record 3,231 of 3,931
==242499==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==242499==    by 0x397115: add_argument (mapproj.c:582)
==242499==    by 0x396717: mpInitialise (mapproj.c:336)
==242499==    by 0x184FBF: parseProjectionString (atgeomIO.c:807)
==242499==    by 0x182B85: readMSEBoxModelGeom (atgeomIO.c:130)
==242499==    by 0x11009E: setupMSEBoxModel (atlantismain.c:1077)
==242499==    by 0x10E988: main (atlantismain.c:617)
==242499==
==242499== LEAK SUMMARY:
==242499==    definitely lost: 400 bytes in 4 blocks
==242499==    indirectly lost: 372 bytes in 4 blocks
==242499==      possibly lost: 0 bytes in 0 blocks
==242499==    still reachable: 6,261,288 bytes in 75,389 blocks
==242499==         suppressed: 0 bytes in 0 blocks
==242499== Reachable blocks (those to which a pointer was found) are not shown.
==242499== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==242499==
==242499== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 0 from 0)
==242499==
==242499== 1 errors in context 1 of 5:
==242499== Invalid read of size 1
==242499==    at 0x125795: Util_XML_Create_Node (atUtilXML.c:991)
==242499==    by 0x38613B: Convert_Groups_To_XML (atGroupsXML.c:257)
==242499==    by 0x11E03E: Util_Read_Functional_Group_XML (atUtilGroupIO.c:225)
==242499==    by 0x1101D7: setupMSEBoxModel (atlantismain.c:1110)
==242499==    by 0x10E988: main (atlantismain.c:617)
==242499==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==242499==
==242499== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 0 from 0)

--
Hem Nalini Morzaria-Luna (how to pronounce), Ph.D. | Marine ecologist
Long Live the Kings| NOAA - Affiliate | Pronouns: she/her
Learn how to become a salmon warrior 

+1 (206) 861-7605 | twitter: @hmorzaria | LinkedIn 
_____________________________
** My most consistent working hours are 9am-2pm (PST) **
** I will respond as soon as possible. Thanks for your patience. **
----------------------------------------------

Fulton, Beth (Environment, Hobart)

unread,
Aug 20, 2024, 12:11:45 AM8/20/24
to Hem Nalini Morzaria Luna - NOAA Affiliate, Atlantis ecosystem model, Isaac Kaplan - NOAA Federal, Alaia Morell, Alberto Rovellini - NOAA Affiliate
G’day

Have you tried running with verbose set to 5? If you can do that and pipe the screen output to a file I can look over it and see what’s up. Most likely a missing param or a formatting issue with the csv file. Might also be a good idea to put the param files I. A place I can access in case I need to do the age old “I got to here” method of tracking down the oops. I am trying to set aside time to nicen up how it handles missing params - it used to do it more gently but then compiler options changed and now it set faults which is not helpful.

Beth

From: 'Hem Nalini Morzaria Luna - NOAA Affiliate' via Atlantis ecosystem model <atlantis-eco...@googlegroups.com>
Sent: Tuesday, August 20, 2024 10:47:41 AM
To: Fulton, Beth (Environment, Hobart) <Beth....@csiro.au>; Atlantis ecosystem model <atlantis-eco...@googlegroups.com>
Cc: Isaac Kaplan - NOAA Federal <Isaac....@noaa.gov>; Alaia Morell <ala...@uw.edu>; Alberto Rovellini - NOAA Affiliate <alberto....@noaa.gov>
Subject: Segmentation fault
 
--
You received this message because you are subscribed to the Google Groups "Atlantis ecosystem model" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlantis-ecosystem...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/atlantis-ecosystem-model/CAFKn%3DxPvwf%2B2O6dODRxr1Yn7Qqg6_mRJxudQ%3Dto0TiWnOep%3D%3DQ%40mail.gmail.com.

Hem Nalini Morzaria Luna - NOAA Affiliate

unread,
Aug 20, 2024, 3:10:34 PM8/20/24
to Fulton, Beth (Environment, Hobart), Atlantis ecosystem model, Isaac Kaplan - NOAA Federal, Alaia Morell, Alberto Rovellini - NOAA Affiliate
Beth:
I am attaching the output of the verbose 5 option, I still can't tell where the problem is. I also looked at whether the run.xml was written properly and found one parameter I had not modified but it didn't solve the fault. 
The model files are here, I  invited you to be a member of the respository

Hem

outampsAMPS
Reply all
Reply to author
Forward
0 new messages