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

                 Summary: crash in remove_trade_route() - fc_assert_action()?
                 Project: Freeciv
            Submitted by: syntron
            Submitted on: Samstag 27.02.2010 um 13:54
                Category: general
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: 2.2.0
         Discussion Lock: Any
        Operating System: None
         Planned Release: 

    _______________________________________________________

Details:

using trunk (svn 16958) I get the following error:


1: in remove_trade_route() [citytools.c::1995]: assertion 'pc1 && pc2'
failed.


As 'pother_city' is NULL in the backtrace, it seems to be that the 'action'
('continue' here) is not executed in fc_assert_action(). 


  for (o = 0; o < NUM_TRADE_ROUTES; o++) {
    struct city *pother_city = game_find_city_by_number(pcity->trade[o]);
    fc_assert_action(pcity->trade[o] == 0 || pother_city != NULL, continue);
    remove_trade_route(pother_city, pcity);
  }


The backtrace is


#2  0x00007faa7ac28329 in __assert_fail () from /lib64/libc.so.6
No symbol table info available.
#3  0x000000000054a61e in fc_assert_fail (file=<value optimized out>,
function=<value optimized out>,
    line=<value optimized out>, assertion=<value optimized out>,
message=<value optimized out>) at log.c:436
        __PRETTY_FUNCTION__ = "fc_assert_fail"
#4  0x000000000044e5eb in remove_city (pcity=0xce7280) at citytools.c:1285
        pother_city = (struct city *) 0x0
        powner = (struct player *) 0x93c018
        pcenter = (struct tile *) 0xfae890
        had_small_wonders = {vec = '\0' <repeats 24 times>}
        old_vision = <value optimized out>
        id = 378
        had_great_wonders = false
        __FUNCTION__ = "remove_city"
#5  0x0000000000453780 in do_city_migration (pcity_from=0xce7280,
pcity_to=0xc69b90) at cityturn.c:2416
        pplayer_from = (struct player *) 0x93c018
        pplayer_to = (struct player *) 0x93c018
        ptile_from = (struct tile *) 0xfae890
        ptile_to = (struct tile *) 0xfb00f0
        name_from = "[l tgt=\"tile\" x=11
y=17]Alexandroupolis[/l]\000/]\000\000(\\\217\002\000\000\000\000$\n\000\000\000\000\000\000,RZ\000\000\000\000\000�_U\000\000\000\000\000n��w|�\...@\000\000\000\000\000\000\000\000l\000\000\000\000\000\000\000\004\000\000\000\001\000\000\000\001\000\000\000\000\000\000\000�(\...@�(\237@"
        name_to = "[l tgt=\"city\" id=272 name=\"Kavala\"
/]\000\000\000\220\233�", '\0' <repeats 13 times>,
"\220\233�\000\000\000\000\000\030�\223", '\0' <repeats 13 times>,
"\220\233�\000\000\000\000\0004\000\000\000\000\000\000\000\220\233�\000\000\000\000\000Z",
'\0' <repeats 15 times>, "\001\000\000\000\000\000\000"
        nation_from = 0xf70068 "Hellenic"
        nation_to = 0xf70068 "Hellenic"
        rcity = <value optimized out>
        __FUNCTION__ = "do_city_migration"


Number 5 (do_city_migration()) can be different. I also got unit_enter_city()
and other functions calling remove_city() at this point.

I added a small condition after fc_assert_action() and it was executed every
time before the assertion error message was displayed


    if (pcity->trade[o] == 0 || pother_city != NULL) {
      log_error("should never happen");
    }


Related question: I added an assert() call to fc_assert_fail() to get the
core dump. How can / should I debug this without adding assert() again?






    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  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