Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 68228 invoked from network); 17 Mar 2004 17:31:40 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 17 Mar 2004 17:31:40 -0000 Received: (qmail 83695 invoked by uid 500); 17 Mar 2004 17:31:18 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 83667 invoked by uid 500); 17 Mar 2004 17:31:18 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 83587 invoked from network); 17 Mar 2004 17:31:18 -0000 Received: from unknown (HELO zcamail03.zca.compaq.com) (161.114.32.103) by daedalus.apache.org with SMTP; 17 Mar 2004 17:31:18 -0000 Received: from cacexg11.americas.cpqcorp.net (cacexg11.americas.cpqcorp.net [16.92.1.50]) by zcamail03.zca.compaq.com (Postfix) with ESMTP id 6A31EA4B0 for ; Wed, 17 Mar 2004 09:31:21 -0800 (PST) Received: from cacexc03.americas.cpqcorp.net ([16.92.1.27]) by cacexg11.americas.cpqcorp.net with Microsoft SMTPSVC(6.0.3790.0); Wed, 17 Mar 2004 09:31:25 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: [PATCH] ab.c: check for invalid value for concurrency Date: Wed, 17 Mar 2004 09:31:20 -0800 Message-ID: <16A24B6050584143978000646801E93557BF95@cacexc03.americas.cpqcorp.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] ab.c: check for invalid value for concurrency Thread-Index: AcQMRalraWu6cmYSSGeioJoYYUXMmw== From: "Mathihalli, Madhusudan" To: X-OriginalArrivalTime: 17 Mar 2004 17:31:25.0564 (UTC) FILETIME=[AC4423C0:01C40C45] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, If the "-c" option is given a arbitrarily huge value, ab dumps core. (Try: ab -c 2147483647 http://foo.com/) Here's a patch that limits the concurrency to MAX_CONCURRENCY (=3D = 20000). The actual value of MAX_CONCURRENCY can be raised/lowered if you = think the value is not appropriate. Thanks -Madhu Index: ab.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/httpd-2.0/support/ab.c,v retrieving revision 1.139 diff -u -r1.139 ab.c --- ab.c 17 Mar 2004 00:06:44 -0000 1.139 +++ ab.c 17 Mar 2004 17:14:38 -0000 @@ -245,6 +245,7 @@ =20 #define ap_min(a,b) ((a)<(b))?(a):(b) #define ap_max(a,b) ((a)>(b))?(a):(b) +#define MAX_CONCURRENCY 20000 =20 /* --------------------- GLOBALS ---------------------------- */ =20 @@ -2158,6 +2159,11 @@ usage(argv[0]); } =20 + if ((concurrency < 0) || (concurrency > MAX_CONCURRENCY)) { + fprintf(stderr, "%s: Invalid Concurrency [Range 0..%d]\n", + argv[0], MAX_CONCURRENCY); + usage(argv[0]; + } =20 if ((heartbeatres) && (requests > 150)) { heartbeatres =3D requests / 10; /* Print line every 10% of = requests */