[Freeciv-Dev] [bug #20517] Invalid read of size 4 in ruleset reloading cycle

2013-02-20 Thread pepeto
Update of bug #20517 (project freeciv):

  Status:  Ready For Test => Fixed  
 Open/Closed:Open => Closed 
Operating System:None => Any


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #20517] Invalid read of size 4 in ruleset reloading cycle

2013-02-18 Thread pepeto
Follow-up Comment #4, bug #20517 (project freeciv):

I have no idea why patches for S2_3 and S2_4 have been truncated.

Also, notice that it solves the failed assertions of bug #20520.


(file #17251, file #17252)
___

Additional Item Attachment:

File name: S2_4_ruleset_reload.diff   Size:7 KB
File name: S2_3_ruleset_reload.diff   Size:7 KB


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #20517] Invalid read of size 4 in ruleset reloading cycle

2013-02-18 Thread pepeto
Update of bug #20517 (project freeciv):

  Status:   Need Info => Ready For Test 
 Assigned to:None => pepeto 
 Planned Release: => 2.3.5, 2.4.0, 2.5.0

___

Follow-up Comment #3:

The attached patch:
* clear players' nation, governments and city_style in game_ruleset_free() ;
* clear game.government_during_revolution pointer in game_ruleset_free() (this
one should solve the problem) ;
* remove other similar hacks from the client and server code ;
* discards PACKET_PLAYER_INFO in the middle of ruleset or game (re)loading
cycle.


(file #17248, file #17249, file #17250)
___

Additional Item Attachment:

File name: trunk_ruleset_reload.diff  Size:7 KB
File name: S2_4_ruleset_reload.diff   Size:2 KB
File name: S2_3_ruleset_reload.diff   Size:2 KB


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #20517] Invalid read of size 4 in ruleset reloading cycle

2013-02-18 Thread pepeto
Update of bug #20517 (project freeciv):

  Status:  Ready For Test => Need Info  

___

Follow-up Comment #2:

When applying this patch, we may be confronted for the same problem as bug
#20520 if both rulesets don't have the same number of government types.
However, it isn't as much problematic because players can have the same
government type...

Maybe governments types should be limited to (MAX_NUM_ITEMS / 2), using SINT8
for using -1 as government id?

Maybe we should avoid to send player info packets during the ruleset reloading
cycle? (this appear to me the best solution)


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #20517] Invalid read of size 4 in ruleset reloading cycle

2013-02-16 Thread pepeto
Follow-up Comment #1, bug #20517 (project freeciv):

See also bug #19814

___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #20517] Invalid read of size 4 in ruleset reloading cycle

2013-02-16 Thread pepeto
URL:
  

 Summary: Invalid read of size 4 in ruleset reloading cycle
 Project: Freeciv
Submitted by: pepeto
Submitted on: sam. 16 févr. 2013 22:31:53 CET
Category: general
Severity: 3 - Normal
Priority: 5 - Normal
  Status: Ready For Test
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: S2_3, S2_4, trunk
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

dio_put_uint8() and valgrid reported a read error in ruleset reloading cycle:

Trying to put 177836256 into 8 bits
Trying to put 177836256 into 8 bits
Trying to put 3331952 into 8 bits
Trying to put 3331952 into 8 bits
Trying to put 1713398619 into 8 bits
Trying to put 1713398619 into 8 bits
Trying to put 1713398619 into 8 bits
Trying to put 1713398619 into 8 bits
Trying to put 1713398619 into 8 bits
Trying to put 1713398619 into 8 bits



==17762== Invalid read of size 4
==17762==at 0x8196B8B: government_number (government.c:93)
==17762==by 0x80E20E6: package_player_info (plrhand.c:957)
==17762==by 0x80E2A4F: send_player_info_c_real (plrhand.c:782)
==17762==by 0x80E2C00: send_player_info_c (plrhand.c:755)
==17762==by 0x80F689B: load_rulesetdir (ruleset.c:5061)
==17762==by 0x80F95DC: load_rulesets (ruleset.c:5069)
==17762==by 0x808075A: set_rulesetdir (stdinhand.c:3794)
==17762==by 0x8088E60: handle_stdin_input_real.part.16 (stdinhand.c:4327)
==17762==by 0x808B50F: read_init_script_real (stdinhand.c:1264)
==17762==by 0x8088773: handle_stdin_input_real.part.16 (stdinhand.c:1181)
==17762==by 0x8136374: handle_chat_msg_req (handchat.c:343)
==17762==by 0x80D6AE3: server_handle_packet (hand_gen.c:40)
==17762==  Address 0x6f76a38 is 0 bytes inside a block of size 1,344 free'd
==17762==at 0x402B06C: free (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==17762==by 0x8197C5C: governments_free (government.c:536)
==17762==by 0x8196304: game_ruleset_free (game.c:521)
==17762==by 0x80F6866: load_rulesetdir (ruleset.c:5124)
==17762==by 0x80F95DC: load_rulesets (ruleset.c:5069)
==17762==by 0x808075A: set_rulesetdir (stdinhand.c:3794)
==17762==by 0x8088E60: handle_stdin_input_real.part.16 (stdinhand.c:4327)
==17762==by 0x808B50F: read_init_script_real (stdinhand.c:1264)
==17762==by 0x8088773: handle_stdin_input_real.part.16 (stdinhand.c:1181)
==17762==by 0x8136374: handle_chat_msg_req (handchat.c:343)
==17762==by 0x80D6AE3: server_handle_packet (hand_gen.c:40)
==17762==by 0x80774C1: server_packet_input (srv_main.c:1579)


Patch attached which fix the problem for me. But I'm scared for secondary
effects.




___

File Attachments:


---
Date: sam. 16 févr. 2013 22:31:53 CET  Name: ruleset_reload_player_gov.diff 
Size: 423 o   By: pepeto



___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


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