Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2002:
[Freeciv-Dev] CMA attributes - gcc optimization problem with Tru64 Unix
Home

[Freeciv-Dev] CMA attributes - gcc optimization problem with Tru64 Unix

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] CMA attributes - gcc optimization problem with Tru64 Unix
From: Davide Pagnin <nightmare@xxxxxxxxxx>
Date: Thu, 06 Jun 2002 22:49:09 +0200

        Hi All!

Just a week ago, I've noticed that something with the CMA feature were
wrong with the Tru64 Unix system that are deployed here.

With the suggestion of Raimar, I've searched which was the problem.
The weirdest thing is that no warnings nor errors are spitted out
by the compiler, but nontheless the CMA whole thing doesn't work at all.

Obviously the next step was configure the package with --enable-debug,
an this turned out to fix the CMA behaviour.
This were quite disappointing, at first look, and after more than an
hour,
of trial and errors, I was able to find out that the -O2 option which
enables optimization, was responsible for the problem.
The strange behaviour is limited to the compilation of the file:
client/attribute.c
Thus, disabling optimization for only this file, is a fix for the
problem,
in the Tru64 Unix architecture.

Obviously, this is not a real fix, but left me with a manageable
problem,
to recompile only a file, is quite affordable, and when you go
bug-busting,
recompiling is what you need...

I'm here, now, for having suggestion/ideas on how to proceed, If any ...

I've attached to the mail, 3 attachment:

1) A gzipped save game

2) Mine .civclientrc file (for presets...)

2) The output of a civclient, compiled with optimization disabled, with
a 
modified attribute.c code, were every LOG_DEBUG were changed in
LOG_VERBOSE

3) The output of a civclient, compiled with optimization enabled (just
-O),
and the same modified code.

The actions related to the client, performed are:
0) Start the server with the save game provided and connect the client
1) Open the city dialog of the only city in the map
2) Go in the CMA dialog
3) Try to set "crescita max" as the actual preset
4) Push "Control City" to start the CMA control in the city
5) Closing city dialog
6) Quit the client

Any clues of what is not working?

(Guesses are that the different dimension of pointers between alpha and
i386 
architectures, results in some abusable optimization by the compiler,
that behaves
wrongly, without spitting out any warning.)

Stay tuned...
If I'm able to find out more, there will be a second mail!

        Ciao, Davide

Attachment: example.sav.gz
Description: GNU Zip compressed data

