From modules-devthomasbishop@example.net Tue Dec 01 08:25:36 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 8597 invoked from network); 1 Dec 2009 08:25:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2009 08:25:36 -0000 Received: (qmail 37821 invoked by uid 500); 1 Dec 2009 08:25:35 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 37752 invoked by uid 500); 1 Dec 2009 08:25:34 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 37742 invoked by uid 99); 1 Dec 2009 08:25:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2009 08:25:34 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of thomasbishop@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO s2.yoderdev.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2009 08:25:32 +0000 Received: from [83.161.120.155] (cpe-72-181-100-92.satx.res.rr.com [83.161.120.155]) by s2.yoderdev.com (Postfix) with ESMTP id 737ACE20FB for <thomasbishop@example.net>; Tue, 1 Dec 2009 08:23:00 +0000 (GMT) Message-ID: <thomasbishop@example.net> Date: Tue, 01 Dec 2009 02:26:19 -0600 From: Micah Yoder <thomasbishop@example.net> User-Agent: Thunderbird 83.161.120.155 (X11/20090817) MIME-Version: 1.0 To: thomasbishop@example.net Subject: Segfault doing SQL select Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, I'm new to this. Just read most of Nick Kew's book and am trying to write a module that is a thin-as-possible layer between an AJAX type rich client web app and an SQL database. I then hope to build a small CMS on top of that. Currently I'm running into a road block with a segfault every time I run the query. I'm using Postgres 8.4 from the Ubuntu repos and a custom-compiled Apache 2.2.14 with the Worker MPM. Here is the relevant code: void sql_template(ap_dbd_t *con, request_rec *r, apr_hash_t *formdata) { apr_dbd_results_t *res; apr_dbd_row_t *row; int rv; rv = apr_dbd_select(con->driver, r->pool, con->handle, &res, "select * from topics;", 0); if (!rv) ap_rputs("Failed to run query.\n", r); while (apr_dbd_get_row(con->driver, r->pool, res, &row, 0) != -1) { ap_rputs("*** Row data *** ", r); ap_rputs(apr_dbd_get_entry(con->driver, row, 0), r); ap_rputs(" ... ", r); ap_rputs(apr_dbd_get_entry(con->driver, row, 1), r); } } This is being called from the main handler function. apr_hash_t *formdata; ap_dbd_t *con; [...] if (r->method_number == M_GET) formdata = parse_form_from_string(r, r->args); [...] con = ap_dbd_acquire(r); if (!con) return HTTP_INTERNAL_SERVER_ERROR; sql_template(con, r, formdata); Kind of ugly but I'm just trying to get the concepts to work. I've run it through GDB and sometimes the segfault is on apr_dbd_select line and sometimes it is on the apr_dbd_get_row line. The arguments passed into my sql_template function seem to be valid. Am I doing anything obviously wrong? Or can someone point to a simple handler module that does a SELECT? (mod_auth_dbd appears to use a different method and introduces other complexities.) Thanks, Micah From modules-devthomasbishop@example.net Tue Dec 01 08:46:12 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 14187 invoked from network); 1 Dec 2009 08:46:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2009 08:46:12 -0000 Received: (qmail 59849 invoked by uid 500); 1 Dec 2009 08:46:11 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 59806 invoked by uid 500); 1 Dec 2009 08:46:11 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 59796 invoked by uid 99); 1 Dec 2009 08:46:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2009 08:46:11 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of thomasbishop@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-bw0-f221.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2009 08:46:03 +0000 Received: by bwz21 with SMTP id 21so3206683bwz.24 for <thomasbishop@example.net>; Tue, 01 Dec 2009 00:45:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=kR0903Vn1LpgO0opSjVe8ppNNERGqyrE3+D4+V+q5RA=; b=phUAAMSMmfrxI3bH8tUTI8Rl0LfNNdOl/cilMcsd2aOdOX0wSCHjbepwerwq/+d5Pv +KqbG9rCjkAtXw7RY9drQQzHOZYEoxlmuEcr+DqQ/T1MJjo/0mhqwqb75F7yLPZX+AhY z2nac2CZV4h9XgsKqOLVMLLPygS/yPojJ4/RQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=iGnKV/XU0vk1zSkTKgjhkSEGtsf9Sg3xYqCgqoAKrNzIHxNhKpk8DLE9lNf1rfh0ik 6a1/zMPEBe382DWQLGvdf+9B6bF/DYLVbL2DHu3l0SDUfl2ygYPDEbE/3et5tJOmzefi 0dKuCH/ARf4TyQTyrjvwXUZaoKN4pPq1E69aI= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id p21mr5226869bkw.163.1259657142809; Tue, 01 Dec 2009 00:45:42 -0800 (PST) In-Reply-To: <thomasbishop@example.net> References: <thomasbishop@example.net> Date: Tue, 1 Dec 2009 09:45:42 +0100 Message-ID: <thomasbishop@example.net> Subject: Re: Segfault doing SQL select From: Jerome Renard <thomasbishop@example.net> To: thomasbishop@example.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hello, On Tue, Dec 1, 2009 at 9:26 AM, Micah Yoder <thomasbishop@example.net> wrote: [...] > Am I doing anything obviously wrong? Or can someone point to a simple > handler module that does a SELECT? (mod_auth_dbd appears to use a differe= nt > method and introduces other complexities.) Maybe the piece of code available here will help you : - http://code.google.com/p/modurlalias/source/browse/src/mod_url_alias.c#45= 4 Best Regards -- J=C3=A9r=C3=B4me :) From modules-devthomasbishop@example.net Tue Dec 01 09:23:29 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 24010 invoked from network); 1 Dec 2009 09:23:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2009 09:23:29 -0000 Received: (qmail 5135 invoked by uid 500); 1 Dec 2009 09:23:29 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 5063 invoked by uid 500); 1 Dec 2009 09:23:28 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 5053 invoked by uid 99); 1 Dec 2009 09:23:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2009 09:23:28 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of thomasbishop@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-fx0-f216.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2009 09:23:20 +0000 Received: by fxm8 with SMTP id 8so3995555fxm.27 for <thomasbishop@example.net>; Tue, 01 Dec 2009 01:23:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=p49cvB03E5ggLMxnu+i8Gl/2FSV/WhhMFk9RH65E13c=; b=rw1n5o+JGBbMQefWTdYmAXyZfYvJt9MIHqpBxzjaxUtZ/Xi+f9xeuu9NhoMLAAX2AX ads9gRkaS2+AaJKoZjx+Kc0+XHGTAn8qSLLkLYaXlqxZAsGkhD8amQDKiLCTzRb2ICr9 BK/qPKt1TTa+pX8oISB+2qbhOnee2wqmRWaAs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=S1HbDby90h5veT9DXIgxOOZZZIom7mAlhFf5k8ubkYyI8T6CiyfKQ+WEQnv6Ph7V3G qvNSF2qvLOqrHDU5SgGy4EMhbwNSgdOiu/KpCu+L41ByV2obdKp2qxV854Uj7k7aawR2 QlvEJnTNvt9LihyYn0zGZqWAMpYRTpzOCjRaQ= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id i36mr1893629mul.122.1259659380404; Tue, 01 Dec 2009 01:23:00 -0800 (PST) In-Reply-To: <thomasbishop@example.net> References: <thomasbishop@example.net> Date: Tue, 1 Dec 2009 10:23:00 +0100 Message-ID: <thomasbishop@example.net> Subject: Re: Segfault doing SQL select From: Sorin Manolache <thomasbishop@example.net> To: thomasbishop@example.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Dec 1, 2009 at 09:26, Micah Yoder <thomasbishop@example.net> wrote: > Hello, > > I'm new to this. Just read most of Nick Kew's book and am trying to write= a > module that is a thin-as-possible layer between an AJAX type rich client = web > app and an SQL database. I then hope to build a small CMS on top of that. > > Currently I'm running into a road block with a segfault every time I run = the > query. I'm using Postgres 8.4 from the Ubuntu repos and a custom-compiled > Apache 2.2.14 with the Worker MPM. =A0Here is the relevant code: > > void sql_template(ap_dbd_t *con, request_rec *r, apr_hash_t *formdata) { > =A0apr_dbd_results_t *res; Set res to NULL before passing it. > =A0apr_dbd_row_t *row; Set row to NULL before passing it. > =A0int rv; > > =A0rv =3D apr_dbd_select(con->driver, r->pool, con->handle, &res, "select= * from > topics;", 0); > =A0if (!rv) > =A0 ap_rputs("Failed to run query.\n", r); > =A0while (apr_dbd_get_row(con->driver, r->pool, res, &row, 0) !=3D -1) { > =A0 ap_rputs("*** Row data *** ", r); > =A0 ap_rputs(apr_dbd_get_entry(con->driver, row, 0), r); > =A0 ap_rputs(" ... ", r); > =A0 ap_rputs(apr_dbd_get_entry(con->driver, row, 1), r); > =A0} > } > > This is being called from the main handler function. > > =A0apr_hash_t *formdata; > =A0ap_dbd_t *con; > > [...] > > =A0if (r->method_number =3D=3D M_GET) > =A0 formdata =3D parse_form_from_string(r, r->args); > > [...] > > =A0con =3D ap_dbd_acquire(r); > =A0if (!con) return HTTP_INTERNAL_SERVER_ERROR; > > =A0sql_template(con, r, formdata); > > Kind of ugly but I'm just trying to get the concepts to work. > > I've run it through GDB and sometimes the segfault is on apr_dbd_select l= ine > and sometimes it is on the apr_dbd_get_row line. The arguments passed int= o > my sql_template function seem to be valid. > > Am I doing anything obviously wrong? Or can someone point to a simple > handler module that does a SELECT? (mod_auth_dbd appears to use a differe= nt > method and introduces other complexities.) > > Thanks, > Micah > > > --=20 A: Because it reverses the logical flow of conversation. Q: Why is top-posting frowned upon? A: Top-posting. Q: What is the most annoying thing in e-mail? From modules-devthomasbishop@example.net Tue Dec 01 10:02:07 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 48456 invoked from network); 1 Dec 2009 10:02:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2009 10:02:07 -0000 Received: (qmail 68036 invoked by uid 500); 1 Dec 2009 10:02:07 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 67971 invoked by uid 500); 1 Dec 2009 10:02:06 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 67961 invoked by uid 99); 1 Dec 2009 10:02:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2009 10:02:06 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of thomasbishop@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO s2.yoderdev.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2009 10:02:04 +0000 Received: from [83.161.120.155] (cpe-72-181-100-92.satx.res.rr.com [83.161.120.155]) by s2.yoderdev.com (Postfix) with ESMTP id 6B356E20FB for <thomasbishop@example.net>; Tue, 1 Dec 2009 09:59:33 +0000 (GMT) Message-ID: <thomasbishop@example.net> Date: Tue, 01 Dec 2009 04:02:51 -0600 From: Micah Yoder <thomasbishop@example.net> User-Agent: Thunderbird 83.161.120.155 (X11/20090817) MIME-Version: 1.0 To: thomasbishop@example.net Subject: Re: Segfault doing SQL select References: <thomasbishop@example.net> <thomasbishop@example.net> In-Reply-To: <thomasbishop@example.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sorin Manolache wrote: >> void sql_template(ap_dbd_t *con, request_rec *r, apr_hash_t *formdata) { >> apr_dbd_results_t *res; >> > > > Set res to NULL before passing it. > > >> apr_dbd_row_t *row; >> > > > Set row to NULL before passing it. > > that was it. Thanks so much! Guess I thought that the functions would have ignored and overridden any nonsensical values. Oh well. And thank you too Jerome, I'm sure I will be studying that code. From modules-devthomasbishop@example.net Tue Dec 01 11:44:07 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 83957 invoked from network); 1 Dec 2009 11:44:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2009 11:44:07 -0000 Received: (qmail 19057 invoked by uid 500); 1 Dec 2009 11:44:07 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 18998 invoked by uid 500); 1 Dec 2009 11:44:07 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 18988 invoked by uid 99); 1 Dec 2009 11:44:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2009 11:44:07 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of thomasbishop@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-pw0-f45.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2009 11:43:55 +0000 Received: by pwi15 with SMTP id 15so2601002pwi.24 for <thomasbishop@example.net>; Tue, 01 Dec 2009 03:43:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=JiKH7InSP5CUMtzPtL3v4JwFkB1s8XAgqEosujMrtFo=; b=reei02WgJA50oFUOggPP2bdOFKkMlgeBSvpzVlKRtPUa7bG4pzItT5O/G2QbzdyoJz KXosMaTMDuxrmuuStagoTmWqsk2FCwvyGrDe8XlbyVcmYIwdc6bOaqNZBlxGiyiEkFFF Qf2aDohX1Gs+1XGzK74ziMnqfaE2Gbj2MgahE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=kxv523SyXZ2mSvhnlMLT4S65BXe74SG6562GnXIvtfer/eR0GWPximL8meIyfVVG0n fCl+yQA9VPgXID3LkgmlUolNlP9Ay7d/+xHz5gI6/F43zgZOGybCpkHzBys2iaOQ31BP HVQozVKBXmITuwW/ZjxS6YcxIdpMcY7ChZ6JU= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id d14mr389830rvk.256.1259667814262; Tue, 01 Dec 2009 03:43:34 -0800 (PST) In-Reply-To: <thomasbishop@example.net> References: <thomasbishop@example.net> <thomasbishop@example.net> <thomasbishop@example.net> Date: Tue, 1 Dec 2009 17:13:34 +0530 Message-ID: <thomasbishop@example.net> Subject: Re: Reading post parameters from apache request From: pranil dasika <thomasbishop@example.net> To: thomasbishop@example.net Content-Type: multipart/alternative; boundary=000e0cd1505e9aa7d20479a94482 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd1505e9aa7d20479a94482 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Nov 30, 2009 at 8:49 AM, Yoichi Kawasaki <thomasbishop@example.net> wrote: > 2009/11/21 Sorin Manolache <thomasbishop@example.net>: > > On Fri, Nov 20, 2009 at 22:01, pranil dasika <thomasbishop@example.net> > wrote: > >> Hi, > >> > >> I am trying to write a custom module where I need to read post > parameters > >> from the request. I guess apreq library is relevant to this but could > not > >> find any substantial examples or documents. > >> Is there any other way to read the params other than apreq. Any > pseudocode/ > >> examples will be appreciated. > >> > >> Thanks, > >> Pranil > >> > > > > Here you have an example. It is not optimal, you could, for example, > > take the brigade creation out of the loop and clean the brigade at the > > end of each iteration, after you extracted the data. > > > > apr_bucket_brigade *bb; > > do { > > bb = apr_brigade_create(req->pool, req->connection->bucket_alloc); > > if (0 == bb) > > // error > > if (APR_SUCCESS != ap_get_brigade(req->input_filters, bb, > > AP_MODE_READBYTES, APR_BLOCK_READ, 9216)) > > // error > > extract data from bb; > > } while (EOS not yet encountered in bb); > > > > > > S > > > > > Hi > > I have an another example. I read post parameters in the source code > below: > > http://github.com/yokawasa/mod_akismet/blob/master/mod_akismet.c#L647 > line: 647 - 705 > > hope this helps you. > > Yoichi > > -- > Yoichi Kawasaki <thomasbishop@example.net> > Sorin, Yoichi, Thanks for your responses. The below code worked for me using apreq. const apr_table_t* args; apreq_handle_t* h = apreq_handle_apache2(r); apreq_body(h, &args); const char *params = apreq_params_as_string(r->pool, args, NULL, APREQ_JOIN_QUOTE); -Pranil --000e0cd1505e9aa7d20479a94482-- From modules-devthomasbishop@example.net Mon Dec 07 23:45:15 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 5971 invoked from network); 7 Dec 2009 23:45:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Dec 2009 23:45:15 -0000 Received: (qmail 5726 invoked by uid 500); 7 Dec 2009 23:45:14 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 5704 invoked by uid 500); 7 Dec 2009 23:45:12 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 5694 invoked by uid 99); 7 Dec 2009 23:45:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Dec 2009 23:45:12 +0000 X-ASF-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,HTML_FONT_LOW_CONTRAST,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO mail-gx0-f210.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Dec 2009 23:45:09 +0000 Received: by gxk2 with SMTP id 2so4364383gxk.4 for <thomasbishop@example.net>; Mon, 07 Dec 2009 15:44:48 -0800 (PST) Received: by 83.161.120.155 with SMTP id m1mr12540872ybc.182.1260229488039; Mon, 07 Dec 2009 15:44:48 -0800 (PST) Received: from ?83.161.120.155? (NACREDATA.NET [83.161.120.155]) by mx.google.com with ESMTPS id 14sm3046450gxk.6.283.161.120.155.44.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Dec 2009 15:44:47 -0800 (PST) Message-Id: <thomasbishop@example.net> From: Devin Ceartas <thomasbishop@example.net> To: thomasbishop@example.net Content-Type: multipart/alternative; boundary=Apple-Mail-10-601927629 Mime-Version: 1.0 (Apple Message framework v936) Subject: Linking in libraries to Apache Module Date: Mon, 7 Dec 2009 18:44:45 -0500 X-Mailer: Apple Mail (2.936) --Apple-Mail-10-601927629 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Playing around with this a bit, but not getting too far... The logic of my SQLite code works if I compile it as a stand-alone executable. My mod_hello.c compiles and loads/works fine without the SQLite code Combining the two, the module compiles and is installed, but the apache process dies immediately (core dump) every time it is loaded. Stripping out all the SQLite code and simply linking against SQLite causes this problem. In other words, with the same code: apxs -cia -L/usr/local/lib -I/home/devin mod_hello.c /* Works Fine, prints "hello world" */ apxs -cia -L/usr/local/lib -I/home/devin -lsqlite3 mod_hello.c /* compiles but dies on apache load */ The platform is OpenBSD 4.6 with the platform's version of Apache 1.3 and SQLite 3.6.20 downloaded from the SQLite site and compiled from source Since I'm just getting started with C apache modules, I assume I'm missing something basic. --Apple-Mail-10-601927629-- From modules-devthomasbishop@example.net Mon Dec 07 23:57:20 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 8238 invoked from network); 7 Dec 2009 23:57:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Dec 2009 23:57:20 -0000 Received: (qmail 16374 invoked by uid 500); 7 Dec 2009 23:57:19 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 16302 invoked by uid 500); 7 Dec 2009 23:57:18 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 16292 invoked by uid 99); 7 Dec 2009 23:57:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Dec 2009 23:57:18 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO onyx.sharktooth.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Dec 2009 23:57:07 +0000 Received: from [83.161.120.155] (helo=cyanide.overstock.com) by onyx.sharktooth.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from <thomasbishop@example.net>) id 1NHnRa-000G9g-Ci for thomasbishop@example.net; Mon, 07 Dec 2009 16:56:45 -0700 Message-ID: <thomasbishop@example.net> Date: Mon, 07 Dec 2009 16:56:21 -0700 From: Joe Lewis <thomasbishop@example.net> User-Agent: Thunderbird 83.161.120.155 (X11/20090825) MIME-Version: 1.0 To: thomasbishop@example.net References: <thomasbishop@example.net> In-Reply-To: <thomasbishop@example.net> Content-Type: multipart/alternative; boundary="------------000603080502090307080506" X-SA-Exim-Connect-IP: 83.161.120.155 X-SA-Exim-Mail-From: thomasbishop@example.net X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on onyx.sharktooth.org X-Spam-Level: Subject: Re: Linking in libraries to Apache Module X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on onyx.sharktooth.org) X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, HTML_40_50,HTML_MESSAGE autolearn=ham version=3.1.7 --------------000603080502090307080506 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Devin Ceartas wrote: > The logic of my SQLite code works if I compile it as a stand-alone > executable. > > My mod_hello.c compiles and loads/works fine without the SQLite code > > Combining the two, the module compiles and is installed, but the > apache process dies immediately (core dump) every time it is loaded. > Stripping out all the SQLite code and simply linking against SQLite > causes this problem. In other words, with the same code: > > apxs -cia -L/usr/local/lib -I/home/devin mod_hello.c > /* Works Fine, prints "hello world" */ > > apxs -cia -L/usr/local/lib -I/home/devin -lsqlite3 mod_hello.c > /* compiles but dies on apache load */ > The platform is OpenBSD 4.6 with the platform's version of Apache 1.3 > and SQLite 3.6.20 downloaded from the SQLite site and compiled from > source > > Since I'm just getting started with C apache modules, I assume I'm > missing something basic. If using a Linux-based system, I'd suggest ensuring that ld.so.conf is setup to point to the directory or that the compile has the runtime path for the sqlite library. For example, I have added "-rpath /usr/local/lib -rpath /usr/local/lib/mysql" to my -L parameters for apxs to load mySQL external modules dynamically in the past. Linux-based systems also have an "strace" command that may be used to figure out what libraries are missing. -- Joe Lewis Chief Nerd SILVERHAWK <http://www.silverhawk.net/> (276)277-0925 ------------------------------------------------------------------------ /Rights that do not flow directly from duty well performed are not worth having. --Mohandas K. Gandhi/ --------------000603080502090307080506-- From modules-devthomasbishop@example.net Tue Dec 08 00:08:23 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 11007 invoked from network); 8 Dec 2009 00:08:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Dec 2009 00:08:23 -0000 Received: (qmail 23249 invoked by uid 500); 8 Dec 2009 00:08:23 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 23133 invoked by uid 500); 8 Dec 2009 00:08:21 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 23123 invoked by uid 99); 8 Dec 2009 00:08:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 00:08:21 +0000 X-ASF-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO mail-yw0-f176.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 00:08:18 +0000 Received: by ywh6 with SMTP id 6so4637563ywh.4 for <thomasbishop@example.net>; Mon, 07 Dec 2009 16:07:58 -0800 (PST) Received: by 83.161.120.155 with SMTP id 29mr12467966ybq.253.1260230877753; Mon, 07 Dec 2009 16:07:57 -0800 (PST) Received: from ?83.161.120.155? (NACREDATA.NET [83.161.120.155]) by mx.google.com with ESMTPS id 9sm2211777ywf.35.283.161.120.155.07.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Dec 2009 16:07:56 -0800 (PST) Message-Id: <thomasbishop@example.net> From: Devin Ceartas <thomasbishop@example.net> To: thomasbishop@example.net In-Reply-To: <thomasbishop@example.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Linking in libraries to Apache Module Date: Mon, 7 Dec 2009 19:07:54 -0500 References: <thomasbishop@example.net> <thomasbishop@example.net> X-Mailer: Apple Mail (2.936) hm. -rpath doesn't seem to be an accepted flag in the apxs included with the latest OpenBSD -- devin On Dec 7, 2009, at 6:56 PM, Joe Lewis wrote: > Devin Ceartas wrote: >> The logic of my SQLite code works if I compile it as a stand-alone >> executable. >> >> My mod_hello.c compiles and loads/works fine without the SQLite code >> >> Combining the two, the module compiles and is installed, but the >> apache process dies immediately (core dump) every time it is >> loaded. Stripping out all the SQLite code and simply linking >> against SQLite causes this problem. In other words, with the same >> code: >> >> apxs -cia -L/usr/local/lib -I/home/devin mod_hello.c >> /* Works Fine, prints "hello world" */ >> >> apxs -cia -L/usr/local/lib -I/home/devin -lsqlite3 mod_hello.c >> /* compiles but dies on apache load */ >> The platform is OpenBSD 4.6 with the platform's version of Apache >> 1.3 and SQLite 3.6.20 downloaded from the SQLite site and compiled >> from source >> >> Since I'm just getting started with C apache modules, I assume I'm >> missing something basic. > > If using a Linux-based system, I'd suggest ensuring that ld.so.conf > is setup to point to the directory or that the compile has the > runtime path for the sqlite library. For example, I have added "- > rpath /usr/local/lib -rpath /usr/local/lib/mysql" to my -L > parameters for apxs to load mySQL external modules dynamically in > the past. > > Linux-based systems also have an "strace" command that may be used > to figure out what libraries are missing. > > -- > Joe Lewis > Chief Nerd SILVERHAWK <http://www.silverhawk.net/> (276)277-0925 > > ------------------------------------------------------------------------ > /Rights that do not flow directly from duty well performed are not > worth having. > --Mohandas K. Gandhi/ From modules-devthomasbishop@example.net Tue Dec 08 01:01:29 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 35562 invoked from network); 8 Dec 2009 01:01:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Dec 2009 01:01:29 -0000 Received: (qmail 64813 invoked by uid 500); 8 Dec 2009 01:01:29 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 64752 invoked by uid 500); 8 Dec 2009 01:01:27 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 64742 invoked by uid 99); 8 Dec 2009 01:01:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 01:01:27 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mail4.conversis.de) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 01:01:17 +0000 Received: from [83.161.120.155] (dslb-094-221-151-147.pools.arcor-ip.net [83.161.120.155]) by mail4.conversis.de (Postfix) with ESMTP id AD55E241000B for <thomasbishop@example.net>; Tue, 8 Dec 2009 02:05:33 +0100 (CET) Message-ID: <thomasbishop@example.net> Date: Tue, 08 Dec 2009 02:00:56 +0100 From: "Dennis J." <thomasbishop@example.net> User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:83.161.120.155) Gecko/20091203 Fedora/3.0-2.10.rc2.fc11 Thunderbird/3.0 MIME-Version: 1.0 To: thomasbishop@example.net Subject: Re: Linking in libraries to Apache Module References: <thomasbishop@example.net> <thomasbishop@example.net> <thomasbishop@example.net> In-Reply-To: <thomasbishop@example.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Have you tried "ldd <path-to-compiled-module>"? That could also give you a hint if anything is fishy with the library paths/dependencies. Regards, Dennis On 12/08/2009 01:07 AM, Devin Ceartas wrote: > hm. -rpath doesn't seem to be an accepted flag in the apxs included with > the latest OpenBSD > -- devin > > On Dec 7, 2009, at 6:56 PM, Joe Lewis wrote: > >> Devin Ceartas wrote: >>> The logic of my SQLite code works if I compile it as a stand-alone >>> executable. >>> >>> My mod_hello.c compiles and loads/works fine without the SQLite code >>> >>> Combining the two, the module compiles and is installed, but the >>> apache process dies immediately (core dump) every time it is loaded. >>> Stripping out all the SQLite code and simply linking against SQLite >>> causes this problem. In other words, with the same code: >>> >>> apxs -cia -L/usr/local/lib -I/home/devin mod_hello.c >>> /* Works Fine, prints "hello world" */ >>> >>> apxs -cia -L/usr/local/lib -I/home/devin -lsqlite3 mod_hello.c >>> /* compiles but dies on apache load */ >>> The platform is OpenBSD 4.6 with the platform's version of Apache 1.3 >>> and SQLite 3.6.20 downloaded from the SQLite site and compiled from >>> source >>> >>> Since I'm just getting started with C apache modules, I assume I'm >>> missing something basic. >> >> If using a Linux-based system, I'd suggest ensuring that ld.so.conf is >> setup to point to the directory or that the compile has the runtime >> path for the sqlite library. For example, I have added "-rpath >> /usr/local/lib -rpath /usr/local/lib/mysql" to my -L parameters for >> apxs to load mySQL external modules dynamically in the past. >> >> Linux-based systems also have an "strace" command that may be used to >> figure out what libraries are missing. >> >> -- >> Joe Lewis >> Chief Nerd SILVERHAWK <http://www.silverhawk.net/> (276)277-0925 >> >> ------------------------------------------------------------------------ >> /Rights that do not flow directly from duty well performed are not >> worth having. >> --Mohandas K. Gandhi/ > From modules-devthomasbishop@example.net Tue Dec 08 01:10:38 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 37853 invoked from network); 8 Dec 2009 01:10:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Dec 2009 01:10:38 -0000 Received: (qmail 70374 invoked by uid 500); 8 Dec 2009 01:10:38 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 70293 invoked by uid 500); 8 Dec 2009 01:10:36 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 70283 invoked by uid 99); 8 Dec 2009 01:10:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 01:10:36 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of thomasbishop@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-yx0-f189.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 01:10:34 +0000 Received: by yxe27 with SMTP id 27so4543594yxe.10 for <thomasbishop@example.net>; Mon, 07 Dec 2009 17:10:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=i5RT/Gg73eI5bgOPSekkpsMLDyllS4hNAk5YzXWbCQ8=; b=wbcS+bTNynt9YOq+6FWu0BeHwoJFtbQl5NSrjXr2ErxreBYvWVKZnUosQsrAhyUqzT QY76ncrbOfJthYL6N88PTCvgiHaJHrtXNJx7SRvSzaNrjUKCiVN9FTuhwQrRBmHDzaXf leroyI6P8a7x4K/RQeO7REoK7OaOiJp+cJBXg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=KoCXPyWRkNS7JN3zwS+krfNeipct8gkYOGMU3gw6j1gGa37Lvm2h7xtA/pRlpOlzX+ PHyJLWzna3YXCF/WjZEqnEPc94xK60fmd81vH+Hlw1by6f7B8zh5LU/kqTCwRLFhG4aG mP3h0jAeDoUdLCWGEbZzx+JlfZnFptNPfp6mw= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id s31mr12725472ybh.128.1260234613878; Mon, 07 Dec 2009 17:10:13 -0800 (PST) In-Reply-To: <thomasbishop@example.net> References: <thomasbishop@example.net> <thomasbishop@example.net> <thomasbishop@example.net> Date: Mon, 7 Dec 2009 20:10:13 -0500 Message-ID: <thomasbishop@example.net> Subject: Re: Linking in libraries to Apache Module From: Eric Covener <thomasbishop@example.net> To: thomasbishop@example.net Content-Type: text/plain; charset=ISO-8859-1 On Mon, Dec 7, 2009 at 7:07 PM, Devin Ceartas <thomasbishop@example.net> wrote: > hm. -rpath doesn't seem to be an accepted flag in the apxs included with the > latest OpenBSD apxs will pass linker or compiler args down to the respective program with -Wl, or -Wc, ; it doesn't do anything with them directly. -- Eric Covener thomasbishop@example.net From modules-devthomasbishop@example.net Tue Dec 08 01:40:55 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 50356 invoked from network); 8 Dec 2009 01:40:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Dec 2009 01:40:55 -0000 Received: (qmail 93377 invoked by uid 500); 8 Dec 2009 01:40:54 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 93305 invoked by uid 500); 8 Dec 2009 01:40:53 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 93295 invoked by uid 99); 8 Dec 2009 01:40:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 01:40:53 +0000 X-ASF-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO mail-yx0-f189.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 01:40:51 +0000 Received: by yxe27 with SMTP id 27so4563667yxe.10 for <thomasbishop@example.net>; Mon, 07 Dec 2009 17:40:30 -0800 (PST) Received: by 83.161.120.155 with SMTP id 38mr1131170agp.112.1260236430144; Mon, 07 Dec 2009 17:40:30 -0800 (PST) Received: from ?83.161.120.155? (NACREDATA.NET [83.161.120.155]) by mx.google.com with ESMTPS id 23sm2809620yxe.36.283.161.120.155.40.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Dec 2009 17:40:29 -0800 (PST) Message-Id: <thomasbishop@example.net> From: Devin Ceartas <thomasbishop@example.net> To: thomasbishop@example.net In-Reply-To: <thomasbishop@example.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Linking in libraries to Apache Module Date: Mon, 7 Dec 2009 20:40:26 -0500 References: <thomasbishop@example.net> <thomasbishop@example.net> <thomasbishop@example.net> <thomasbishop@example.net> X-Mailer: Apple Mail (2.936) I don't know enough to understand the output yet, but to me it seems to indicate that the library is not missing: # ldd /usr/lib/apache/modules/mod_hello2.so /usr/lib/apache/modules/mod_hello2.so: Start End Type Open Ref GrpRef Name 09384000 29388000 dlib 1 0 0 /usr/lib/apache/ modules/mod_hello2.so 09fe8000 29ff5000 rlib 0 1 0 /usr/local/lib/ libsqlite3.so.8.6 05d02000 25d0b000 rlib 0 1 0 /usr/lib/libpthread.so. 11.1 Thanks! -devin On Dec 7, 2009, at 8:00 PM, Dennis J. wrote: > Have you tried "ldd <path-to-compiled-module>"? That could also give > you a hint if anything is fishy with the library paths/dependencies. > > Regards, > Dennis > > On 12/08/2009 01:07 AM, Devin Ceartas wrote: >> hm. -rpath doesn't seem to be an accepted flag in the apxs included >> with >> the latest OpenBSD >> -- devin >> >> On Dec 7, 2009, at 6:56 PM, Joe Lewis wrote: >> >>> Devin Ceartas wrote: >>>> The logic of my SQLite code works if I compile it as a stand-alone >>>> executable. >>>> >>>> My mod_hello.c compiles and loads/works fine without the SQLite >>>> code >>>> >>>> Combining the two, the module compiles and is installed, but the >>>> apache process dies immediately (core dump) every time it is >>>> loaded. >>>> Stripping out all the SQLite code and simply linking against SQLite >>>> causes this problem. In other words, with the same code: >>>> >>>> apxs -cia -L/usr/local/lib -I/home/devin mod_hello.c >>>> /* Works Fine, prints "hello world" */ >>>> >>>> apxs -cia -L/usr/local/lib -I/home/devin -lsqlite3 mod_hello.c >>>> /* compiles but dies on apache load */ >>>> The platform is OpenBSD 4.6 with the platform's version of Apache >>>> 1.3 >>>> and SQLite 3.6.20 downloaded from the SQLite site and compiled from >>>> source >>>> >>>> Since I'm just getting started with C apache modules, I assume I'm >>>> missing something basic. >>> >>> If using a Linux-based system, I'd suggest ensuring that >>> ld.so.conf is >>> setup to point to the directory or that the compile has the runtime >>> path for the sqlite library. For example, I have added "-rpath >>> /usr/local/lib -rpath /usr/local/lib/mysql" to my -L parameters for >>> apxs to load mySQL external modules dynamically in the past. >>> >>> Linux-based systems also have an "strace" command that may be used >>> to >>> figure out what libraries are missing. >>> >>> -- >>> Joe Lewis >>> Chief Nerd SILVERHAWK <http://www.silverhawk.net/> (276)277-0925 >>> >>> ------------------------------------------------------------------------ >>> /Rights that do not flow directly from duty well performed are not >>> worth having. >>> --Mohandas K. Gandhi/ >> > From modules-devthomasbishop@example.net Tue Dec 08 02:25:38 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 75760 invoked from network); 8 Dec 2009 02:25:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Dec 2009 02:25:38 -0000 Received: (qmail 23366 invoked by uid 500); 8 Dec 2009 02:25:38 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 23302 invoked by uid 500); 8 Dec 2009 02:25:37 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 23288 invoked by uid 99); 8 Dec 2009 02:25:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 02:25:37 +0000 X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO gmp-eb-inf-2.sun.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 02:25:27 +0000 Received: from fe-emea-10.sun.com (gmp-eb-lb-1-fe1.eu.sun.com [83.161.120.155] (may be forged)) by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id nB82P6Su021312 for <thomasbishop@example.net>; Tue, 8 Dec 2009 02:25:07 GMT MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) id <thomasbishop@example.net> for thomasbishop@example.net; Tue, 08 Dec 2009 02:24:58 +0000 (GMT) Received: from [83.161.120.155] ([unknown] [83.161.120.155]) by fe-emea-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) with ESMTPSA id <thomasbishop@example.net> for thomasbishop@example.net; Tue, 08 Dec 2009 02:24:58 +0000 (GMT) Date: Tue, 08 Dec 2009 02:24:55 +0000 From: Nick Kew <thomasbishop@example.net> Subject: Re: Linking in libraries to Apache Module In-reply-to: <thomasbishop@example.net> Sender: thomasbishop@example.net To: thomasbishop@example.net Message-id: <thomasbishop@example.net> X-Mailer: Apple Mail (2.1077) References: <thomasbishop@example.net> X-Virus-Checked: Checked by ClamAV on apache.org On 7 Dec 2009, at 23:44, Devin Ceartas wrote: > apxs -cia -L/usr/local/lib -I/home/devin mod_hello.c > /* Works Fine, prints "hello world" */ > > apxs -cia -L/usr/local/lib -I/home/devin -lsqlite3 mod_hello.c > /* compiles but dies on apache load */ > The platform is OpenBSD 4.6 with the platform's version of Apache 1.3 and SQLite 3.6.20 downloaded from the SQLite site and compiled from source Don't link libsqlite. apr_dbd may already be loading libsqlite. If for instance you've got more than one libsqlite installed and the two load different versions, segfault is the expected outcome. If apache DBD API doesn't meet your needs, you can invoke sqlite directly, but use LoadFile so sysops can load libsqlite if and only if it's not already loaded. -- Nick Kew From modules-devthomasbishop@example.net Tue Dec 08 02:53:22 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 87091 invoked from network); 8 Dec 2009 02:53:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Dec 2009 02:53:22 -0000 Received: (qmail 38421 invoked by uid 500); 8 Dec 2009 02:53:21 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 38338 invoked by uid 500); 8 Dec 2009 02:53:20 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 38328 invoked by uid 99); 8 Dec 2009 02:53:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 02:53:20 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mail-gx0-f210.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 02:53:10 +0000 Received: by gxk2 with SMTP id 2so4486176gxk.4 for <thomasbishop@example.net>; Mon, 07 Dec 2009 18:52:47 -0800 (PST) Received: by 83.161.120.155 with SMTP id o5mr5642417ago.87.1260240767559; Mon, 07 Dec 2009 18:52:47 -0800 (PST) Received: from ?83.161.120.155? (NACREDATA.NET [83.161.120.155]) by mx.google.com with ESMTPS id 39sm2830862yxd.9.283.161.120.155.52.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Dec 2009 18:52:46 -0800 (PST) Message-Id: <thomasbishop@example.net> From: Devin Ceartas <thomasbishop@example.net> To: "thomasbishop@example.net" <thomasbishop@example.net> In-Reply-To: <thomasbishop@example.net> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7D11) Mime-Version: 1.0 (iPhone Mail 7D11) Subject: Re: Linking in libraries to Apache Module Date: Mon, 7 Dec 2009 21:52:40 -0500 References: <thomasbishop@example.net> <thomasbishop@example.net> X-Virus-Checked: Checked by ClamAV on apache.org OK, these ideas sound useful, thanks. I'll look into DBD and LoadFile. Thanks for your time. On Dec 7, 2009, at 9:24 PM, Nick Kew <thomasbishop@example.net> wrote: > > On 7 Dec 2009, at 23:44, Devin Ceartas wrote: > >> apxs -cia -L/usr/local/lib -I/home/devin mod_hello.c >> /* Works Fine, prints "hello world" */ >> >> apxs -cia -L/usr/local/lib -I/home/devin -lsqlite3 mod_hello.c >> /* compiles but dies on apache load */ >> The platform is OpenBSD 4.6 with the platform's version of Apache >> 1.3 and SQLite 3.6.20 downloaded from the SQLite site and compiled >> from source > > Don't link libsqlite. > > apr_dbd may already be loading libsqlite. If for instance you've > got more than one libsqlite installed and the two load different > versions, segfault is the expected outcome. > > If apache DBD API doesn't meet your needs, you can invoke > sqlite directly, but use LoadFile so sysops can load libsqlite if > and only if it's not already loaded. > > -- > Nick Kew From modules-devthomasbishop@example.net Tue Dec 08 04:00:12 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 63365 invoked from network); 8 Dec 2009 04:00:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Dec 2009 04:00:12 -0000 Received: (qmail 81343 invoked by uid 500); 8 Dec 2009 04:00:11 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 81258 invoked by uid 500); 8 Dec 2009 04:00:10 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 81246 invoked by uid 99); 8 Dec 2009 04:00:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 04:00:10 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO mail-gx0-f210.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 04:00:07 +0000 Received: by gxk2 with SMTP id 2so4524766gxk.4 for <thomasbishop@example.net>; Mon, 07 Dec 2009 19:59:44 -0800 (PST) Received: by 83.161.120.155 with SMTP id 21mr68757agw.59.1260244784031; Mon, 07 Dec 2009 19:59:44 -0800 (PST) Received: from ?83.161.120.155? (NACREDATA.NET [83.161.120.155]) by mx.google.com with ESMTPS id 39sm2853319yxd.9.283.161.120.155.59.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 07 Dec 2009 19:59:43 -0800 (PST) Message-Id: <thomasbishop@example.net> From: Devin Ceartas <thomasbishop@example.net> To: thomasbishop@example.net In-Reply-To: <thomasbishop@example.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Linking in libraries to Apache Module Date: Mon, 7 Dec 2009 22:59:41 -0500 References: <thomasbishop@example.net> <thomasbishop@example.net> X-Mailer: Apple Mail (2.936) So, for what it's worth, it ends up that it will work with either the direct linking as I was trying or with LoadFile The problem had to do with my downloading SQLite and compiling - when I deleted all those resulting files and installed the OpenBSD package for SQLite, it worked fine. So there must be some platform-specific compile tweaks needed for that library. -- devin On Dec 7, 2009, at 9:24 PM, Nick Kew wrote: > > On 7 Dec 2009, at 23:44, Devin Ceartas wrote: > >> apxs -cia -L/usr/local/lib -I/home/devin mod_hello.c >> /* Works Fine, prints "hello world" */ >> >> apxs -cia -L/usr/local/lib -I/home/devin -lsqlite3 mod_hello.c >> /* compiles but dies on apache load */ >> The platform is OpenBSD 4.6 with the platform's version of Apache >> 1.3 and SQLite 3.6.20 downloaded from the SQLite site and compiled >> from source > > Don't link libsqlite. > > apr_dbd may already be loading libsqlite. If for instance you've > got more than one libsqlite installed and the two load different > versions, segfault is the expected outcome. > > If apache DBD API doesn't meet your needs, you can invoke > sqlite directly, but use LoadFile so sysops can load libsqlite if > and only if it's not already loaded. > > -- > Nick Kew From modules-devthomasbishop@example.net Tue Dec 08 04:12:15 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 65692 invoked from network); 8 Dec 2009 04:12:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Dec 2009 04:12:15 -0000 Received: (qmail 87873 invoked by uid 500); 8 Dec 2009 04:12:14 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 87836 invoked by uid 500); 8 Dec 2009 04:12:13 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 87826 invoked by uid 99); 8 Dec 2009 04:12:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 04:12:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of thomasbishop@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO kuber.nabble.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 04:12:03 +0000 Received: from isper.nabble.com ([83.161.120.155]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from <thomasbishop@example.net>) id 1NHrQM-00009w-OX for thomasbishop@example.net; Mon, 07 Dec 2009 20:11:42 -0800 Message-ID: <thomasbishop@example.net> Date: Mon, 7 Dec 2009 20:11:42 -0800 (PST) From: partysoft <thomasbishop@example.net> To: thomasbishop@example.net Subject: Bandwith limit/per user from mysql MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: thomasbishop@example.net X-Virus-Checked: Checked by ClamAV on apache.org I am looking for a solution to limit the bandwith for the users of a site that have access to some mp3 / subscription. I don't want to serve files through PHP, but directly with some apache module.. do i have to count every bit? or how this should be handled. I have all the info on a mysql DB. Thank you so much for your replies. -- View this message in context: http://old.nabble.com/Bandwith-limit-per-user-from-mysql-tp26688437p26688437.html Sent from the Apache HTTP Server - Module Writers mailing list thomasbishop@example.net. From modules-devthomasbishop@example.net Tue Dec 08 04:29:17 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 71876 invoked from network); 8 Dec 2009 04:29:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Dec 2009 04:29:16 -0000 Received: (qmail 13918 invoked by uid 500); 8 Dec 2009 04:29:16 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 13831 invoked by uid 500); 8 Dec 2009 04:29:14 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 13821 invoked by uid 99); 8 Dec 2009 04:29:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 04:29:14 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of thomasbishop@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO ps536.phatservers.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 04:29:03 +0000 Received: from r74-192-24-94.bcstcmta01.clsttx.tl.dh.suddenlink.net ([83.161.120.155] helo=raydesk1.bettercgi.com) by ps536.phatservers.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.66) (envelope-from <thomasbishop@example.net>) id 1NHrgn-00089B-L7 for thomasbishop@example.net; Mon, 07 Dec 2009 20:28:41 -0800 Date: Mon, 07 Dec 2009 22:28:40 -0600 From: Ray Morris <thomasbishop@example.net> Subject: Re: Bandwith limit/per user from mysql To: thomasbishop@example.net References: <thomasbishop@example.net> In-Reply-To: <thomasbishop@example.net> (from thomasbishop@example.net on Mon Dec 7 22:11:42 2009) X-Mailer: Balsa 2.3.26 Message-Id: <thomasbishop@example.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org > do i have to count every bit? You have to count every bucket, and do it carefully because there are some pitfalls you run into when you implement it in the real world. Be aware that the major browsers have recently changed so they will by default use many connections. Download agents which behave strangely are also not uncommon and need to be handled gracefully. These things I learned implementing our commercial module for this purpose. -- Ray Morris thomasbishop@example.net Strongbox - The next generation in site security: http://www.bettercgi.com/strongbox/ Throttlebox - Intelligent Bandwidth Control http://www.bettercgi.com/throttlebox/ Strongbox / Throttlebox affiliate program: http://www.bettercgi.com/affiliates/user/register.php On 12/07/2009 10:11:42 PM, partysoft wrote: >=20 > I am looking for a solution to limit the bandwith for the users of a =20 > site > that have access to some mp3 / subscription. I don't want to serve =20 > files > through PHP, but directly with some apache module.. > do i have to count every bit? or how this should be handled. I have =20 > all the > info on a mysql DB. > Thank you so much for your replies. > -- > View this message in context: =20 > http://old.nabble.com/Bandwith-limit-per-user-from-mysql-tp26688437p26688= 437.html > Sent from the Apache HTTP Server - Module Writers mailing list =20 > thomasbishop@example.net. >=20 >=20 From modules-devthomasbishop@example.net Tue Dec 08 04:31:34 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 72480 invoked from network); 8 Dec 2009 04:31:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Dec 2009 04:31:34 -0000 Received: (qmail 18712 invoked by uid 500); 8 Dec 2009 04:31:34 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 18627 invoked by uid 500); 8 Dec 2009 04:31:32 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 18617 invoked by uid 99); 8 Dec 2009 04:31:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 04:31:32 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of thomasbishop@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO ps536.phatservers.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 04:31:29 +0000 Received: from r74-192-24-94.bcstcmta01.clsttx.tl.dh.suddenlink.net ([83.161.120.155] helo=raydesk1.bettercgi.com) by ps536.phatservers.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.66) (envelope-from <thomasbishop@example.net>) id 1NHrjA-0008Ab-4n for thomasbishop@example.net; Mon, 07 Dec 2009 20:31:08 -0800 Date: Mon, 07 Dec 2009 22:31:07 -0600 From: Ray Morris <thomasbishop@example.net> Subject: Re: Linking in libraries to Apache Module To: thomasbishop@example.net References: <thomasbishop@example.net> <thomasbishop@example.net> In-Reply-To: <thomasbishop@example.net> (from thomasbishop@example.net on Mon Dec 7 21:59:41 2009) X-Mailer: Balsa 2.3.26 Message-Id: <thomasbishop@example.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > So, for what it's worth, it ends up that it will work with either > the direct linking as I was trying or with LoadFile It will work FOR NOW, on that ONE SERVER, if you directly link a library. Loadfile will work now, and in the future, and on other servers, rather than causing incorrect results or crashes in the future. -- Ray Morris thomasbishop@example.net Strongbox - The next generation in site security: http://www.bettercgi.com/strongbox/ Throttlebox - Intelligent Bandwidth Control http://www.bettercgi.com/throttlebox/ Strongbox / Throttlebox affiliate program: http://www.bettercgi.com/affiliates/user/register.php On 12/07/2009 09:59:41 PM, Devin Ceartas wrote: > So, for what it's worth, it ends up that it will work with either the =20 > direct linking as I was trying or with LoadFile >=20 > The problem had to do with my downloading SQLite and compiling - when =20 > I deleted all those resulting files and installed the OpenBSD package =20 > for SQLite, it worked fine. So there must be some platform-specific =20 > compile tweaks needed for that library. >=20 > -- devin >=20 >=20 > On Dec 7, 2009, at 9:24 PM, Nick Kew wrote: >=20 >>=20 >> On 7 Dec 2009, at 23:44, Devin Ceartas wrote: >>=20 >>> apxs -cia -L/usr/local/lib -I/home/devin mod_hello.c >>> /* Works Fine, prints "hello world" */ >>>=20 >>> apxs -cia -L/usr/local/lib -I/home/devin -lsqlite3 mod_hello.c >>> /* compiles but dies on apache load */ >>> The platform is OpenBSD 4.6 with the platform's version of Apache =20 >>> 1.3 and SQLite 3.6.20 downloaded from the SQLite site and compiled =20 >>> from source >>=20 >> Don't link libsqlite. >>=20 >> apr_dbd may already be loading libsqlite. If for instance you've >> got more than one libsqlite installed and the two load different >> versions, segfault is the expected outcome. >>=20 >> If apache DBD API doesn't meet your needs, you can invoke >> sqlite directly, but use LoadFile so sysops can load libsqlite if >> and only if it's not already loaded. >>=20 >> --Nick Kew >=20 From modules-devthomasbishop@example.net Tue Dec 08 08:19:59 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 87241 invoked from network); 8 Dec 2009 08:19:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Dec 2009 08:19:59 -0000 Received: (qmail 98662 invoked by uid 500); 8 Dec 2009 08:19:59 -0000 Delivered-To: thomasbishop@example.net Received: (qmail 98603 invoked by uid 500); 8 Dec 2009 08:19:58 -0000 Mailing-List: contact thomasbishop@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:thomasbishop@example.net> List-Unsubscribe: <mailto:thomasbishop@example.net> List-Post: <mailto:thomasbishop@example.net> List-Id: <modules-dev.httpd.apache.org> Reply-To: thomasbishop@example.net Delivered-To: mailing list thomasbishop@example.net Received: (qmail 98593 invoked by uid 99); 8 Dec 2009 08:19:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 08:19:57 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of thomasbishop@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-fx0-f216.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 08:19:54 +0000 Received: by fxm8 with SMTP id 8so4286291fxm.27 for <thomasbishop@example.net>; Tue, 08 Dec 2009 00:19:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Mqu7uNi3dyNrRqec4fGbJwsaaUqvtqDzgbg2bLGVZVk=; b=md9WhV4pjR6hvYXRMBUVlLxLge6p6QvJbelsLAwf9zasGc2ncUJW1fZzvsNovfAAPz Qb/EqDl2Jy+hx5tQqngKlbFmbWMhHExC9M3NIPps8NHK4JgPiyKTUmbWUuRGTnnMe6x2 I+NgziDmc5IkRraJndGWAxrx9AS2eh3HqEJGQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=jum6wVVDiTeKnFp0/WnP8M0rRsqsGvi0K6ApYLbYEHvUFTzUBL5F+Wx31ZprXSTB+/ xjGl2jruEZjBc4wd8Xn2CwEbSRbPacH0oNtW6gP7LU3gU7vpAy+eh+SPwUGFEfnfTRXC 8l0djfOLpqqc25kHVFg44pJ5skrz/zy2XNF5c= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id u11mr663684muf.75.1260260372900; Tue, 08 Dec 2009 00:19:32 -0800 (PST) In-Reply-To: <thomasbishop@example.net> References: <thomasbishop@example.net> Date: Tue, 8 Dec 2009 09:19:32 +0100 Message-ID: <thomasbishop@example.net> Subject: Re: Bandwith limit/per user from mysql From: Sorin Manolache <thomasbishop@example.net> To: thomasbishop@example.net Content-Type: text/plain; charset=ISO-8859-1 On Tue, Dec 8, 2009 at 05:11, partysoft <thomasbishop@example.net> wrote: > > I am looking for a solution to limit the bandwith for the users of a site > that have access to some mp3 / subscription. I don't want to serve files > through PHP, but directly with some apache module.. > do i have to count every bit? or how this should be handled. I have all the > info on a mysql DB. > Thank you so much for your replies. This kind of functionality, in my opinion, is better implemented at transport level and not at application level. I've done something similar, but more primitive, i.e. the cumulated bandwidth of all connections to port 80 was capped, using traffic shaping in the linux kernel. The network packets are classified with iptables and then each class can be given a different queueing policy with tc. Check http://lartc.org/howto/, chapter 9. I didn't do it per user, but I suppose one can easily do it per client IP address. I admit that maybe this approach is not suitable when you identify users with some data token at application level. S From modules-devthomasbishop@example.net Tue Dec 08 12:27:18 2009 Return-Path: <modules-devthomasbishop@example.net> Delivered-To: thomasbishop@example.net Received: (qmail 79407 invoked from network); 8 Dec 2009 12:27:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 8 Dec 2009 12:27:18 -0000 Received: (qmail 66652 invoked by uid
{'source': 'Apache Software Foundation Public Mail Archives'}