Return-Path: X-Original-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3F40418BEB for ; Thu, 7 Jan 2016 06:16:07 +0000 (UTC) Received: (qmail 50952 invoked by uid 500); 7 Jan 2016 06:16:06 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 50907 invoked by uid 500); 7 Jan 2016 06:16:06 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 50896 invoked by uid 99); 7 Jan 2016 06:16:06 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jan 2016 06:16:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id E7F76180257 for ; Thu, 7 Jan 2016 06:16:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.363 X-Spam-Level: * X-Spam-Status: No, score=1.363 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RDNS_DYNAMIC=0.363] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id OkcIDqa2-5rG for ; Thu, 7 Jan 2016 06:16:05 +0000 (UTC) Received: from gungnir.webthing.com (209-20-83-52.slicehost.net [209.20.83.52]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id 8EEC620515 for ; Thu, 7 Jan 2016 06:16:04 +0000 (UTC) Received: from [192.168.0.127] (cpc36-newt30-2-0-cust898.19-3.cable.virginm.net [82.32.195.131]) by gungnir.webthing.com (Postfix) with ESMTPSA id 5C873E8C51 for ; Thu, 7 Jan 2016 06:16:03 +0000 (UTC) Message-ID: <1452147362.3892.41.camel@mimir.webthing.com> Subject: Re: dlopen a .so from a module From: Nick Kew To: modules-dev@httpd.apache.org Date: Thu, 07 Jan 2016 06:16:02 +0000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4-3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit On Wed, 2016-01-06 at 21:30 -0600, Mark Taylor wrote: > Hi all, > > I have a module that dlopens a .so, gets a handle to a function in the so > and calls it. The function in the so calls ap_rputs. dlopen returns the > error 'undefined symbol ap_rputs'. Looks like you're falling victim to http://svn.apache.org/viewvc?view=revision&revision=1131465 which also points to ap_rwrite as an obvious workaround. That would've caught me out, too! > nm tells me ap_rputs is defined in httpd, and via some dark magic, httpd > symbols are available to modules compiles the apxs -c. But when I compile > my .so to be loaded into my module, the symbols from httpd aren't > available. My hypothesis, now disproven, was that symbols available to my > module would be visible to my .so. Does your module use dlopen or apr_dso_load/family? Is your module loading/unloading anything per-request or per-connection? If not, why not use LoadFile in httpd.conf to load the .so? -- Nick Kew