JoeDog / siege

Siege is an http load tester and benchmarking utility
GNU General Public License v3.0
5.95k stars 387 forks source link

[error] unable to set close control sock.c:127: Invalid argument #140

Closed johannhuang closed 6 years ago

johannhuang commented 6 years ago

Console Information:

> siege -c3 t1M http://localhost:3030   
** SIEGE 3.0.8
** Preparing 3 concurrent users for battle.
The server is now under siege...[error] unable to set close control sock.c:127: Invalid argument
[error] unable to set close control sock.c:127: Invalid argument
[error] unable to set close control sock.c:127: Invalid argument
[error] unable to set close control sock.c:127: Invalid argument
[error] unable to set close control sock.c:127: Invalid argument
[error] unable to set close control sock.c:127: Invalid argument
[error] unable to set close control sock.c:127: Invalid argument
[error] unable to set close control sock.c:127: Invalid argument
[error] unable to set close control sock.c:127: Invalid argument
[error] unable to set close control sock.c:127: Invalid argument
[error] unable to set close control sock.c:127: Invalid argument

Code Pieces:

/**
 * Create new socket and set socket options.
 * Handle possible error codes.
 */
private int
__socket_create(CONN *C, int domain)
{
  if ((C->sock = socket(domain, SOCK_STREAM, 0)) < 0) {
    switch (errno) {
      case EPROTONOSUPPORT: { NOTIFY(ERROR, "unsupported protocol %s:%d",  __FILE__, __LINE__); break; }
      case EMFILE:          { NOTIFY(ERROR, "descriptor table full %s:%d", __FILE__, __LINE__); break; }
      case ENFILE:          { NOTIFY(ERROR, "file table full %s:%d",       __FILE__, __LINE__); break; }
      case EACCES:          { NOTIFY(ERROR, "permission denied %s:%d",     __FILE__, __LINE__); break; }
      case ENOBUFS:         { NOTIFY(ERROR, "insufficient buffer %s:%d",   __FILE__, __LINE__); break; }
      default:              { NOTIFY(ERROR, "unknown socket error %s:%d",  __FILE__, __LINE__); break; }
    } socket_close(C); return -1;
  }
  if (fcntl(C->sock, F_SETFD, O_NDELAY) < 0) {
    NOTIFY(ERROR, "unable to set close control %s:%d", __FILE__, __LINE__);
  }

in src/sock.c from line 396.

Anyone knows what is wrong?

JoeDog commented 6 years ago

Version 3.0.8 is so old that I can't readily tell you how old it is.

That said, I can't think of a reason why you'd be getting this error. My hunch would be too many open files but you're only running three users.

Jeff

On Thu, Aug 16, 2018 at 10:56 PM, Johann Huang notifications@github.com wrote:

siege -c3 t1M http://localhost:3030 SIEGE 3.0.8 Preparing 3 concurrent users for battle. The server is now under siege...[error] unable to set close control sock.c:127: Invalid argument [error] unable to set close control sock.c:127: Invalid argument [error] unable to set close control sock.c:127: Invalid argument [error] unable to set close control sock.c:127: Invalid argument [error] unable to set close control sock.c:127: Invalid argument [error] unable to set close control sock.c:127: Invalid argument [error] unable to set close control sock.c:127: Invalid argument [error] unable to set close control sock.c:127: Invalid argument [error] unable to set close control sock.c:127: Invalid argument [error] unable to set close control sock.c:127: Invalid argument [error] unable to set close control sock.c:127: Invalid argument

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JoeDog/siege/issues/140, or mute the thread https://github.com/notifications/unsubscribe-auth/AFMT5hdL5paOEdODaJqKqP3jzCFEydm5ks5uRjD4gaJpZM4WA5Bp .

johannhuang commented 6 years ago

@JoeDog Thanks!

I installed siege from default apt repository of Ubuntu 16.04.

Since it is just a problem of version And I guess it is time to close this issue.