jvandal / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

rtld: 0712-001 symbol was not found: ap_cleanup_scoreboard ap_accept_lock_mech #212

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.download Apache/2.2.17 (Unix),install to '/si/usr/me/sys/apache',and then 
run 'bin/apachectl start', it words.
2.download mod_wsgi-3.3, run gzip -d and tar xvf, configure/make/make install, 
yes, everything is fine.
3.append 'LoadModule wsgi_module  lib/mod_wsgi.so' to 'conf/httpd.conf', and 
then run 'bin/httpd -t', i got error msg follow:

httpd: Syntax error on line 414 of /si/usr/me/sys/apache2/conf/httpd.conf: 
      Cannot load /si/usr/me/sys/apache2/modules/mod_wsgi.so into server:
rtld: 0712-001 Symbol ap_cleanup_scoreboard was referenced
      from module /si/usr/me/sys/apache2/modules/mod_wsgi.so(), but a runtime definition
        of the symbol was not found.
rtld: 0712-001 Symbol ap_accept_lock_mech was referenced
      from module /si/usr/me/sys/apache2/modules/mod_wsgi.so(), but a runtime definition
        of the symbol was not found.

there are many mod_xxx.so in 'modules/', all of them works well, why 
mod_wsgi.so not work?
i had google this for two days, but it seens that i can fix my problems, can 
somebody help me?

aix 5.3.0.0 + gcc 4.2.0

Please use labels and text to provide additional information, thanks!

Original issue reported on code.google.com by tanchu...@gmail.com on 26 Oct 2010 at 8:32

GoogleCodeExporter commented 8 years ago
Please repost to the mod_wgsi mailing list for discussion and debugging. There 
is no known issues with using Apache 2.2.17 with mod_wsgi 3.3. Those two 
symbols should exist as they are still part of the source code in Apache 
2.2.17. The ap_accept_lock_mech variable is removed in Apache 2.3, but mod_wsgi 
3.3 already handles that and uses an alternate mechanism to get the information 
it needs but that is totally irrelevant to Apache 2.2.17.

When you post to the mod_wsgi mailing list, provide information about your 
Apache installation as described in:

http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Apache_Build_Info
rmation
http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Apache_Modules_Lo
aded
http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Global_Accept_Mut
ex

Original comment by Graham.Dumpleton@gmail.com on 26 Oct 2010 at 9:56

GoogleCodeExporter commented 8 years ago
Dear modwsgi Team,

I am also facing this issue and I am updating to comment with additional 
information.

I am willing to try out code changes on my machine and rebuilding and retesting 
if someone could send me the changes source files.

I hope you could help me with a mod_wsgi load error upon startup of apache. 
This is affecting one of our site Go Live and I would appreciate any help 
offered in this regard. 

The error upon startup of Apache is as follows

root [zibal]% ./usr/local/apache2/bin/apachectl restart
httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf: Cannot 
load /usr/local/apache2/modules/mod_wsgi.so into server: rtld: 0712-001 Symbol 

ap_cleanup_scoreboard was referenced\n      from module 
/usr/local/apache2/modules/mod_wsgi.so(), but a runtime definition\n      of 
the symbol was not found.\nrtld: 0712-001 Symbol ap_accept_lock_mech was 
referenced\n      from module /usr/local/apache2/modules/mod_wsgi.so(), but a 
runtime definition\n of the symbol was not found.

I built Apaxhe 2.2.17 and Mod_Wsgi 3.3 using the source and the compiler was 
gcc-4.2.

Here are the AIX Server Details

Here is the Apache Build Information
=====================================

root [zibal]% ./usr/local/apache2/bin/httpd -V
Server version: Apache/2.2.17 (Unix)
Server built:   Nov 18 2010 05:04:25
Server's Module Magic Number: 20051115:25
Server loaded:  APR 1.4.2, APR-Util 1.3.10
Compiled using: APR 1.4.2, APR-Util 1.3.10
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/usr/local/apache2"
 -D SUEXEC_BIN="/usr/local/apache2/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

Contents of config.nice file are as follows

++++++++++++++++++++++++
#! /bin/sh
#
# Created by configure

CC="gcc"; export CC
"./configure" \
"CC=gcc" \
"$@"
++++++++++++++++++++++++

Information about Apache Modules Loaded
=======================================

root [zibal]% ./usr/local/apache2/bin/httpd -l
Compiled in modules:
  core.c
  mod_authn_file.c
  mod_authn_default.c
  mod_authz_host.c
  mod_authz_groupfile.c
  mod_authz_user.c
  mod_authz_default.c
  mod_auth_basic.c
  mod_include.c
  mod_filter.c
  mod_log_config.c
  mod_env.c
  mod_setenvif.c
  mod_version.c
  prefork.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_asis.c
  mod_cgi.c
  mod_negotiation.c
  mod_dir.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_so.c

In httpd.conf, i only have the following LoadModule Statement
=============================================================
LoadModule wsgi_module modules/mod_wsgi.so

Information about Global Accept Mutex
=====================================
Valid accept mutexes for this platform and MPM are: default, fcntl, sysvsem, 
posixsem, pthread.

Please let me know if I should provide some additional information.

Appreciate your help on this.

Regards,
Guddu

Original comment by anurag.c...@gmail.com on 19 Nov 2010 at 11:58

GoogleCodeExporter commented 8 years ago
in fact, i can't fix the problem, i gave up the apache + mod_wsgi, and now i
am using nginx + flup, it works well in my aix server.

Original comment by tanchu...@gmail.com on 20 Nov 2010 at 9:05

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Thanks to Graham and Jeff Trawick 

Below are the two solution that I have tested and both work fine. 

Apache starts fine now and is able to load mod_wsgi. 

There is still a problem in start of Django app but I will chase it as 
a separate thread. 

Solution 1 (Thanks to Graham Dumpleton) 
======================================= 

Don't change anything in Apache Code. 

Go into mod_wsgi.c source code and change: 
       /* 
        * Cleanup the Apache scoreboard to ensure that any 
        * shared memory segments or memory mapped files not 
        * available to code in daemon processes. 
        */ 
       ap_cleanup_scoreboard(0); 

to 

#if 0 
       /* 
        * Cleanup the Apache scoreboard to ensure that any 
        * shared memory segments or memory mapped files not 
        * available to code in daemon processes. 
        */ 
       ap_cleanup_scoreboard(0); 
#endif 

and then look for: 

#if !defined(AP_ACCEPT_MUTEX_TYPE) 
   sconfig->lock_mechanism = ap_accept_lock_mech; 
#else 
   sconfig->lock_mechanism = APR_LOCK_DEFAULT; 
#endif 

and change it to: 

#define AP_ACCEPT_MUTEX_TYPE 1 
#if !defined(AP_ACCEPT_MUTEX_TYPE) 
   sconfig->lock_mechanism = ap_accept_lock_mech; 
#else 
   sconfig->lock_mechanism = APR_LOCK_DEFAULT; 
#endif 

Then build mod_wsgi 

Solution 2 (Thanks to Jeff Trawick from Apache) 
=================================== 

Extract the Source tar ball in a directory.....cd into that directory 

Locate the file include/mpm_common.h 

Change 

        extern apr_lockmech_e ap_accept_lock_mech; 

to 

        AP_DECLARE_DATA extern apr_lockmech_e ap_accept_lock_mech; 

Locate the file include/scoreboard.h 

Change 

        apr_status_t ap_cleanup_scoreboard(void *d); 

to 

        AP_DECLARE(apr_status_t) ap_cleanup_scoreboard(void *d); 

And then issue the following commands 
        ./configure 
        make 

After this step, there will be a httpd.exp file create in the server 
directory and a httpd file created in the present directory 

remove httpd 

edit server/httpd.exp and add one line for ap_accept_lock_mech 

        make 
        make install (as root) 

Then build mod_wsgi 3.3 from Source Tarball 

Regards, 
Anurag 

Original comment by anurag.c...@gmail.com on 23 Nov 2010 at 7:55

GoogleCodeExporter commented 8 years ago
Closing as this is believed to have all been address in subsequent releases.

Original comment by Graham.Dumpleton@gmail.com on 16 Sep 2014 at 7:44