-
Notifications
You must be signed in to change notification settings - Fork 77
Description
Describe the bug
Hi~ I'm a beginner in astrophysics. I encountered a crash when running COMPAS on Manjaro with newer GCC and dependencies. The program crashes with the following error:
./COMPAS
COMPAS v03.22.01 (gsl v2.8, boost v1.88.0, HDF5 v1.14.6)
Compact Object Mergers: Population Astrophysics and Statistics
by Team COMPAS (http://compas.science/index.html)
A binary star simulator
Go to https://compas.readthedocs.io/en/latest/index.html for the online documentation
Check https://compas.readthedocs.io/en/latest/pages/whats-new.html to see what's new in the latest release
Start generating binaries at Thu Oct 30 23:06:36 2025
/usr/include/c++/15.2.1/bits/stl_vector.h:1263: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = STRING_QUALIFIER; _Alloc = std::allocator<STRING_QUALIFIER>; reference = STRING_QUALIFIER&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
zsh: IOT instruction (core dumped)
Label the issue
severity_minor - This is a minor bug with minimal impact
To Reproduce
Steps to reproduce the behavior:
- Compile the program with gsl v2.8, boost v1.88.0, HDF5 v1.14.6
- Run it with
./COMPAS - Then the program crash.
- With error
/usr/include/c++/15.2.1/bits/stl_vector.h:1263: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = STRING_QUALIFIER; _Alloc = std::allocator<STRING_QUALIFIER>; reference = STRING_QUALIFIER&; size_type = long unsigned int]: Assertion '__n < this->size()' failed. zsh: IOT instruction (core dumped)
Expected behavior
No crash on startup
Screenshots
Versioning (please complete the following information):
- OS: Manjaro KDE plasma with kernel 6.17.1 on stable branch
- GCC 15.2.1 20250813
- COMPAS rel_v03.27.01 and dev branch
- Dep gsl v2.8, boost v1.88.0, HDF5 v1.14.6
Additional context
I'm also a new beginner in cpp, It seems the issue is caused by inconsistent vector sizes in the LogfileDetails structure in Log.cpp. By adding extra stringTypes.push_back() calls to StandardLogFileDetails() as placeholders seems fix the issue. But I'm not sure this is correct fix or not. Probably not an ideal fix, but it works! :)
StackTrace
Start generating binaries at Fri Oct 31 15:59:44 2025
/usr/include/c++/15.2.1/bits/stl_vector.h:1263: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = STRING_QUALIFIER; _Alloc = std::allocator<STRING_QUALIFIER>; reference = STRING_QUALIFIER&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Program received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
44 return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
(gdb) bt
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1 0x00007ffff6c98a13 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:89
#2 0x00007ffff6c3e410 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3 0x00007ffff6c2557a in __GI_abort () at abort.c:77
#4 0x00007ffff709a41f in std::__glibcxx_assert_fail (file=<optimized out>, line=<optimized out>, function=<optimized out>, condition=<optimized out>)
at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/assert_fail.cc:41
#5 0x0000555555e1cdac in std::vector<STRING_QUALIFIER, std::allocator<STRING_QUALIFIER> >::operator[] (this=0x7fffffffc290, __n=40)
at /usr/include/c++/15.2.1/bits/stl_vector.h:1263
#6 0x0000555555dc5af6 in Log::StandardLogFileDetails (this=0x5555581bc3c0, p_Logfile=LOGFILE::BSE_SUPERNOVAE, p_FileSuffix="") at Log.cpp:2878
#7 0x0000555556679f03 in Log::LogStandardRecord<BaseBinaryStar> (this=0x5555581bc3c0, p_LogClass="BSE_SNE", p_LogLevel=0,
p_LogFile=LOGFILE::BSE_SUPERNOVAE, p_RecordType=1, p_Star=0x5555590f09e0, p_FileSuffix="") at /home/wlmqljj/codes/raw/COMPAS-dev/src/Log.h:1033
#8 0x000055555667933b in Log::LogBSESupernovaDetails<BaseBinaryStar> (this=0x5555581bc3c0, p_Binary=0x5555590f09e0,
p_RecordType=BSE_SN_RECORD_TYPE::DEFAULT) at /home/wlmqljj/codes/raw/COMPAS-dev/src/Log.h:1226
#9 0x00005555566788ed in BaseBinaryStar::PrintSupernovaDetails (this=0x5555590f09e0, p_RecordType=BSE_SN_RECORD_TYPE::DEFAULT)
at /home/wlmqljj/codes/raw/COMPAS-dev/src/BaseBinaryStar.h:572
#10 0x000055555661bb47 in BaseBinaryStar::ResolveSupernova (this=0x5555590f09e0) at BaseBinaryStar.cpp:1473
#11 0x000055555661c2ad in BaseBinaryStar::EvaluateSupernovae (this=0x5555590f09e0) at BaseBinaryStar.cpp:1502
c#12 0x0000555556628c7c in BaseBinaryStar::EvaluateBinary (this=0x5555590f09e0, p_Dt=0.0014168914539999999) at BaseBinaryStar.cpp:3162
#13 0x0000555556629d2a in BaseBinaryStar::Evolve (this=0x5555590f09e0) at BaseBinaryStar.cpp:3342
#14 0x000055555671dffa in BinaryStar::Evolve (this=0x5555590e6e30) at /home/wlmqljj/codes/raw/COMPAS-dev/src/BinaryStar.h:50
#15 0x00005555566d4c36 in EvolveBinaryStars () at main.cpp:705
#16 0x00005555566d72a7 in main (argc=1, argv=0x7fffffffd808) at main.cpp:918
Thanks in advance.