[Freeciv-Dev] [bug #22359] Infinite loop in choose_random_tech()

2014-07-23 Thread pepeto
Update of bug #22359 (project freeciv):

  Status:  Ready For Test = Fixed  
 Open/Closed:Open = Closed 


___

Reply to this item at:

  http://gna.org/bugs/?22359

___
  Message sent via/by Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #22359] Infinite loop in choose_random_tech()

2014-07-21 Thread pepeto
Update of bug #22359 (project freeciv):

Category: freeciv-web = general
  Status:None = Ready For Test 
 Assigned to:None = pepeto 

___

Follow-up Comment #10:

Fix attached to handle properly A_FUTURE, and with some additional checks.


(file #21497)
___

Additional Item Attachment:

File name: research_invention_future_tech.patch Size:5 KB


___

Reply to this item at:

  http://gna.org/bugs/?22359

___
  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 #22359] Infinite loop in choose_random_tech()

2014-07-19 Thread pepeto
Update of bug #22359 (project freeciv):

 Release: = trunk r25603   
Operating System:   GNU/Linux = Any
 Planned Release: = 2.6.0  

___

Follow-up Comment #7:

This is a short-time fix. I think A_FUTURE is no more handled correctly in
some functions.


___

Reply to this item at:

  http://gna.org/bugs/?22359

___
  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 #22359] Infinite loop in choose_random_tech()

2014-07-19 Thread pepeto
Follow-up Comment #9, bug #22359 (project freeciv):

I meant this shouldn't be applied to trunk. This does not fix the real bug.


___

Reply to this item at:

  http://gna.org/bugs/?22359

___
  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 #22359] Infinite loop in choose_random_tech()

2014-07-18 Thread Emmet Hikory
Update of bug #22359 (project freeciv):

 Summary: Infinite loop in pick_random_tech = Infinite loop
in choose_random_tech()

___

Follow-up Comment #5:

I'm not understanding the recent changes to techs well enough to know the
right answer, but there's an infinite loop available in choose_random_tech()
when choose_tech() fails to set a research target (as it does when passed an
unresearchable target).  This patch worked for me, but I'm not at all
confident it's right, so won't even consider putting it in SVN (although
anyone else is welcome to swipe it if they understand the situation and like
this solution).  It may be useful to folk running public servers who want to
avoid this issue (but it may break other things: I don't know).


--- a/server/techtools.c
+++ b/server/techtools.c
@@ -924,7 +924,11 @@ void choose_random_tech(struct player *plr)
 {
   struct research* research = research_get(plr);
   do {
-choose_tech(plr, pick_random_tech(plr));
+Tech_type_id tech = pick_random_tech(plr);
+choose_tech(plr, tech);
+if (research_invention_state(research, tech) != TECH_PREREQS_KNOWN) {
+  break;
+}
   } while (research-researching == A_UNSET);
 }


Despite the backtraces, the call to pick_random_tech() where the
interruptions happen is always from choose_random_tech(), and
pick_random_tech() is iterating properly over all available advances, and
returning, and re-interating when called again (I did reproduce this several
times with instrumented builds to confirm this).

___

Reply to this item at:

  http://gna.org/bugs/?22359

___
  Message sent via/by Gna!
  http://gna.org/


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


[Freeciv-Dev] [bug #22359] Infinite loop in choose_random_tech()

2014-07-18 Thread Andreas Røsdal
Follow-up Comment #6, bug #22359 (project freeciv):

Thanks a lot. I can confirm that the patch solves the infinite loop problem.

___

Reply to this item at:

  http://gna.org/bugs/?22359

___
  Message sent via/by Gna!
  http://gna.org/


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