URL:
  <http://gna.org/bugs/?18461>

                 Summary: crash using lua function civil_war (in
ai_plr_data_get() [aidata.c::310]: assertion 'ai->phase_initialized' failed.)
                 Project: Freeciv
            Submitted by: syntron
            Submitted on: So 07 Aug 2011 00:34:57 CEST
                Category: ai
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: 2.3.99 (svn20069)
         Discussion Lock: Any
        Operating System: None
         Planned Release: 2.4.0

    _______________________________________________________

Details:

I'm working on a lua test game. Trying to add the lua function civil_war() I
got the following core dump:


#0  0x00007f1ce6e6418b in raise () from /lib64/libpthread.so.0
No symbol table info available.
#1  0x00000000005b31bf in fc_assert_fail (file=0x61a9c0 "aidata.c",
function=0x61ab00 "ai_plr_data_get", line=310, assertion=<value optimized
out>, message=0x0) at log.c:491
        level = LOG_FATAL
#2  0x00000000004bb9ae in ai_plr_data_get (pplayer=0x12c3410) at
aidata.c:310
        ai = 0x1284db0
        __FUNCTION__ = "ai_plr_data_get"
#3  0x00000000004f0f8b in ai_goldequiv_clause (pplayer=0x12c3410,
aplayer=0x1105a50, pclause=0x110ff30, verbose=<value optimized out>,
ds_after=DS_CEASEFIRE) at advdiplomacy.c:289
        ai = <value optimized out>
        worth = <value optimized out>
        give = <value optimized out>
        giver = <value optimized out>
        penemy = 0x6
        adip = <value optimized out>
        is_dangerous = <value optimized out>
        __FUNCTION__ = "ai_goldequiv_clause"
#4  0x00000000004f23e1 in dai_treaty_evaluate (pplayer=0x12c3410,
aplayer=0x1105a50, ptreaty=0x110feb0) at advdiplomacy.c:591
        pclause_iter = 0x0
        pclause = 0x110ff30
        total_balance = <value optimized out>
        only_gifts = <value optimized out>
        ds_after = DS_CEASEFIRE
        given_cities = 0
        __FUNCTION__ = "dai_treaty_evaluate"
#5  0x000000000046999e in call_first_contact (pplayer1=0x1105a50,
pplayer2=0x12c3410, ptile=0xc036e0) at plrhand.c:1069
        _plr_ = 0x1105a50
#6  make_contact (pplayer1=0x1105a50, pplayer2=0x12c3410, ptile=0xc036e0) at
plrhand.c:1583
        new_state = DS_TEAM
        ds_plr1plr2 = <value optimized out>
        ds_plr2plr1 = <value optimized out>
        __FUNCTION__ = "make_contact"
#7  0x0000000000469d23 in maybe_make_contact (ptile=<value optimized out>,
pplayer=0x1105a50) at plrhand.c:1611
        punit = <value optimized out>
        punit_numbers = 0x7fff00000001
        punit_index = <value optimized out>
        punit_size = -865855520
        pcity = <value optimized out>
        _dummy_x = <value optimized out>
        tile1_dummy_x = 2
        tile1 = <value optimized out>
        dummy_y = <value optimized out>
        tile1dummy_y = 7
        tile1_start = <value optimized out>
        tile1_index = <value optimized out>
        __FUNCTION__ = "maybe_make_contact"
#8  0x000000000044d102 in transfer_city (ptaker=0x1105a50, pcity=0x153ec80,
kill_outside=-1, transfer_unit_verbose=false, resolve_stack=false, raze=false)
at citytools.c:1038
        old_city_name =
"Tholentinum\000\000\000\000\000\222.`\000\000\000\000\000\314\035[\000\000\000\000\000\003\000\000\000\000\000\000\000`['\001\000\000\000"
        had_small_wonders = {vec = '\000' <repeats 24 times>}
        old_vision = 0x152cf60
        new_vision = <value optimized out>
        pgiver = 0x12c3410
        pcenter = 0xc036e0
        saved_id = 22277264
        city_remains = true
        had_great_wonders = false
        old_taker_content_citizens = 4 '\004'
        old_giver_content_citizens = 4 '\004'
        __FUNCTION__ = "transfer_city"
#9  0x000000000046bcee in civil_war (pplayer=0x12c3410) at plrhand.c:2137
        pcity_iter = 0x1275b60
        pcity = 0x153ec80
        i = 2
        j = <value optimized out>
        cplayer = 0x1105a50
        __FUNCTION__ = "civil_war"
