segfault with max-connection option

92 views
Skip to first unread message

Christof Damian

unread,
Nov 23, 2010, 2:47:44 PM11/23/10
to siege...@googlegroups.com
A Fedora user reported this, I can verify it in my install and also
building directly from source with:

./configure ; make ; ./src/siege --max-connections=10 http://localhost

Summary: siege segfaults in glibc's getopt_long() -> __strncmp_sse2()

https://bugzilla.redhat.com/show_bug.cgi?id=656320

Description of problem:
siege segfaults in glibc's getopt_long() -> __strncmp_sse2()
when using --max-connections parameter:

$ gdb -q --args siege --max-connections=10 http://localhost
(gdb) run
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff70a9d28 in __strncmp_sse2 () from /lib64/libc.so.6
(gdb) bt
#0 0x00007ffff70a9d28 in __strncmp_sse2 () from /lib64/libc.so.6
#1 0x00007ffff70f08bf in _getopt_internal_r () from /lib64/libc.so.6
#2 0x00007ffff70f192b in _getopt_internal () from /lib64/libc.so.6
#3 0x00007ffff70f19b3 in getopt_long () from /lib64/libc.so.6
#4 0x000000000040c043 in parse_rc_cmdline (argc=3, argv=0x7fffffffdd98) at
main.c:168
#5 0x000000000040c4ca in main (argc=3, argv=0x7fffffffdd98) at main.c:311


Version-Release number of selected component (if applicable):
siege-2.70-1.fc14.x86_64

je...@joedog.org

unread,
Nov 23, 2010, 3:13:34 PM11/23/10
to siege...@googlegroups.com
It segfaulted in getopt. I'd like to think getopts would have handled it.
In this case, that flag doesn't exist.

You probably want this command line directive:

-c, --concurrent=NUM CONCURRENT users, default is 10

so: siege -c10 -r10 http://localhost/

Christof Damian

unread,
Nov 29, 2010, 3:17:30 PM11/29/10
to siege...@googlegroups.com
I found the problem. The long options were missing the end marker.
This should fix it:

--- siege-2.70/src/main.c.orig 2010-11-29 21:13:00.302155306 +0100
+++ siege-2.70/src/main.c 2010-11-29 21:13:33.172151262 +0100
@@ -74,7 +74,8 @@
{ "rc", required_argument, NULL, 'R' },
{ "mark", required_argument, NULL, 'm' },
{ "header", required_argument, NULL, 'H' },
- { "user-agent", required_argument, NULL, 'A' }
+ { "user-agent", required_argument, NULL, 'A' },
+ {0, 0, 0, 0}
};

/**

je...@joedog.org

unread,
Nov 30, 2010, 8:22:03 AM11/30/10
to siege...@googlegroups.com
ChangeLog:

2010/11/30 Christof Damian <with...@thisforum.com>
* src/main.c terminated the long options

Thanks,
Jeff

Reply all
Reply to author
Forward
0 new messages