[client]
version="1.12.3-devel"
solid_color_behind_units=0
sound_bell_at_new_turn=0
smooth_move_units=1
smooth_move_unit_steps=3
do_combat_animation=1
ai_popup_windows=0
ai_manual_turn_done=1
auto_center_on_unit=1
auto_center_on_combat=0
wakeup_focus=1
draw_diagonal_roads=1
center_when_popup_city=1
concise_city_production=1
auto_turn_done=0
meta_accelerators=1
draw_map_grid=1
draw_city_names=1
draw_city_productions=1
draw_terrain=1
draw_coastline=0
draw_roads_rails=1
draw_irrigation=1
draw_mines=1
draw_fortress_airbase=1
draw_specials=1
draw_pollution=1
draw_cities=1
draw_units=1
draw_focus_unit=0
draw_fog_of_war=1
message_where_00=3  # Città: costruzione non disponibile
message_where_01=3  # Città: conquistata/distrutta
message_where_02=3  # Città: entusiasmo in città
message_where_03=3  # Città: sommosse
message_where_04=3  # Città: carestia
message_where_05=3  # Città: carestia prossima
message_where_06=3  # Città: crescita prevista
message_where_07=3  # Città: potrebbe presto crescere
message_where_08=3  # Città: ha bisogno di un acquedotto
message_where_09=3  # Città: ha bisogno di un acq. (in costruzione)
message_where_10=3  # Città: in pace
message_where_11=3  # Città: colpita con un ordigno nucleare
message_where_12=3  # Città: controllo rilasciato dal GAC
message_where_13=3  # Città: suggerimento di rallentare la crescita
message_where_14=3  # Città: trasferimento
message_where_15=1  # Città: unità costruita
message_where_16=3  # Città: eventi della lista lavori
message_where_17=3  # Città: comparsa di barbari
message_where_18=3  # Civiltà: Guerra civile
message_where_19=3  # Civiltà: Collasso nell'anarchia
message_where_20=3  # Civiltà: primo contatto
message_where_21=3  # Civiltà: scoperta di un nuovo governo
message_where_22=3  # Civiltà: a corto di soldi
message_where_23=3  # Civiltà: inquinamento
message_where_24=3  # Civiltà: rivolta sedata
message_where_25=3  # Civiltà: rivolta iniziata
message_where_26=3  # Civiltà: eventi dell'astronave
message_where_27=3  # Azione diplomatica: tradimento
message_where_28=3  # Azione diplomatica: causato incidente
message_where_29=3  # Azione diplomatica: fuga
message_where_30=3  # Azione diplomatica: ambasciata
message_where_31=3  # Azione diplomatica: fallita
message_where_32=3  # Azione diplomatica: rivolta
message_where_33=3  # Azione diplomatica: avvelenamento
message_where_34=3  # Azione diplomatica: sabotaggio
message_where_35=3  # Azione diplomatica: furto
message_where_36=3  # Azione diplomatica nemica: tradimento
message_where_37=3  # Azione diplomatica nemica: ambasciata
message_where_38=3  # Azione diplomatica nemica: fallita
message_where_39=3  # Azione diplomatica nemica: rivolta
message_where_40=3  # Azione diplomatica nemica: avvelenamento
message_where_41=3  # Azione diplomatica nemica: sabotaggio
message_where_42=3  # Azione diplomatica nemica: furto
message_where_43=3  # Gioco: rapporto per tutti
message_where_44=3  # Gioco: gioco terminato
message_where_45=1  # Gioco: gioco iniziato
message_where_46=7  # Gioco: messaggio dall'operatore del server
message_where_47=1  # Gioco: nazione selezionata
message_where_48=3  # Gioco: giocatore distrutto
message_where_49=3  # Gioco: rapporto
message_where_50=3  # Gioco: segnale sonoro fine turno
message_where_51=1  # Gioco: avanzamento dell'anno
message_where_52=3  # Globale: disastro ecologico mondiale
message_where_53=3  # Globale: esploso missile nucleare
message_where_54=3  # Capanna: truppe barbare escono
message_where_55=3  # Capanna: città fondata
message_where_56=3  # Capanna: auri trovati
message_where_57=3  # Capanna: ucciso dalle truppe barbare
message_where_58=3  # Capanna: truppe mercenarie trovate
message_where_59=3  # Capanna: colono trovato
message_where_60=3  # Capanna: tecnologia trovata
message_where_61=3  # Capanna: truppa risparmiata dai barbari
message_where_62=1  # Struttura: comprata
message_where_63=3  # Struttura: costruita
message_where_64=3  # Struttura: venduta forzatamente
message_where_65=3  # Struttura: selezionata nuova struttura
message_where_66=1  # Struttura: venduta
message_where_67=3  # Tecnologia: imparata dalla Grande Biblioteca
message_where_68=1  # Tecnologia: imparata nuova tecnologia
message_where_69=3  # Trattato: alleanza
message_where_70=3  # Trattato: rotto
message_where_71=3  # Trattato: cessate-il-fuoco
message_where_72=3  # Trattato: pace
message_where_73=3  # Trattato: visione in comune
message_where_74=1  # Unità: attacco fallito
message_where_75=1  # Unità: attacco riuscito
message_where_76=1  # Unità: comprata
message_where_77=3  # Unità: costruita
message_where_78=3  # Unità: difensore distrutto
message_where_79=3  # Unità: difensore sopravvissuto
message_where_80=3  # Unità: produzione aggiornata
message_where_81=3  # Unità: riposizionata
message_where_82=3  # Meraviglia: finita
message_where_83=3  # Meraviglia: diventata obsoleta
message_where_84=3  # Meraviglia: iniziata
message_where_85=3  # Meraviglia: interrotta
message_where_86=3  # Meraviglia: finita il prossimo turno
city_report_size=0
city_report_hstate_verbose=1
city_report_hstate_concise=0
city_report_workers=1
city_report_specialists=0
city_report_resources=1
city_report_output=1
city_report_num_trade=0
city_report_food=1
city_report_pollution=0
city_report_corruption=0
city_report_cma=1
city_report_building=1

[worklists]
worklist={ 
"is_valid","name","wlef0","wlid0","wlef1","wlid1","wlef2","wlid2","wlef3","wlid3","wlef4","wlid4","wlef5","wlid5","wlef6","wlid6","wlef7","wlid7","wlef8","wlid8","wlef9","wlid9","wlef10","wlid10","wlef11","wlid11","wlef12","wlid12","wlef13","wlid13","wlef14","wlid14","wlef15","wlid15"
1,"lista-iniziale",1,2,1,2,1,2,2,15,2,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
}

[cma]
number_of_presets=3  # Se hai aggiunto un preset a mano, aggiorna anche 
"number_of_presets"
preset={ 
"name","minsurp0","factor0","minsurp1","factor1","minsurp2","factor2","minsurp3","factor3","minsurp4","factor4","minsurp5","factor5","reqhappy","factortarget","happyfactor"
"prod settler",0,25,0,10,0,1,-20,1,0,1,0,1,0,0,1
"crescita max",0,25,0,3,0,1,-20,1,0,1,0,1,0,0,1
"scienza max",0,1,0,2,0,1,-20,1,0,1,0,25,0,0,1
}
3: log started
3: USER username is pagnin
3: Booting help texts
3: Data path component (0): .
3: Data path component (1): data
3: HOME is /home/pagnin
3: Data path component (2): /home/pagnin/.freeciv
3: Data path component (3): /usr/local/share/freeciv
3: Reading file "data/helpdata.txt"
3: Booted help texts ok
3: tilespec file is data/trident.tilespec
3: Reading file "data/trident.tilespec"
3: tile sizes 30x30, 3030 unit, 1520 small
3: finished reading data/trident.tilespec
3: Initializing sound using stdsounds.spec...
3: Neither of tags music_start and (null) found
3: color system booted ok.
3: Reading file "data/trident/tiles.spec"
3: Reading file "data/misc/small.spec"
3: Reading file "data/trident/units.spec"
3: Reading file "data/trident/flags.spec"
3: Reading file "data/trident/roads.spec"
3: Reading file "data/misc/space.spec"
3: Reading file "data/misc/treaty.spec"
3: Reading file "data/trident/cities.spec"
3: Reading file "data/trident/explosions.spec"
3: join game accept:Welcome back Kalevipoeg.
3: Server reports new connection 1 pagnin
3: settings file is /home/pagnin/.civclientrc
3: Reading file "/home/pagnin/.civclientrc"
3: Neither of tags e_game_start and (null) found
3: Rebooting help texts
3: Reading file "data/helpdata.txt"
3: Booted help texts ok
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffbcb0)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffbcb0)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffb460)
3:   not found
3: attribute_get(key=100000001, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffb530)
3:   not found
3: attribute_set(key=100000001, id=117, x=-1, y=-1, data_length=36, 
data=11fffb530)
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffb550)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffb4c0)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffb470)
3:   not found
3: attribute_get(key=100000001, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffb560)
3:   found length=36
3: attribute_set(key=100000001, id=117, x=-1, y=-1, data_length=36, 
data=140439a48)
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffaf80)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffaee0)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffae90)
3:   not found
3: attribute_get(key=100000001, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffaf80)
3:   found length=36
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffa8c0)
3:   not found
3: attribute_get(key=100000001, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffa950)
3:   found length=36
3: attribute_set(key=100000000, id=117, x=-1, y=-1, data_length=36, 
data=11fffa950)
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffa8a0)
3:   found length=36
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffa8e0)
3:   found length=36
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffa850)
3:   found length=36
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffa800)
3:   found length=36
3: attribute_set(key=100000001, id=117, x=-1, y=-1, data_length=36, 
data=11fffa8f0)
3: attribute_set(key=100000001, id=117, x=-1, y=-1, data_length=36, 
data=140439a48)
3: serial: [0] key{size=16, offset=0} value{size=40, offset=16}
3: serial: [1] key{size=16, offset=56} value{size=40, offset=72}
3: serialized 2 entries in 152 bytes
3: Neither of tags e_game_quit and (null) found
3: log started
3: USER username is pagnin
3: Booting help texts
3: Data path component (0): .
3: Data path component (1): data
3: HOME is /home/pagnin
3: Data path component (2): /home/pagnin/.freeciv
3: Data path component (3): /usr/local/share/freeciv
3: Reading file "data/helpdata.txt"
3: Booted help texts ok
3: tilespec file is data/trident.tilespec
3: Reading file "data/trident.tilespec"
3: tile sizes 30x30, 3030 unit, 1520 small
3: finished reading data/trident.tilespec
3: Initializing sound using stdsounds.spec...
3: Neither of tags music_start and (null) found
3: color system booted ok.
3: Reading file "data/trident/tiles.spec"
3: Reading file "data/misc/small.spec"
3: Reading file "data/trident/units.spec"
3: Reading file "data/trident/flags.spec"
3: Reading file "data/trident/roads.spec"
3: Reading file "data/misc/space.spec"
3: Reading file "data/misc/treaty.spec"
3: Reading file "data/trident/cities.spec"
3: Reading file "data/trident/explosions.spec"
3: join game accept:Welcome back Kalevipoeg.
3: Server reports new connection 1 pagnin
3: settings file is /home/pagnin/.civclientrc
3: Reading file "/home/pagnin/.civclientrc"
3: Neither of tags e_game_start and (null) found
3: Rebooting help texts
3: Reading file "data/helpdata.txt"
3: Booted help texts ok
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffbcb0)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffbcb0)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffb460)
3:   not found
3: attribute_get(key=100000001, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffb530)
3:   not found
3: attribute_set(key=100000001, id=117, x=-1, y=-1, data_length=36, 
data=11fffb530)
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffb550)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffb4c0)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffb470)
3:   not found
3: attribute_get(key=100000001, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffb560)
3:   not found
3: attribute_set(key=100000001, id=117, x=-1, y=-1, data_length=36, 
data=11fffb560)
3: attribute_set(key=100000001, id=117, x=-1, y=-1, data_length=36, 
data=140444088)
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffaf80)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffaee0)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffae90)
3:   not found
3: attribute_get(key=100000001, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffaf80)
3:   not found
3: attribute_set(key=100000001, id=117, x=-1, y=-1, data_length=36, 
data=11fffaf80)
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffa8c0)
3:   not found
3: attribute_get(key=100000001, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffa950)
3:   not found
3: attribute_set(key=100000001, id=117, x=-1, y=-1, data_length=36, 
data=11fffa950)
3: attribute_set(key=100000000, id=117, x=-1, y=-1, data_length=36, 
data=11fffa950)
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffa8a0)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffa8e0)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffa850)
3:   not found
3: attribute_get(key=100000000, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffa800)
3:   not found
3: attribute_get(key=100000001, id=117, x=-1, y=-1, max_data_length=36, 
data=11fffa8f0)
3:   not found
3: attribute_set(key=100000001, id=117, x=-1, y=-1, data_length=36, 
data=11fffa8f0)
3: serial: [0] key{size=16, offset=0} value{size=40, offset=16}
3: serial: [1] key{size=16, offset=56} value{size=40, offset=72}
3: serialized 2 entries in 152 bytes
3: Neither of tags e_game_quit and (null) found

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