[Freeciv-Dev] [bug #24309] Freeciv-web server using max cpu

2016-01-17 Thread Marko Lindqvist
Follow-up Comment #14, bug #24309 (project freeciv):

I'm running autogame tests with the complete/proper fix. Not that the code in
question would be often (or at least early) exposed (with the unmodified
rulesets my test set uses)

___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-16 Thread Sveinung Kvilhaugsvik
Follow-up Comment #13, bug #24309 (project freeciv):

(2.5 quick fix, like in Freeciv-web)
>  What happens if there's already max number of spaceship parts and some city
continues to build them?
I don't think that can happen. I think that the player will be told that the
building is "no longer available."
city_build_building() checks that can_city_build_improvement_now() before
building something. It will, via other calls, end up checking the max number
of various kinds of spaceship parts in can_player_build_improvement_direct().


(2.5 back port of 3.0/2.6 solution)
> It also doesn't exist yet.
No longer true. See comment #11.

___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-16 Thread Sveinung Kvilhaugsvik
Update of bug #24309 (project freeciv):

  Status: In Progress => Ready For Test 

___

Follow-up Comment #6:

This bug can be triggered by connecting a client that launches the space ship
without placing the space ship parts. The bundled clients can be modified to
do this.

3.0 version is ready for test. 2.6 version isn't.

I suspect, but haven't verified, that this bug is present in 2.5 too. Should
the 2.5.2 release go ahead with a potential denial of service bug?

___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-16 Thread Sveinung Kvilhaugsvik
Update of bug #24309 (project freeciv):

 Release:  TRUNK, 2.6 => TRUNK, 2.6, 2.5

___

Follow-up Comment #7:

> I suspect, but haven't verified, that this bug is present in 2.5 too.
Verified present in 2.5

___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-16 Thread Sveinung Kvilhaugsvik
Follow-up Comment #8, bug #24309 (project freeciv):

2.6 version.

(file #26351)
___

Additional Item Attachment:

File name: 2.6-Detect-spaceship-part-autoplace-failure.patch Size:11 KB


___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-16 Thread Sveinung Kvilhaugsvik
Update of bug #24309 (project freeciv):

 Planned Release:3.0.0, 2.6.0 => 3.0.0, 2.6.0, 2.5.x

___

Follow-up Comment #11:

Lightly tested back port to 2.5. Bigger and probably in need of more testing
than the quick fix. I may have misunderstood the 2.5 code.

One change I'm uncertain about: set retval to TRUE if placing the first
structural.

(file #26355)
___

Additional Item Attachment:

File name: 2.5-Detect-spaceship-part-autoplace-failure.patch Size:13 KB


___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-16 Thread Sveinung Kvilhaugsvik
Follow-up Comment #10, bug #24309 (project freeciv):

Possible quick fix for 2.5. Like the one in Freeciv-web. Will only work
against launched space ship. Assumes that handle_spaceship_place() will be a
success. Verified to work.

A back port of the solution for trunk and 2.6 would probably be better. On the
other hand I'm not sure if it would be better at this point in time. It would
be a bigger change. It also doesn't exist yet.

Jacob: what would you like to do?

(file #26354)
___

Additional Item Attachment:

File name: 2.5-possible_fix.patch Size:0 KB


___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-16 Thread Sveinung Kvilhaugsvik
Follow-up Comment #9, bug #24309 (project freeciv):

How to reproduce:
* apply the patch
* load the save game
* take the player "sveinung"
* turn done
* launch the space ship
* turn done

(file #26352, file #26353)
___

Additional Item Attachment:

File name: 2.5_reproduce.patchSize:0 KB
File name: 2.5_romskip_pre_launch_uferdig.sav.bz2 Size:19 KB


___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-16 Thread Marko Lindqvist
Follow-up Comment #12, bug #24309 (project freeciv):

> Will only work against launched space ship.

What happens if there's already max number of spaceship parts and some city
continues to build them?

___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-15 Thread Marko Lindqvist
Update of bug #24309 (project freeciv):

 Planned Release: 3.0.0, 2.6.0, 2.5.2 => 3.0.0, 2.6.0   

___

Follow-up Comment #4:

I don't think the bug is in part that S2_5 got, but in later changes.

I'm not convinced that proposed patch is the "right thing to do" in later
branches either.
You shouldn't load assumptions if the handle_spaceship_place() will success or
not to the calling function, but rather function called should return if it
succeeded or not. It might also need a parameter telling if it should be
silent or not (not sending these notifications to the client when it's server
side trying to autodo things)

___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-15 Thread Sveinung Kvilhaugsvik
Update of bug #24309 (project freeciv):

  Status:  Ready For Test => In Progress


___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-15 Thread Sveinung Kvilhaugsvik
Follow-up Comment #5, bug #24309 (project freeciv):

OK.

Attached patch still needs more testing.

(file #26347)
___

Additional Item Attachment:

File name: Detect-spaceship-part-autoplace-failure.patch Size:11 KB


___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-14 Thread Sveinung Kvilhaugsvik
Update of bug #24309 (project freeciv):

  Status:None => Ready For Test 
 Assigned to:None => sveinung   
 Release: => TRUNK, 2.6 
 Planned Release: => 3.0.0, 2.6.0   

___

Follow-up Comment #1:

Untested patch attached. I haven't checked if the problem is present in 2.5
too.

(file #26340)
___

Additional Item Attachment:

File name: 0001-Don-t-autoplace-spaceship-parts-after-launch.patch Size:0 KB


___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-14 Thread Andreas Røsdal
URL:
  

 Summary: Freeciv-web server using max cpu
 Project: Freeciv
Submitted by: andreasr
Submitted on: Thu 14 Jan 2016 10:42:45 PM UTC
Category: freeciv-web
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: GNU/Linux
 Planned Release: 

___

Details:

In the current version of Freeciv-web, sometimes the Freeciv C server begins
using 100% CPU and several gigabytes of memory. This is with Freeciv server
svn revision 30535.

Here is a backtrace from attaching to such as process:

(gdb) bt full
#0  utf8_check_string (string=string@entry=0x7ffef2285ec0 "You can't modify your spaceship after launch!",
length=length@entry=74) at utf.c:174
count = 1
i = 62
#1  0x7f059f346e96 in json_stringn (value=0x7ffef2285ec0 "You can't modify your spaceship after launch!",
len=74) at value.c:699
No locals.
#2  0x0060ea82 in dio_put_string_json ()
No symbol table info available.
#3  0x00589f89 in send_packet_chat_msg_100 ()
No symbol table info available.
#4  0x004092d8 in notify_conn_packet ()
No symbol table info available.
#5  0x00409a19 in notify_player ()
No symbol table info available.
#6  0x00433714 in adv_spaceship_autoplace ()
No symbol table info available.
#7  0x0041156b in srv_main ()
No symbol table info available.
#8  0x00407e89 in main ()
No symbol table info available.




___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-14 Thread Andreas Røsdal
Follow-up Comment #2, bug #24309 (project freeciv):

Thanks! Pushed to production.

___

Reply to this item at:

  

___
  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 #24309] Freeciv-web server using max cpu

2016-01-14 Thread Marko Lindqvist
Update of bug #24309 (project freeciv):

Category: freeciv-web => general
 Planned Release:3.0.0, 2.6.0 => 3.0.0, 2.6.0, 2.5.2

___

Follow-up Comment #3:

> I haven't checked if the problem is present in 2.5 too.

At least the server-side autoplace code for all players was ported to S2_5
too. It has been added since 2.5.1 -> this would be an regression, and we are
about to release 2.5.2 this weekend.

___

Reply to this item at:

  

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


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