#10 0x00000000004411db in tolua_game_civil_war00 (tolua_S=0x12f08b0) at
tolua_game_gen.c:2499
        tolua_ret = <value optimized out>
---Type <return> to continue, or q <return> to quit---
        pplayer = 0x12c3410
        tolua_err = {index = 19518544, array = 0, type = 0x129d440 ""}
#11 0x00000000005d391d in luaD_precall (L=0x12f08b0, func=0x129d370,
nresults=0) at ldo.c:319
        ci = <value optimized out>
        n = <value optimized out>
        cl = <value optimized out>
        funcr = <value optimized out>
#12 0x00000000005e0481 in luaV_execute (L=<value optimized out>,
nexeccalls=1) at lvm.c:590
        b = <value optimized out>
        nresults = 0
        i = <value optimized out>
        ra = 0x129d370
        cl = 0x12941a0
        base = 0x129d2e0
        k = 0x1291180
        pc = 0x1294bc4
#13 0x00000000005d3ded in luaD_call (L=0x12f08b0, func=0x129d2d0,
nResults=<value optimized out>) at ldo.c:377
No locals.
#14 0x00000000005d3077 in luaD_rawrunprotected (L=0x12f08b0, f=0x5cc820
<f_call>, ud=0x7fffcc641cf0) at ldo.c:116
        lj = {previous = 0x0, b = {{__jmpbuf = {19859632,
-2915504358561775484, 1, 0, 48, 19886384, 2915400108041470084,
-2915504056315641724}, __mask_was_saved = 0, 
              __saved_mask = {__val = {18446744073709551615 <repeats 11
times>, 11065456, 19859632, 6149175, 19859976, 19859632}}}}, status = 0}
#15 0x00000000005d3fa2 in luaD_pcall (L=0x12f08b0, func=<value optimized
out>, u=<value optimized out>, old_top=48, ef=<value optimized out>) at
ldo.c:463
        status = <value optimized out>
        oldnCcalls = 0
        old_ci = 0
        old_allowhooks = 1 '\001'
        old_errfunc = 0
#16 0x00000000005cdb0f in lua_pcall (L=0x12f08b0, nargs=2, nresults=1,
errfunc=<value optimized out>) at lapi.c:821
        c = {func = 0x129d2d0, nresults = 1}
        status = <value optimized out>
        func = <value optimized out>
#17 0x00000000004cd901 in luascript_call (L=0x12f08b0, narg=2, nret=1,
code=0x0) at luascript.c:327
        status = <value optimized out>
        base = <value optimized out>
        traceback = 2
        __FUNCTION__ = "luascript_call"
#18 0x000000000043f06b in script_callback_invoke (callback_name=<value
optimized out>, nargs=2, parg_types=0x12d1320, args=0x7fffcc641db0) at
script_game.c:127
        stop_emission = false
        __FUNCTION__ = "script_callback_invoke"
#19 0x000000000043f508 in script_signal_emit (signal_name=<value optimized
out>, nargs=<value optimized out>) at script_signal.c:211
        pcallback_iter = 0x0
        pcallback = 0xbbb8e0
        psignal = 0x12d11c0
        args = {{gp_offset = 48, fp_offset = 48, overflow_arg_area =
0x7fffcc641eb0, reg_save_area = 0x7fffcc641dd0}}
        __FUNCTION__ = "script_signal_emit"
#20 0x0000000000411100 in begin_turn () at srv_main.c:849
No locals.
#21 srv_running () at srv_main.c:2173
        save_counter = 50
        i = <value optimized out>
        is_new_turn = true
        eot_timer = 0x1281560
        need_send_pending_events = false
#22 srv_main () at srv_main.c:2678
        __FUNCTION__ = "srv_main"
#23 0x0000000000407a42 in main (argc=<value optimized out>,
argv=0x7fffcc642148) at civserver.c:392
        inx = 4
        showhelp = <value optimized out>
        showvers = <value optimized out>
        option = <value optimized out>
        __FUNCTION__ = "main"


The attached savegame can be used to reproduce it. Simply start freeciv as
'./ser -F -f luatest.sav' and enter start ...



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: So 07 Aug 2011 00:34:57 CEST  Name: luatest.sav  Size: 38kB   By:
syntron

<http://gna.org/bugs/download.php?file_id=13763>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?18461>

_______________________________________________
  Nachricht geschickt von/durch Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to