Latest Posts

Topic: editor crash with flatpak from development version

tothxa
Avatar
Topic Opener
Joined: 2021-03-24, 12:44
Posts: 436
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2021-03-31, 17:03

I tried to build a flatpak from the current development version so that my kids (factory endless OS on their laptop) can help testing the translations. I used https://github.com/scx/widelands-flatpak and it seems to work fine.

However, today my daughter found a problem: When editing a map's description or hint, hitting backspace causes Widelands to crash. This only happens with the flatpak development build (even on my laptop, test-running the build directly), my native devel/debug build is not affected. Map name and Authors fields are not affected, so I looked for another "long text editor" field in addons packager, and it happens there too.

Error message:

/usr/include/c++/9.3.0/bits/basic_string.h:1067: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference = char&; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]: Assertion '__pos <= size()' failed.

What should I do with this? Is it worth tracking down? If so, how can I do it?

Edited: 2021-03-31, 17:03

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-03-31, 17:24

The stable flatpak provides build21; the beta flatpak is updated only sporadically and therefore terribly outdated, the last update was in July. If the bug can not be reproduced with a recent build it's most likely fixed already.

So currently flatpak is not really useful for testing recent development of Widelands; you'll have to clone and compile the latest git master for this.

It would be cool to have a GitHub action that automatically updates the Flatpak beta to the latest state of the art daily or so… I have no experience with Flatpak, but perhaps someone else might write such an action someday…


Top Quote
tothxa
Avatar
Topic Opener
Joined: 2021-03-24, 12:44
Posts: 436
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2021-03-31, 18:27

I did build it myself from the current development version from github/widelands. So it must be either a problem with some library version (I used freedesktop SDK 19.08, as build-21 did, plus there are some other minor deps pulled in from the Net by flatpak-builder), or some weird stuff in the way flatpak builds or runs it. (though it's not full-on flatpak weirdness, as it happens in the test-run as well)

The sources are the same as I used for building the native test version, which works.

Edited: 2021-03-31, 18:30

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-03-31, 18:38

So it happens in the current dev version as well? Then it would be helpful to have a debugger backtrace, and/or a way to reproduce the issue (e.g. a specific string that can be copy-pasted into a MultilineEditbox and reproducably causes the crash when the cursor is at a specific position)


Top Quote
tothxa
Avatar
Topic Opener
Joined: 2021-03-24, 12:44
Posts: 436
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2021-03-31, 19:23

It only happens in the flatpak built from the current development version. Old flatpak from flathub is OK, as is normal build of current development version. That's why I didn't report it on github.

I guess I'll try to build b-21 flatpak the same way. That will at least check the possibility of some problem with my use of flatpak-builder...

(it is easy to trigger it where it is present though: just open any window with MultilineEditbox, press backspace in the editbox, and see it crash)


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-03-31, 21:06

I have tried to build a flatpak with current master locally but it refuses to work for me, it seems that some required build libraries have broken dependencies face-sad.png

Could you please try to run Widelands with gdb inside the flatpak environment as described at https://docs.flatpak.org/en/latest/debugging.html, and attach the output:

flatpak run --command=sh --devel <application-id>
  gdb /app/bin/<application-binary>
    run
    [ ... now make it crash ... ]
    bt

(you might need to adjust -DCMAKE_BUILD_TYPE=Release to -DCMAKE_BUILD_TYPE=Debug in the configuration file before building to get meaningful output from gdb)


Top Quote
tothxa
Avatar
Topic Opener
Joined: 2021-03-24, 12:44
Posts: 436
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2021-03-31, 21:25

OK, I'll try it tomorrow.

For now I just wanted to report that it's not my environment. I rebuilt build-21 flatpak, and it does not have the bug. (I made sure - as far as I can tell - that the same versions of all dependencies were used)


Top Quote
tothxa
Avatar
Topic Opener
Joined: 2021-03-24, 12:44
Posts: 436
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2021-04-01, 12:52

I did it... Here's the debug log.

(revdetect is broken because I don't let flatpak touch the git repo)


Attachment:
mledit-bsp-crashlog.txt (17.1 KB)

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-04-01, 13:13

Thanks! We had several crashes like that before, and evidently did not fix the problem entirely yet. Thanks for finding this, it will need to be fixed before the release. Opened an issue https://github.com/widelands/widelands/issues/4796


Top Quote
tothxa
Avatar
Topic Opener
Joined: 2021-03-24, 12:44
Posts: 436
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2021-04-01, 17:25

Thanks! Let me know if you need more testing for it.


Top Quote