Project

General

Profile

Bug #857808

Qt client dumping core while loading alternative tileset

Added by Chippo Elder 5 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Category:
gui-qt
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

I had previously loaded the augmented2 modpack with the modpack installer. I started a new game and selected augmented2 ruleset. It suggested that I load another tileset, so I clicked on Load Tileset.

In the console, I saw:

chippo@chippo-Aspire-V3-731:~$ freeciv-qt
2: Loading tileset "amplio2".
QSocketNotifier: Invalid socket 41 and type 'Read', disabling...
2: Loading tileset "amplio2".
2: Loading tileset "hexemplio".
2: Loading tileset "augmentedi".
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
Segmentation fault (core dumped)

And a backtrace from gdb:

(gdb) bt full
#0 strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:120
#1 0x0000564ea9b637b6 in load_gfx_file (gfx_filename=0x564eadfbcb30 "augmented2/wonders/geoglyph") at tilespec.c:1473
real_full_name = <optimized out>
full_name = <optimized out>
gfx_fileexts = 0x564eaa73e968
gfx_fileext = 0x2e65756761 <error: Cannot access memory at address 0x2e65756761>
s = <optimized out>
__FUNCTION
= "load_gfx_file"
#2 0x0000564ea9b64e4c in load_sprite (t=t@entry=0x564eaf56b160, tag_name=tag_name@entry=0x564ea9e06f91 <improvement_types+9713> "b.geoglyph", scale=scale@entry=false, smooth=smooth@entry=true)
at tilespec.c:2481
w = 22094
h = -1367325904
s = <optimized out>
ss = 0x564eae804330
sprite_scale = 1
FUNCTION = "load_sprite"
#3 0x0000564ea9b6618e in tiles_lookup_sprite_tag_alt
(t=t@entry=0x564eaf56b160, level=level@entry=LOG_VERBOSE, tag=tag@entry=0x564ea9e06f91 <improvement_types+9713> "b.geoglyph", alt=alt@entry=0x564ea9e06fc1 <improvement_types+9761> "a.alphabet", what=what@entry=0x564ea9d2cd31 "improvement", name=name@entry=0x564ea9e06f60 <improvement_types+9664> "Geoglyph", scale=false) at tilespec.c:3297
sp = <optimized out>
FUNCTION = "tiles_lookup_sprite_tag_alt"
#4 0x0000564ea9b69362 in tileset_setup_impr_type (t=0x564eaf56b160, pimprove=0x564ea9e06f20 <improvement_types+9600>) at tilespec.c:3401
#5 0x0000564ea9b4ceca in handle_ruleset_building (p=p@entry=0x564ead6d4eb0) at packhand.c:3422
i = <optimized out>
b = <optimized out>
FUNCTION = "handle_ruleset_building"
#6 0x0000564ea9b50889 in client_handle_packet (type=type@entry=PACKET_RULESET_BUILDING, packet=packet@entry=0x564ead6d4eb0) at packhand_gen.c:367
#7 0x0000564ea9b1089f in client_packet_input (packet=packet@entry=0x564ead6d4eb0, type=150) at client_main.c:770
FUNCTION = "client_packet_input"
#8 0x0000564ea9b1779c in input_from_server (fd=fd@entry=41) at clinet.c:416
type = PACKET_RULESET_BUILDING
packet = 0x564ead6d4eb0
nb = <optimized out>
FUNCTION = "input_from_server"
#9 0x0000564ea9bbfc14 in fc_client::server_input(int) (this=0x564eaab3da70, sock=41) at fc_client.cpp:462
#10 0x00007f589a71b5c8 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007f589a728135 in QSocketNotifier::activated(int, QSocketNotifier::QPrivateSignal) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007f589a728491 in QSocketNotifier::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007f5899f3ba86 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007f5899f44e00 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007f589a6efa9a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007f589a748305 in () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007f5897d7884d in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
--Type <RET> for more, q to quit, c to continue without paging--c
#18 0x00007f5897d78ad0 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007f5897d78b73 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007f589a7476a5 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007f589a6ee63b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#22 0x00007f589a6f63a6 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x0000564ea9bbfee1 in fc_client::fc_main(QApplication*) (this=0x564eaab3da70, qapp=0x564eaa739720) at fc_client.cpp:257
#24 0x0000564ea9a9c6d3 in qtg_ui_main(int, char**) (argc=<optimized out>, argv=<optimized out>) at gui_main.cpp:191
qpm = <optimized out>
app_icon = {d = 0x564eaae8aa80}
#25 0x0000564ea9b10fce in client_main (argc=1, argv=0x7ffd9711a2f8) at client_main.c:685
i = 1
loglevel = LOG_NORMAL
ui_options = <optimized out>
ui_separator = <optimized out>
option = <optimized out>
fatal_assertions = -1
aii = 1
FUNCTION = "client_main"
#26 0x00007f589988b1e3 in __libc_start_main (main=0x564ea9a9a460 <main(int, char**)>, argc=1, argv=0x7ffd9711a2f8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd9711a2e8) at ../csu/libc-start.c:308
result = <optimized out>
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, 210933076661727699, 94895853909888, 140727137968880, 0, 0, 5875824468169683411, 5818934438945583571}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x7ffd9711a308, 0x7f589b611190}, data = {prev = 0x0, cleanup = 0x0, canceltype = -1760451832}}}
not_first_call = <optimized out>
#27 0x0000564ea9a9b7ae in _start () at gui_main.cpp:114

fr-2.6.tar.gz (4.46 MB) fr-2.6.tar.gz Chippo Elder, 2020-01-30 06:08 AM
augmented2.png (9.56 KB) augmented2.png Chippo Elder, 2020-01-30 06:42 AM
0004-qt-Properly-NULL-terminate-gfx-file-extension-list.patch (1.4 KB) 0004-qt-Properly-NULL-terminate-gfx-file-extension-list.patch Marko Lindqvist, 2020-01-30 04:32 PM

History

#1 Updated by Chippo Elder 5 months ago

Sorry. This is 2.6.1+.

#2 Updated by Marko Lindqvist 5 months ago

Can you load the 'augmentedi' tileset from the settings, or with commandline parameter '-t augmentedi', i.e., is this crash specific to loading the tileset from that 'ruleset suggestion' dialog?

#3 Updated by Chippo Elder 5 months ago

If I use the command line parameter "freeciv-qt -t augmentedi" and I start a game with a ruleset other than augmented2, I don't get a core dump. But if I start a game with augmented2, I get another core dump. Here it is:

(gdb) bt
#0 __strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:120
#1 0x0000563a14c647b6 in load_gfx_file (gfx_filename=0x563a16f7e3c0 "augmented2/wonders/geoglyph") at tilespec.c:1473
#2 0x0000563a14c65e4c in load_sprite (t=t@entry=0x563a16f14f40, tag_name=tag_name@entry=0x563a14f07f91 <improvement_types+9713> "b.geoglyph", scale=scale@entry=false, smooth=smooth@entry=true)
at tilespec.c:2481
#3 0x0000563a14c6718e in tiles_lookup_sprite_tag_alt
(t=t@entry=0x563a16f14f40, level=level@entry=LOG_VERBOSE, tag=tag@entry=0x563a14f07f91 <improvement_types+9713> "b.geoglyph", alt=alt@entry=0x563a14f07fc1 <improvement_types+9761> "a.alphabet", what=what@entry=0x563a14e2dd31 "improvement", name=name@entry=0x563a14f07f60 <improvement_types+9664> "Geoglyph", scale=false) at tilespec.c:3297
#4 0x0000563a14c6a362 in tileset_setup_impr_type (t=0x563a16f14f40, pimprove=0x563a14f07f20 <improvement_types+9600>) at tilespec.c:3401
#5 0x0000563a14c4deca in handle_ruleset_building (p=p@entry=0x563a1e9c6be0) at packhand.c:3422
#6 0x0000563a14c51889 in client_handle_packet (type=type@entry=PACKET_RULESET_BUILDING, packet=packet@entry=0x563a1e9c6be0) at packhand_gen.c:367
#7 0x0000563a14c1189f in client_packet_input (packet=packet@entry=0x563a1e9c6be0, type=150) at client_main.c:770
#8 0x0000563a14c1879c in input_from_server (fd=fd@entry=41) at clinet.c:416
#9 0x0000563a14cc0c14 in fc_client::server_input(int) (this=0x563a17323270, sock=41) at fc_client.cpp:462
#10 0x00007fe04e2ab5c8 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007fe04e2b8135 in QSocketNotifier::activated(int, QSocketNotifier::QPrivateSignal) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007fe04e2b8491 in QSocketNotifier::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007fe04dacba86 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007fe04dad4e00 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007fe04e27fa9a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007fe04e2d8305 in () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007fe04b90884d in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007fe04b908ad0 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007fe04b908b73 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007fe04e2d76a5 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007fe04e27e63b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#22 0x00007fe04e2863a6 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x0000563a14cc0ee1 in fc_client::fc_main(QApplication*) (this=0x563a17323270, qapp=0x563a16ee1ee0) at fc_client.cpp:257
#24 0x0000563a14b9d6d3 in qtg_ui_main(int, char**) (argc=<optimized out>, argv=<optimized out>) at gui_main.cpp:191
#25 0x0000563a14c11fce in client_main (argc=1, argv=0x7ffd43c99fb8) at client_main.c:685
#26 0x00007fe04d41b1e3 in __libc_start_main (main=
0x563a14b9b460 <main(int, char**)>, argc=3, argv=0x7ffd43c99fb8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd43c99fa8) at ../csu/libc-start.c:308
#27 0x0000563a14b9c7ae in _start () at gui_main.cpp:114

#4 Updated by Jacob Nevins 5 months ago

I've also been playing augmented2 with augmentedi tileset, and not run into this.

I've tried reproducing it with no luck.

But, my version of augmented2 doesn't have a graphic "augmented2/wonders/geoglyph", which shows up in your backtrace, so I'm guessing you have a different (probably newer) version. Might be worth zipping up your ~/.freeciv/2.6 so we don't lose reproducibility.

(I do get the "libpng warning: iCCP: known incorrect sRGB profile", and I think they are unrelated; I get them with other tilesets too. Web search suggests they are a simple problem that the tileset maintainer can easily clear up.)

#5 Updated by Chippo Elder 5 months ago

Jacob Nevins wrote:

Might be worth zipping up your ~/.freeciv/2.6 so we don't lose reproducibility.

There you go.

#6 Updated by Chippo Elder 5 months ago

For my part, I desperately just want to see:
http://149.156.194.203/~mczapkie/fc/augmented/doc/techtree.png
working in any client.

I tried many things, including following the instructions at https://freeciv.fandom.com/wiki/Augmented2_ruleset_modpack and 'git clone' (glad to see that freeciv-mp-gtk3 understands file:// URLs, but it doesn't like URLs like https://github.com/Wahazar/augmented2 or https://github.com/Wahazar/augmented2/tree/longturn, but that's stuff for another ticket).

All methods and all clients lead to geoglyph trauma, so I don't think your reproducibility is in jeopardy.

With gtk3.22 (2.6.1+), on the console I see:

[Detaching after fork from child process 115472]
2: Loading tileset "amplio2".
2: Loading tileset "augmentedi".
[Detaching after fork from child process 115473]
2: Loading tileset "amplio2".
2: Loading tileset "augmentedi".
[New Thread 0x7fffc99ba700 (LWP 115474)]
2: Loading tileset "augmentedi".
1: Could not load gfx file "augmented2/wonders/geoglyph".
0: Couldn't load gfx file "augmented2/wonders/geoglyph" for sprite 'b.geoglyph'.
[Thread 0x7fffc99ba700 (LWP 115474) exited]

There's some extra rubbish in there, 'cos I was running under gdb.

Attached is a screenshot of the popup.

This all happens when you go Start New Game and try change the ruleset to augmented2.

#7 Updated by Chippo Elder 5 months ago

Chippo Elder wrote:

All methods and all clients lead to geoglyph trauma, so I don't think your reproducibility is in jeopardy.

Actually I did now manage to get rid of the geoglyph stuff, by following a third recipe of Wahazar's from http://forum.freeciv.org/f/viewtopic.php?f=11&t=91047 (manually 'cp' the files and directories from your git repository to the appropriate place in ~/.freeciv/2.6/, not using freeciv-mp-gtk3).

Now, both clients say: "Ruleset couldn't be loaded. Keeping previous one." And no core dumps.

#8 Updated by Chippo Elder 5 months ago

Now, in Chat I see:

Console: 'topology' has been set to "Wrap East-West", "Isometric", and "Hexagonal" (WRAPX|ISO|HEX).
chippo: 'set victories "ALLIED"'
Console: 'victories' has been set to "Allied victory" (ALLIED).
chippo: 'read augmented2.serv'
chippo: 'set techlevel=0'
Console: 'techlevel' has been set to 0.
/(unknown): Unknown command '/tinyisles'. Try '/help'.
/(unknown): Unknown command '/aifill'. Try '/help'.
chippo: 'rulesetdir augmented2'
Could not load ruleset '/home/chippo/.freeciv/2.6/augmented2/terrain.ruleset': In secfile_hash_insert() [registry_ini.c:236]: secfile '/home/chippo/.freeciv/2.6/augmented2/terrain.ruleset' in section 'extra_hwy': Tried to insert same value twice: extra_hwy.name
AI*14 has been removed from the game.
AI*13 has been removed from the game.
AI*12 has been removed from the game.
AI*11 has been removed from the game.
AI*10 has been removed from the game.
AI*9 has been removed from the game.
AI*8 has been removed from the game.
AI*7 has been removed from the game.
AI*6 has been removed from the game.
AI*1 has been removed from the game.
/rulesetdir: Failed loading rulesets from directory "augmented2", using "classic"

But this all seems to be bugs in augmented2 (and/or it's installation instructions). I don't have any proof that the modpack installer does anything wrong. And besides the core dump, everything else could well be bugs in the modpack, not any Freeciv products.

#9 Updated by Chippo Elder 5 months ago

I managed to get it working - well, I can see that tech-tree that I wanted.

I commented out the tinyisles from augmented2.serv and deleted the second clause of:
[extra_hwy]
name = _("HighWay")
category = "Infra"
causes = "Road"
...
...
from augmented2/terrain.ruleset. There were 2 and they looked the same. Plenty of:
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
but as you said, unrelated.

#10 Updated by Marko Lindqvist 5 months ago

  • Category set to gui-qt
  • Assignee set to Marko Lindqvist
  • Target version set to 2.6.2

Chippo Elder wrote:

And besides the core dump, everything else could well be bugs in the modpack, not any Freeciv products.

I think so too. I think augmented2 bugs are tracked via github issues, if you want to report those problems there.

As for the core dump, I think the root cause is that Qt-client does not properly NULL-terminate gfx file extensions list. So when file is not found with any legal extension, it tries to use whatever memory is after the list as the extension.

#11 Updated by Marko Lindqvist 5 months ago

Marko Lindqvist wrote:

Qt-client does not properly NULL-terminate gfx file extensions list.

Fix for that bug attached. I've not confirmed that it helps with the original problem.

#12 Updated by Chippo Elder 5 months ago

Marko Lindqvist wrote:

Fix for that bug attached. I've not confirmed that it helps with the original problem.

Confirmed. Now it behaves exactly like the gtk client and we see:

2: Loading tileset "augmentedi".
1: Could not load gfx file "augmented2/wonders/geoglyph".
0: Couldn't load gfx file "augmented2/wonders/geoglyph" for sprite 'b.geoglyph'.

which we've confirmed is what we should see with the broken modpack.

You can close the ticket.

But one last question on the issue of rulesets. We agree that we shouldn't be testing augmented2, with urgency, for 2.6.2. But what about default rulesets, that the average user will get when their distribution gives them Freeciv? Like alien, civ1, civ2, civ2civ3 etc. Should they be getting thorough testing for 2.6.2?

#13 Updated by Marko Lindqvist 5 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF