Skip to content

Crash when network game starts if built with -D_GLIBCXX_ASSERTIONS #309

@andy5995

Description

@andy5995

When a network game starts, after the loading screen, the game freezes for a moment, then crashes.

The console output is similar to

$ megaglest
megaglest v3.13.0
Compiled using: GNUC: 140201 [64bit] platform: Linux-X64 endianness: little
GIT: [Rev: $5604.3a5d459$] - using STREFLOP [SSE] - [no-denormals]
Game unique identifier is: 06e55166-ee27-11ef-affe-fd95e2b16f6a
/usr/include/c++/14.2.1/bits/stl_vector.h:1130: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator [with _Tp = Glest::Game::NetworkCommand; _Alloc = std::allocatorGlest::Game::NetworkCommand; reference = Glest::Game::NetworkCommand&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.

I got this output now when trying megaglest from the Manjaro package (on Manjaro). I cloned the MegaGlest Arch PKGBUILD repo and built with makepkg. I see by default MG is being built with -D_GLIBCXX_ASSERTIONS.

I noticed this when working on the meson PR (#256) and added the b_ndebug=true option:

    'buildtype=debugoptimized',
    'cpp_std=c++11',
    'b_ndebug=true',

which removes -D_GLIBCXX_ASSERTIONS from the build.

MegaGlest should work as expected whether that flag is added or not. This issue needs to be debugged and fixed.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions