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

libc++abi: terminating due to uncaught exception #134

Closed
ChristopherMayes opened this issue Dec 23, 2023 · 2 comments · Fixed by #138
Closed

libc++abi: terminating due to uncaught exception #134

ChristopherMayes opened this issue Dec 23, 2023 · 2 comments · Fixed by #138
Assignees
Labels
bug Something isn't working

Comments

@ChristopherMayes
Copy link
Contributor

Describe the bug
I get the following with a simple example:

---------------------------------------------
GENESIS - Version 4.6.5 has started...
Compile info: Compiled by runner at 2023-12-22 15:23:54 [UTC] from Git Commit ID: 
Starting Time: Sat Dec 23 08:31:55 2023

MPI-Comm Size: 1 node

Opened input file genesis4.in
Parsing lattice file genesis4_drift.lat ...
Setting up time window of 71.8 microns with 718 sample points...
Adding profile with label: beamcurrent
Generating input particle distribution...

Running Core Simulation...
Time-dependent run with 718 slices for a time window of 71.8 microns
Initial analysis of electron beam and radiation field...
  Calculation: 0% done
Writing output file...

Core Simulation done.
End of Track
Writing particle distribution to file: end.par.h5 ...
libc++abi: terminating due to uncaught exception of type std::out_of_range: vector
./run: line 1: 38534 Abort trap: 6           genesis4 genesis4.in

To Reproduce
Run genesis4 genesis4.in on the attached files

error.zip

@ChristopherMayes ChristopherMayes added the bug Something isn't working label Dec 23, 2023
@ken-lauer
Copy link
Contributor

This is being thrown on this line:

for (int ip=0; ip<npart;ip++){work[ip]=beam->beam.at(islice).at(ip*stride).gamma;}

This happens at beam->beam.at(islice).at(ip*stride) where ip*stride=128 is over the number of particles (127).
npart is also 256, which means this isn't just an off-by-one error.

The input file states npart 128, so where is npart = 256 coming in? Hmm...

@ken-lauer
Copy link
Contributor

git bisect indicates 88f7200 is the commit that introduced this issue:

$ git bisect good
88f7200c13ce2e929cf725fa3857a56ae946acf5 is the first bad commit
commit 88f7200c13ce2e929cf725fa3857a56ae946acf5
Author: reiche <sven.reiche@psi.ch>
Date:   Wed Dec 6 15:17:12 2023 +0100

    Added downsamplig ability for particle dumps.

 CHANGELOG.md             | 10 +++++++++-
 include/writeBeamHDF5.h  |  2 +-
 manual/MAIN_INPUT.md     |  1 +
 src/Core/Control.cpp     |  2 +-
 src/IO/writeBeamHDF5.cpp | 20 +++++++++++---------
 src/Main/Dump.cpp        |  7 ++++++-
 6 files changed, 29 insertions(+), 13 deletions(-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants