Skip to content

[Bug]: SuperTux allows modifying a profile after all profiles have been deleted #3634

@STEMathematics

Description

@STEMathematics

SuperTux Version

supertux2 dev v0.7.0-beta.2 - d408848 (master)

System Information

Debian Sid amd64, Linux kernel 6.18.8+deb14-amd64

Expected Behavior

After all profiles are deleted, options Rename, Reset, Reset all, Delete, Delete all are greyed out.

Actual Behavior

Options Rename, Reset and Delete are not greyed out and in fact can be used. When the options are used in that case, the game crashes or asks about big-number-named profiles, empty-named profiles or garbage-named profiles (example below).

Image

Steps To Reproduce Actual Behavior

  1. Enter the main menu.
  2. Enter options.
  3. Select extras.
  4. Go to the Select Profile section.
  5. Select Delete all.
  6. Confirm the choice.
    (alternatively repeat steps 5 and 6 with the option Delete)
  7. Observe it is possible to reset, rename or delete a profile.

Additional Information

Since the bug can be exploited to crash the game, I tried to record the crashes just in case.
here is normal terminal output

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Error: signal 6:
SuperTux has encountered an unrecoverable error!
./supertux2(ErrorHandler::get_stacktrace[abi:cxx11]()+0x27) [0x55ac1080ddae]
./supertux2(ErrorHandler::handle_error(int)+0x6d) [0x55ac1080e133]
/usr/lib/x86_64-linux-gnu/libc.so.6(+0x40a70) [0x7f038304aa70]
/usr/lib/x86_64-linux-gnu/libc.so.6(+0x973dc) [0x7f03830a13dc]
/usr/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x12) [0x7f038304a942]
/usr/lib/x86_64-linux-gnu/libc.so.6(abort+0x22) [0x7f03830324ac]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xa6aa4) [0x7f03832a6aa4]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb915a) [0x7f03832b915a]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZSt10unexpectedv+0) [0x7f03832a662e]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb93f8) [0x7f03832b93f8]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xa66a2) [0x7f03832a66a2]
./supertux2(std::__new_allocator<char>::allocate(unsigned long, void const*)+0x4b) [0x55ac10469f7d]
./supertux2(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_allocate(std::allocator<char>&, unsigned long)+0x38) [0x55ac104697d7]
./supertux2(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)+0xc2) [0x55ac104696d8]
./supertux2(void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<true>(char const*, unsigned long)+0x37) [0x55ac10468a79]
./supertux2(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0xaf) [0x55ac10467add]
./supertux2(ProfileMenu::menu_action(MenuItem&)+0x652) [0x55ac1092b1d6]
./supertux2(Menu::process_action(MenuAction const&)+0x5e2) [0x55ac10617178]
./supertux2(MenuManager::process_input(Controller const&)+0x269) [0x55ac10629bdf]
./supertux2(ScreenManager::update_gamelogic(float)+0xf0) [0x55ac109746e8]
./supertux2(ScreenManager::loop_iter()+0x399) [0x55ac10975bb9]
./supertux2(ScreenManager::run()+0x2b) [0x55ac10975de1]
./supertux2(Main::launch_game(CommandLineArguments const&)+0x133d) [0x55ac108b8b1f]
./supertux2(Main::run(int, char**)+0x295) [0x55ac108b91ff]
./supertux2(main+0x60) [0x55ac10a2be93]
/usr/lib/x86_64-linux-gnu/libc.so.6(+0x29f75) [0x7f0383033f75]
/usr/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x87) [0x7f0383034027]
./supertux2(_start+0x21) [0x55ac10465821]

then I ran it in gdb and I hope I have managed to get a stacktrace


Thread 8 (Thread 0x7fffd7f236c0 (LWP 8296) "supertux2"):
#0  0x00007ffff711bc69 in syscall () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x00007ffff7c6b6b8 in ?? () from /usr/lib/x86_64-linux-gnu/libopenal.so.1
No symbol table info available.
#2  0x00007ffff7c6aa18 in ?? () from /usr/lib/x86_64-linux-gnu/libopenal.so.1
No symbol table info available.
#3  0x00007ffff72e6d64 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#4  0x00007ffff709f489 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#5  0x00007ffff711dd38 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.

Thread 7 (Thread 0x7fffe48686c0 (LWP 8295) "module-rt"):
#0  0x00007ffff70a76de in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x00007ffff709be84 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2  0x00007ffff709becd in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#3  0x00007ffff711dfed in epoll_wait () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#4  0x00007ffff3cf5f09 in ?? () from /usr/lib/x86_64-linux-gnu/spa-0.2/support/libspa-support.so
No symbol table info available.
#5  0x00007ffff3ce0c7d in ?? () from /usr/lib/x86_64-linux-gnu/spa-0.2/support/libspa-support.so
No symbol table info available.
#6  0x00007fffe6242034 in ?? () from /usr/lib/x86_64-linux-gnu/libpipewire-0.3.so.0
No symbol table info available.
#7  0x00007ffff709f489 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#8  0x00007ffff711dd38 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.

Thread 6 (Thread 0x7fffe50696c0 (LWP 8294) "ALSoftP0"):
#0  0x00007ffff70a76de in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x00007ffff709be84 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2  0x00007ffff709becd in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#3  0x00007ffff711dfed in epoll_wait () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#4  0x00007ffff3cf5f09 in ?? () from /usr/lib/x86_64-linux-gnu/spa-0.2/support/libspa-support.so
No symbol table info available.
#5  0x00007ffff3ce0c7d in ?? () from /usr/lib/x86_64-linux-gnu/spa-0.2/support/libspa-support.so
No symbol table info available.
#6  0x00007fffe6242034 in ?? () from /usr/lib/x86_64-linux-gnu/libpipewire-0.3.so.0
No symbol table info available.
#7  0x00007ffff709f489 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#8  0x00007ffff711dd38 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.

Thread 5 (Thread 0x7fffe586a6c0 (LWP 8293) "PWEventThread"):
#0  0x00007ffff70a76de in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x00007ffff709be84 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2  0x00007ffff709becd in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#3  0x00007ffff711dfed in epoll_wait () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#4  0x00007ffff3cf5f09 in ?? () from /usr/lib/x86_64-linux-gnu/spa-0.2/support/libspa-support.so
No symbol table info available.
#5  0x00007ffff3ce0c7d in ?? () from /usr/lib/x86_64-linux-gnu/spa-0.2/support/libspa-support.so
No symbol table info available.
#6  0x00007fffe6242034 in ?? () from /usr/lib/x86_64-linux-gnu/libpipewire-0.3.so.0
No symbol table info available.
#7  0x00007ffff709f489 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#8  0x00007ffff711dd38 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.

Thread 4 (Thread 0x7fffe618c6c0 (LWP 8292) "module-rt"):
#0  0x00007ffff70a76de in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x00007ffff709be84 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2  0x00007ffff709becd in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#3  0x00007ffff711dfed in epoll_wait () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#4  0x00007ffff3cf5f09 in ?? () from /usr/lib/x86_64-linux-gnu/spa-0.2/support/libspa-support.so
No symbol table info available.
#5  0x00007ffff3ce0c7d in ?? () from /usr/lib/x86_64-linux-gnu/spa-0.2/support/libspa-support.so
No symbol table info available.
#6  0x00007fffe6242034 in ?? () from /usr/lib/x86_64-linux-gnu/libpipewire-0.3.so.0
No symbol table info available.
#7  0x00007ffff709f489 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#8  0x00007ffff711dd38 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.

Thread 3 (Thread 0x7fffe6c946c0 (LWP 8291) "supertu:disk$0"):
#0  0x00007ffff70a76de in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x00007ffff709be84 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2  0x00007ffff709c49c in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#3  0x00007ffff709ea28 in pthread_cond_wait () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#4  0x00007ffff1689eed in ?? () from /usr/lib/x86_64-linux-gnu/libgallium-25.3.3-1.so
No symbol table info available.
#5  0x00007ffff164033c in ?? () from /usr/lib/x86_64-linux-gnu/libgallium-25.3.3-1.so
No symbol table info available.
#6  0x00007ffff1689e1b in ?? () from /usr/lib/x86_64-linux-gnu/libgallium-25.3.3-1.so
No symbol table info available.
#7  0x00007ffff709f489 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#8  0x00007ffff711dd38 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.

Thread 2 (Thread 0x7ffff45ff6c0 (LWP 8290) "SDLTimer"):
#0  0x00007ffff70a76de in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x00007ffff709be84 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2  0x00007ffff709c49c in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#3  0x00007ffff70a7608 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#4  0x00007ffff7b46ca6 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
No symbol table info available.
#5  0x00007ffff7a9cbc3 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
No symbol table info available.
#6  0x00007ffff7a9c679 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
No symbol table info available.
#7  0x00007ffff7b4670d in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
No symbol table info available.
#8  0x00007ffff709f489 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#9  0x00007ffff711dd38 in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.

Thread 1 (Thread 0x7ffff4b15fc0 (LWP 8287) "supertux2"):
#0  0x00007ffff70a13dc in ?? () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x00007ffff704a942 in raise () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2  0x00007ffff70324ac in abort () from /usr/lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#3  0x00007ffff72a6aa4 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#4  0x00007ffff72b915a in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#5  0x00007ffff72a662e in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#6  0x00007ffff72b93f8 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#7  0x00007ffff72a66a2 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#8  0x0000555555cf8f7d in std::__new_allocator<char>::allocate (this=0x7fffffffce60, __n=93825082138865) at /usr/include/c++/15/bits/new_allocator.h:151
        __al = <optimized out>
#9  0x0000555555cf87d7 in std::allocator_traits<std::allocator<char> >::allocate (__a=..., __n=93825082138865) at /usr/include/c++/15/bits/alloc_traits.h:614
No locals.
#10 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_allocate (__a=..., __n=93825082138865) at /usr/include/c++/15/bits/basic_string.h:142
        __p = 0x7fffffffce60 "p\316\377\377\377\177"
#11 0x0000555555cf86d8 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create (this=0x7fffffffce60, __capacity=@0x7fffffffcd98: 93825082138864, __old_capacity=0) at /usr/include/c++/15/bits/basic_string.tcc:164
No locals.
#12 0x0000555555cf7a79 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<true> (this=0x7fffffffce60, __str=0x55555adc4530 "", __n=93825082138864) at /usr/include/c++/15/bits/basic_string.tcc:291
No locals.
#13 0x0000555555cf6add in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string (this=0x7fffffffce60, __str="\000\000\000\000\000\000\000\000Q\000\000\000\000\000\000\000PX\177WUU\000\000\360\365\200WUU\000\000\320ݰZUU", '\000' <repeats 42 times>, "P\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\001\000\000\000T\000\201h\240\264\252ZUU\000\000\240\373\201VUU", '\000' <repeats 18 times>, "\213", '\000' <repeats 15 times>, "A\000\000\000\000\000\000\000\001\000\000\000T\000\201h`!\250ZUU\000\000\240\373\201VUU", '\000' <repeats 18 times>...) at /usr/include/c++/15/bits/basic_string.h:617
No locals.
#14 0x00005555561ba1d6 in ProfileMenu::menu_action (this=0x55555aec2340, item=...) at /home/vm/Downloads/supertux/src/supertux/menu/profile_menu.cpp:165
        name = "\220\316\377\377\377\177\000\000\220\235\271WUU\000\000\240\316\377\377\377\177\000\000x\325\"VUU\000\000\260\316\377\377\377\177\000\000\220\235\271WUU\000\000\300\316\377\377\377\177\000\000\375\317\"VUU\000\000\3205aVUU\000\000\3205aVUU\000\000\340\316\377\377\377\177\000\000\363\a\323UUU\000\000(\214\227WUU\000\000\220\320\377\377\377\177\000\000\020\317\377\377\377\177\000\000E[\323U\373\377\377\377(\214\227WUU\000\000(\214\227WUU\000\000\220\320\377\377\377\177\000\000Pj\204WUU\000\000p\317\377\377\377\177\000\000hQ\323UUU\000\000h\317\377\377\377\177\000\000(\214\227WUU\000\000\220\320\377\377\377\177\000\000"...
        message = "\300\316\377\377\377\177\000\000\375\317\"VUU\000\000\3205aVUU\000\000\3205aVUU\000\000\340\316\377\377\377\177\000\000\363\a\323UUU\000\000(\214\227WUU\000\000\220\320\377\377\377\177\000\000\020\317\377\377\377\177\000\000E[\323U\373\377\377\377(\214\227WUU\000\000(\214\227WUU\000\000\220\320\377\377\377\177\000\000Pj\204WUU\000\000p\317\377\377\377\177\000\000hQ\323UUU\000\000h\317\377\377\377\177\000\000(\214\227WUU\000\000\220\320\377\377\377\177\000\000Pj\204WUU\000\000\021\000\000\000:", '\000' <repeats 27 times>, "\360\317\377\377\377\177\000\000"...
        id = @0x7fffffffceec: -5
