Ticket #41926

Thread 1 "freeciv-gtk3.22" received signal SIGSEGV, Segmentation fault.

Open Date: 2021-04-06 17:27 Last Update: 2021-04-11 02:56

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
9 - Highest
Resolution:
Fixed
File:
5

Details

The game crashed while i was playing.

The server managed to do an auto-quit-save , and i got 100% reproducible crash with it:

I compiled 3.0.beta1 with debug and profile, ( then sudo make install on a clean machine with all previous freeciv removed )

alain@servolant:/Big/Games/freeciv-git$ git log
commit 4acdab95bc027a780d3d0b0a86523d502eaddf7d (HEAD -> S3_0, origin/S3_0)
Author: Marko Lindqvist <cazfi74@gmail.com>
Date:   Sun Mar 21 08:58:40 2021 +0200

Running in gdb : Server :

$ gdb --args /usr/local/bin/freeciv-server -d v -l server.3b1.log -f ~/.freeciv/saves/freeciv3-T0216-Y01575-quitidle.sav.xz 
(gdb) r

then wait a little until everything is ready

Client gtk3.22 :

$ gdb --args /usr/local/bin/freeciv-gtk3.22 -d v -l client.3beta1.log
(gdb) r

Then in the GUI connect to localhost,
then start
then SEGFAULT (100% reproducible on my machine)

Thread 1 "freeciv-gtk3.22" received signal SIGSEGV, Segmentation fault.
0x000000000067c026 in cities_trade_route_type (pcity1=pcity1@entry=0xa0966b0, pcity2=pcity2@entry=0xa091930) at traderoutes.c:67
67	    if (city_tile(pcity1)->continent != city_tile(pcity2)->continent) {
(gdb) bt
#0  0x000000000067c026 in cities_trade_route_type (pcity1=pcity1@entry=0xa0966b0, pcity2=pcity2@entry=0xa091930) at traderoutes.c:67
#1  0x000000000067c440 in can_cities_trade (pc1=pc1@entry=0xa0966b0, pc2=pc2@entry=0xa091930) at traderoutes.c:218
#2  0x000000000057e767 in set_city_production (pcity=0xa0966b0) at city.c:2829
#3  city_refresh_from_main_map (pcity=pcity@entry=0xa0966b0, workers_map=workers_map@entry=0x0) at city.c:3024
#4  0x00000000006a7252 in cm_query_result (pcity=pcity@entry=0xa0966b0, param=param@entry=0x7fffffffd890, result=result@entry=0x20bb9a0, negative_ok=negative_ok@entry=false) at cm.c:2010
#5  0x0000000000521707 in handle_city (pcity=0xa0966b0) at cma_core.c:383
#6  city_changed (city_id=<optimized out>) at cma_core.c:443
#7  0x000000000051e882 in execute_call (call=0xa13de80) at agents.c:221
#8  call_handle_methods () at agents.c:257
#9  0x000000000045dc9d in input_from_server (fd=<optimized out>) at clinet.c:427
#10 0x0000000000450f1a in get_net_input (source=<optimized out>, condition=<optimized out>, data=<optimized out>) at gui_main.c:2142
#11 0x00007ffff6c8504e in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff6c85400 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007ffff6c856f3 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#14 0x00007ffff749e37d in gtk_main () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#15 0x000000000045397e in ui_main (argc=<optimized out>, argc@entry=1, argv=<optimized out>, argv@entry=0x7fffffffdfa8) at gui_main.c:1918
#16 0x0000000000456513 in client_main (argc=1, argv=0x7fffffffdfa8) at client_main.c:685
#17 0x00007ffff6a430b3 in __libc_start_main (main=
    0x450510 <main>, argc=5, argv=0x7fffffffdfa8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdf98) at ../csu/libc-start.c:308
#18 0x000000000045055e in _start () at gui_main.c:1669
(gdb) 

Ticket History (3/13 Histories)

2021-04-06 17:27 Updated by: alain_bkr
  • New Ticket "Thread 1 "freeciv-gtk3.22" received signal SIGSEGV, Segmentation fault." created
2021-04-06 19:34 Updated by: cazfi
Comment

With the latter save I get:

1: in player_slot_index() [../../../src/common/player.c::419]: assertion '((void *)0) != pslot' failed.

with backtrace shown similar to yours.

2021-04-06 21:58 Updated by: cazfi
Comment

CM already runs when one end of a traderoute is received, without the client having proper information about the other end. That shouldn't cause problems in itself, but this time client *thinks* it already knows the other end - it has created a dummy placeholder city for a tile info with 'worked' set to that city.

2021-04-06 22:04 Updated by: cazfi
  • Resolution Update from None to Accepted
  • Milestone Update from (None) to 3.0.0-beta2 (closed)
  • Component Update from (None) to General
2021-04-08 17:54 Updated by: cazfi
  • Status Update from Open to Closed
  • Owner Update from (None) to cazfi
  • Resolution Update from Accepted to Fixed
2021-04-08 18:06 Updated by: cazfi
Comment

I rechecked S2_6. While the trade code has changed a lot between S2_6 and S3_0, I think S2_6 is affected in principle to the case where there is partially known trade partner city.

Current status of this ticket: Pushed to all later branches, but there's not even patch for S2_6 yet.

2021-04-08 20:20 Updated by: cazfi
  • Resolution Update from None to Accepted
2021-04-11 02:56 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Attachment File List

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login