Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2002:
[Freeciv-Dev] GTK client crash (assertion failed: too much luxury) (PR#1
Home

[Freeciv-Dev] GTK client crash (assertion failed: too much luxury) (PR#1

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] GTK client crash (assertion failed: too much luxury) (PR#1409)
From: awilkins@xxxxxxxxxxxx
Date: Thu, 25 Apr 2002 19:54:12 -0700 (PDT)

Full_Name: Alexander Wilkins
Version: April 23 CVS
Distribution: Built from source
Client: Gtk+
OS: Redhat Linux 7.2 (kernel 2.4.9-31)
Submission from: (NULL) (128.12.194.114)


When attempting to open a city dialog with a rather large city, the client
crashes.  gdb stack backtraces (obtained after compiling FreeCiv with the -g
flag) are appended.  These indicate that the city has too much luxury, and this
violated an assertion in cma_core.c.  Redefining MAX_LUXURY to be 500 (from 150)
fixed the problem, but may have introduced problems elsewhere.  As a side note,
I believe the theoretical maximum for luxury in a city is 

{[(max base trade for terrain) + (democracy bonus) + (river)] * (super highways)
* (number of squares) + [(max size of city) - (number of squares)] *
(entertainer bonus)} * (effects of marketplace + bank + stock exchange)

{[4 + 1 + 1] * (3 / 2) * 21 + [63 - 21] * 2} * (5 / 2) = 682.5

The highest I could get any city to in my current civ is 382, although most of
the fully developed cities I have had luxury amounts in the 200 - 300 range
(size in the low 40s, fully railroaded, with super highways and stock
exchange).

Backtrace after attempting to open a city dialog by clicking on a city in the
main window:

#0  0x40370ae1 in __kill () from /lib/i686/libc.so.6
#1  0x403708ba in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x40372062 in abort () at ../sysdeps/generic/abort.c:88
#3  0x4036a200 in __assert_fail () at assert.c:74
#4  0x080c098d in update_cache2 (pcity=0x83d92d8, result=0xbfffd820)
    at cma_core.c:668
#5  0x080c0db8 in real_fill_out_result (pcity=0x83d92d8, result=0xbfffd820)
    at cma_core.c:794
#6  0x080c133c in fill_out_result (pcity=0x83d92d8, result=0xbfffd820, 
    base_combination=0x8167aa4, scientists=0, taxmen=0) at cma_core.c:1125
#7  0x080c1b56 in optimize_final (pcity=0x83d92d8, parameter=0xbfffd8d0, 
    best_result=0xbfffd900) at cma_core.c:1496
#8  0x080c1f70 in cma_query_result (pcity=0x83d92d8, parameter=0xbfffd8d0, 
    result=0xbfffd900) at cma_core.c:1732
#9  0x0807f9fc in refresh_cma_dialog (pcity=0x83d92d8, refresh=REFRESH_ALL)
    at cma_fe.c:335
#10 0x08073e5d in refresh_city_dialog (pcity=0x83d92d8) at citydlg.c:413
#11 0x080770ac in create_city_dialog (pcity=0x83d92d8, make_modal=0)
    at citydlg.c:1580
#12 0x08073f7c in popup_city_dialog (pcity=0x83d92d8, make_modal=0)
    at citydlg.c:458
#13 0x08064f44 in do_map_click (xtile=190, ytile=25) at control.c:1130
#14 0x08090da4 in butt_down_mapcanvas (w=0x82e7f90, ev=0x830a5b8)
    at mapctrl.c:294
#15 0x400e4aec in gtk_marshal_BOOL__POINTER () from /usr/lib/libgtk-1.2.so.0
#16 0x40118436 in gtk_handlers_run () from /usr/lib/libgtk-1.2.so.0
#17 0x4011776d in gtk_signal_real_emit () from /usr/lib/libgtk-1.2.so.0
#18 0x40115525 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0
#19 0x4014fb89 in gtk_widget_event () from /usr/lib/libgtk-1.2.so.0
#20 0x400e4a45 in gtk_propagate_event () from /usr/lib/libgtk-1.2.so.0
#21 0x400e3a6f in gtk_main_do_event () from /usr/lib/libgtk-1.2.so.0
#22 0x40194d7f in gdk_event_dispatch () from /usr/lib/libgdk-1.2.so.0
#23 0x401c7773 in g_main_dispatch () from /usr/lib/libglib-1.2.so.0
#24 0x401c7d39 in g_main_iterate () from /usr/lib/libglib-1.2.so.0
#25 0x401c7eec in g_main_run () from /usr/lib/libglib-1.2.so.0
#26 0x400e3333 in gtk_main () from /usr/lib/libgtk-1.2.so.0
#27 0x0808b9a5 in ui_main (argc=1, argv=0xbfffe054) at gui_main.c:865
#28 0x080601f1 in main (argc=1, argv=0xbfffe054) at civclient.c:207
#29 0x4035e627 in __libc_start_main (main=0x805fcb4 <main>, argc=1, 
    ubp_av=0xbfffe054, init=0x805cc84 <_init>, fini=0x80c2990 <_fini>, 
    rtld_fini=0x4000dcc4 <_dl_fini>, stack_end=0xbfffe04c)
    at ../sysdeps/generic/libc-start.c:129

Backtrace obtained after using the city report to attempt to bring up a city
dialog:

#0  0x40370ae1 in __kill () from /lib/i686/libc.so.6
#1  0x403708ba in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x40372062 in abort () at ../sysdeps/generic/abort.c:88
#3  0x4036a200 in __assert_fail () at assert.c:74
#4  0x080c098d in update_cache2 (pcity=0x8532760, result=0xbfffd130)
    at cma_core.c:668
#5  0x080c0db8 in real_fill_out_result (pcity=0x8532760, result=0xbfffd130)
    at cma_core.c:794
#6  0x080c133c in fill_out_result (pcity=0x8532760, result=0xbfffd130, 
    base_combination=0x8167aa4, scientists=0, taxmen=0) at cma_core.c:1125
#7  0x080c1b56 in optimize_final (pcity=0x8532760, parameter=0xbfffd1e0, 
    best_result=0xbfffd210) at cma_core.c:1496
#8  0x080c1f70 in cma_query_result (pcity=0x8532760, parameter=0xbfffd1e0, 
    result=0xbfffd210) at cma_core.c:1732
#9  0x0807f9fc in refresh_cma_dialog (pcity=0x8532760, refresh=REFRESH_ALL)
    at cma_fe.c:335
#10 0x08073e5d in refresh_city_dialog (pcity=0x8532760) at citydlg.c:413
#11 0x080770ac in create_city_dialog (pcity=0x8532760, make_modal=0)
    at citydlg.c:1580
#12 0x08073f7c in popup_city_dialog (pcity=0x8532760, make_modal=0)
    at citydlg.c:458
#13 0x0807e4c0 in city_popup_callback (w=0x8270700, data=0x0) at cityrep.c:1188
#14 0x400e4dc0 in gtk_marshal_NONE__INT_INT_POINTER ()
   from /usr/lib/libgtk-1.2.so.0
#15 0x40118436 in gtk_handlers_run () from /usr/lib/libgtk-1.2.so.0
#16 0x4011776d in gtk_signal_real_emit () from /usr/lib/libgtk-1.2.so.0
#17 0x40115525 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0
#18 0x40090eb0 in gtk_clist_button_press () from /usr/lib/libgtk-1.2.so.0
#19 0x400e4aec in gtk_marshal_BOOL__POINTER () from /usr/lib/libgtk-1.2.so.0
#20 0x401177ad in gtk_signal_real_emit () from /usr/lib/libgtk-1.2.so.0
#21 0x40115525 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0
#22 0x4014fb89 in gtk_widget_event () from /usr/lib/libgtk-1.2.so.0
#23 0x400e4a45 in gtk_propagate_event () from /usr/lib/libgtk-1.2.so.0
#24 0x400e3a6f in gtk_main_do_event () from /usr/lib/libgtk-1.2.so.0
#25 0x40194d7f in gdk_event_dispatch () from /usr/lib/libgdk-1.2.so.0
#26 0x401c7773 in g_main_dispatch () from /usr/lib/libglib-1.2.so.0
#27 0x401c7d39 in g_main_iterate () from /usr/lib/libglib-1.2.so.0
#28 0x401c7eec in g_main_run () from /usr/lib/libglib-1.2.so.0
#29 0x400e3333 in gtk_main () from /usr/lib/libgtk-1.2.so.0
#30 0x0808b9a5 in ui_main (argc=1, argv=0xbfffdcd4) at gui_main.c:865
#31 0x080601f1 in main (argc=1, argv=0xbfffdcd4) at civclient.c:207
#32 0x4035e627 in __libc_start_main (main=0x805fcb4 <main>, argc=1, 
    ubp_av=0xbfffdcd4, init=0x805cc84 <_init>, fini=0x80c2990 <_fini>, 
    rtld_fini=0x4000dcc4 <_dl_fini>, stack_end=0xbfffdccc)
    at ../sysdeps/generic/libc-start.c:129




[Prev in Thread] Current Thread [Next in Thread]