#15 0x0000555555ea6178 in Menu::process_action (this=0x55555aec2340, action=@0x7fffffffd3dc: MenuAction::HIT) at /home/vm/Downloads/supertux/src/gui/menu.cpp:445
        last_active_item = 9
        last_action = false
#16 0x0000555555eb8bdf in MenuManager::process_input (this=0x555557803610, controller=...) at /home/vm/Downloads/supertux/src/gui/menu_manager.cpp:112
        action = MenuAction::HIT
#17 0x00005555562036e8 in ScreenManager::update_gamelogic (this=0x555556ebe440, dt_sec=0.00900000054) at /home/vm/Downloads/supertux/src/supertux/screen_manager.cpp:325
        controller = @0x5555567442e0: {_vptr.Controller = 0x5555565ea180 <vtable for Controller+16>, m_controls = {false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false}, m_old_controls = {false <repeats 20 times>}, m_touchscreen = false, m_jump_key_pressed = false}
#18 0x0000555556204bb9 in ScreenManager::loop_iter (this=0x555556ebe440) at /home/vm/Downloads/supertux/src/supertux/screen_manager.cpp:684
        dtime = 0.00900000054
        i = 0
        now = std::chrono::_V2::steady_clock time_point = { 3980962453882ns }
        nsecs = 53975
        max_elapsed_time = 0.0600000024
        always_draw = false
        speed_multiplier = 1
        steps = 1
        fps = 62.3723335
        time_offset = 4.40903894e+13
#19 0x0000555556204de1 in ScreenManager::run (this=0x555556ebe440) at /home/vm/Downloads/supertux/src/supertux/screen_manager.cpp:729
No locals.
#20 0x0000555556147b1f in Main::launch_game (this=0x555556695970, args=...) at /home/vm/Downloads/supertux/src/supertux/main.cpp:732
        video = VideoSystem::VIDEO_SDL
#21 0x00005555561481ff in Main::run (this=0x555556695970, argc=1, argv=0x7fffffffdc08) at /home/vm/Downloads/supertux/src/supertux/main.cpp:826
        result = 0
        args = {m_action = CommandLineArguments::NO_ACTION, m_log_level = LOG_WARNING, datadir = std::optional [no contained value], userdir = std::optional [no contained value], fullscreen_size = std::optional [no contained value], fullscreen_refresh_rate = std::optional [no contained value], window_size = std::optional [no contained value], aspect_size = std::optional [no contained value], use_fullscreen = std::optional [no contained value], video = std::optional [no contained value], show_fps = std::optional [no contained value], show_player_pos = std::optional [no contained value], sound_enabled = std::optional [no contained value], music_enabled = std::optional [no contained value], filenames = std::vector of length 0, capacity 0, enable_script_debugger = std::optional [no contained value], tux_spawn_pos = std::optional [no contained value], sector = std::optional [no contained value], spawnpoint = std::optional [no contained value], developer_mode = std::optional [no contained value], christmas_mode = std::optional [no contained value], repository_url = std::optional [no contained value], editor = std::optional [no contained value], resave = std::optional [no contained value], log_tinygettext = false}
#22 0x00005555562bae93 in main (argc=1, argv=0x7fffffffdc08) at /home/vm/Downloads/supertux/src/main.cpp:30
        ret = 21845

Guidelines For Reporting Issues

  • I have read https://github.com/SuperTux/supertux/blob/master/CONTRIBUTING.md#bug-reports.
  • I have verified this isn't an issue that's already been reported.
  • I have verified this isn't a discussion, or an issue about a crash or a feature request, but rather an actual bug ─ that is, the game did something not intended.
  • I have verified this issue is not about wrong translations (use Transifex for those), or anything unsupported (e.g. third-party add-ons).
  • In this report, I have only included details about one (1) bug.
  • If I make a mistake while submitting this report, I agree to use the "Edit" feature to correct it, instead of closing this issue and opening a new one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions