Hello,
this issue is still present with current testing.

For some weird reason this loop in line 195 is never left.
Putting a printf into this loop confirms that n counts correctly,
but the loop is not left when it reaches 13 (NB_BUILDING).

Strangely a similar loop with the same condition in line 186 works.

Not being able to explain it, I wonder if this might be a GCC issue?

Upstream made a change to this line in [1], changing the condition from
"n<IntBuildingType::NB_BUILDING" to "n<3".
Rebuilding the Debian package with this change makes it work.

Kind regards,
Bernhard



Thread 1 "glob2" received signal SIGSEGV, Segmentation fault.
0x0000555555723317 in Settings::save (this=<optimized out>, filename=<optimized 
out>) at /usr/include/c++/13/bits/basic_string.h:222
222           _M_data() const
(gdb) bt
#0  0x0000555555723317 in Settings::save (this=<optimized out>, 
filename=<optimized out>) at /usr/include/c++/13/bits/basic_string.h:222
#1  0x000055555572d613 in SettingsScreen::onAction (this=0x7fffffff93c0, source=<optimized out>, 
action=<optimized out>, par1=<optimized out>, par2=<optimized out>) at 
src/SettingsScreen.cpp:373
#2  0x00005555557d1445 in GAGGUI::Screen::dispatchEvents 
(this=this@entry=0x7fffffff93c0, event=event@entry=0x7fffffff9260) at 
libgag/src/GUIBase.cpp:596
#3  0x00005555557d185b in GAGGUI::Screen::execute 
(this=this@entry=0x7fffffff93c0, gfx=0x555555920560, 
stepLength=stepLength@entry=40) at libgag/src/GUIBase.cpp:506
#4  0x000055555566cfb0 in Glob2::run (this=this@entry=0x7fffffffe357, argc=<optimized 
out>, argv=<optimized out>) at src/Glob2.cpp:348
#5  0x00005555555b58fa in main (argc=<optimized out>, argv=<optimized out>) at 
src/Glob2.cpp:409

(gdb) print n
$2 = 8331033
(gdb) print keyname
$3 = "defaultFlagRadius[8331033]"

src/Settings.cpp:
195                     for(int n=0; n<IntBuildingType::NB_BUILDING; ++n)
196                     {
197                             std::string keyname = 
"defaultFlagRadius["+boost::lexical_cast<std::string>(n)+"]";
198                             Utilities::streamprintf(stream, "%s=%i\n", 
keyname.c_str(), defaultFlagRadius[n]);
199                     }



[1] 
https://github.com/Globulation2/glob2/commit/30d272363d14cb88882f3494e8dc7ef86e147b6b

Reply via email to