bugFreeciv - Bugs: bug #21616, Alternative phases + diplomacy

 
 
Show feedback again

bug #21616: Alternative phases + diplomacy

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Fri 07 Feb 2014 09:51:15 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: Duplicate
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Release: S2_4Operating System: None
Planned Release: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 18 Feb 2014 01:42:52 AM UTC, comment #3:

This is no longer crashing with patch #4515.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon 10 Feb 2014 09:02:09 PM UTC, comment #2:

I think I've now found out the core problem.

As treaty is proposed to ai player whose phase it isn't, adv_data_get() returns the data pointer (in this particular case the data was also recalculated with adv_data_phase_init() + adv_data_phase_done(), but I think it's not necessary for bug to occur). Unfortunately all the data isn't there as static members once phase is closed, but is stored via pointers for which the memory is free()d. Also other data seems to get invalidated in adv_data_phase_done().
I think adv_data_phase_done() has changed relatively recently in this respect.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sat 08 Feb 2014 01:39:06 AM UTC, comment #1:

So far it seems that phasemode=Team is important - when one AI proposes ceasefire, it's not the receiving AI's phase. As there's new continents visible, dai_data_phase_begin() - dai_data_phase_finished() gets called in that order and similar thing happens within dai_data_phase_init() for adv_data_phase_init() - adv_data_phase_done()

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 07 Feb 2014 09:51:15 PM UTC, original submission:

Savegame (compresstype xz in case that's the problem) provided by stelonix in irc crashes the server at turn change.

Running on gdb it hangs with message:

      • Error in `server/freeciv-server': corrupted double-linked list: 0x0000000002dd6e40 ***

ctrl^C and then backtrace:

#0 __lll_lock_wait_private ()
at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1 0x00007ffff60d28ec in _L_lock_10267 () at malloc.c:5125
#2 0x00007ffff60d0075 in __GI___libc_malloc (bytes=36) at malloc.c:2856
#3 0x00007ffff7de0232 in local_strdup (
s=0x7ffff7fab1f2 "/lib/x86_64-linux-gnu/libgcc_s.so.1") at dl-load.c:162
#4 0x00007ffff7de34d2 in _dl_map_object (
loader=loader@entry=0x7ffff7fcb9c8,
name=name@entry=0x7ffff61b9c46 "libgcc_s.so.1", type=type@entry=2,
trace_mode=trace_mode@entry=0, mode=mode@entry=-1879048191,
nsid=<optimized out>) at dl-load.c:2510
#5 0x00007ffff7ded8bc in dl_open_worker (a=a@entry=0x7fffffffca58)
at dl-open.c:239
#6 0x00007ffff7de9806 in _dl_catch_error (
objname=objname@entry=0x7fffffffca48,
errstring=errstring@entry=0x7fffffffca50,
mallocedp=mallocedp@entry=0x7fffffffca47,
operate=operate@entry=0x7ffff7ded790 <dl_open_worker>,
args=args@entry=0x7fffffffca58) at dl-error.c:177
#7 0x00007ffff7ded339 in _dl_open (file=0x7ffff61b9c46 "libgcc_s.so.1",
mode=-2147483647, caller_dlopen=<optimized out>, nsid=-2, argc=3,
argv=0x7fffffffe298, env=0x7fffffffe2b8) at dl-open.c:667
#8 0x00007ffff6171722 in do_dlopen (ptr=ptr@entry=0x7fffffffcc70)
at dl-libc.c:87
#9 0x00007ffff7de9806 in _dl_catch_error (objname=0x7fffffffcc50,
errstring=0x7fffffffcc58, mallocedp=0x7fffffffcc4f,
operate=0x7ffff61716e0 <do_dlopen>, args=0x7fffffffcc70)
at dl-error.c:177
#10 0x00007ffff61717bf in dlerror_run (
operate=operate@entry=0x7ffff61716e0 <do_dlopen>,
args=args@entry=0x7fffffffcc70) at dl-libc.c:46
#11 0x00007ffff6171831 in __GI___libc_dlopen_mode (
name=name@entry=0x7ffff61b9c46 "libgcc_s.so.1",
mode=mode@entry=-2147483647) at dl-libc.c:163
#12 0x00007ffff614f5b5 in init () at ../sysdeps/x86_64/backtrace.c:52
#13 0x00007ffff640ada0 in pthread_once ()
at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S:103
#14 0x00007ffff614f6d4 in __GI___backtrace (
array=array@entry=0x7fffffffcf30, size=size@entry=64)
at ../sysdeps/x86_64/backtrace.c:103
#15 0x00007ffff60c27d5 in __libc_message (do_abort=do_abort@entry=2,
fmt=fmt@entry=0x7ffff61bf368 "*** Error in `%s': %s: 0x%s ***\n")
at ../sysdeps/unix/sysv/linux/libc_fatal.c:178
#16 0x00007ffff60cca16 in malloc_printerr (action=3,
str=0x7ffff61bb2d0 "corrupted double-linked list", ptr=<optimized out>)
at malloc.c:4923
#17 0x00007ffff60ccc53 in malloc_consolidate (
av=av@entry=0x7ffff63f8640 <main_arena>) at malloc.c:4102
#18 0x00007ffff60cdd77 in _int_malloc (av=0x7ffff63f8640 <main_arena>,
bytes=1584) at malloc.c:3379
#19 0x00007ffff60d0083 in __GI___libc_malloc (bytes=1584) at malloc.c:2859
#20 0x00000000005e167d in fc_real_malloc (size=1584,
called_as=0x625efd "malloc", line=475,
file=0x6266e8 "server/notify.c")
at utility/mem.c:84
#21 0x000000000042fe1d in event_cache_data_new (packet=0x7fffffffd860,
turn=147, timestamp=1391809458, server_status=S_S_RUNNING,
target_type=ECT_PLAYERS, players=0x7fffffffc670, players@entry=0x0)
at server/notify.c:475
#22 0x0000000000430489 in event_cache_add_for_player (
packet=packet@entry=0x7fffffffd860, pplayer=pplayer@entry=0x2d9e2e0)
at server/notify.c:588
#23 0x00000000004ed2ef in notify (pplayer=pplayer@entry=0x2d9e2e0,
text=<optimized out>)
at ai/default/advdiplomacy.c:109
#24 0x00000000004ee9c4 in dai_treaty_evaluate (pplayer=0x2d7e520,
aplayer=0x2d9e2e0, ptreaty=0x1322aa0)
at ../../../../src.patched/ai/default/advdiplomacy.c:630
#25 0x00000000004f1202 in dai_diplomacy_actions (pplayer=0x2d9e2e0)
at ai/default/advdiplomacy.c:1691
#26 0x000000000043231f in begin_phase (is_new_phase=is_new_phase@entry=true)
at server/srv_main.c:933
#27 0x000000000043622c in srv_running ()
at server/srv_main.c:2254
#28 srv_main () at server/srv_main.c:2770
#29 0x000000000042e8ee in main (argc=3, argv=0x7fffffffe298)
at server/civserver.c:453

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 22 Feb 2014 03:29:41 AM UTCcazfiStatusNone=>Duplicate
      Assigned toNone=>cazfi
      Open/ClosedOpen=>Closed
    Mon 10 Feb 2014 09:02:09 PM UTCcazfiSummaryEvent cache memory corruption=>Alternative phases + diplomacy
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup