Mantis - Squeak Packages
Viewing Issue Advanced Details
5410 KomHttpServer feature always 11-13-06 22:27 10-24-07 11:11
0005410: Memory exhaustion
Take a fresh seaside installation, start wakom server e.g. on port 8080 with "WaKom startOn: 8080" and use netcat to spam the server: "yes | nc localhost 8080". Squeak won't stop receiving data and the image will grow, and grow, and grow ...
After some time there will be an out-of-memory warning. I'm not sure that this will finally crash Squeak, but it definitely exhausts memory at makes the system slow which is not very nice. With some time this can be done from a single connection.
Other servers close connection or throw away data if it is forseeable that no serious client request is made.
This is not necessarily a bug in Seaside. Maybe a design flaw. The problem may also lay in WaKom or SocketStream.
Some of the next* methods in SocketStream are also dangerous. They receive until a delimiter is reached, not caring about the buffer size which will just grow continously.

10-24-07 11:11   
HTTP 1.1 allows a server to shut down a request with a 413 status code if the representation in the request is too large for the server's settings. Now, this should probably be a developer's decision, but KomHttpServer could have some support code to make things easier for the developer.