in reply to Re: cgi thread creation segfault
in thread cgi thread creation segfault

I'm using MPM worker (not prefork)... These are my apache settings:

Server version: Apache/2.2.17 (Ubuntu) Server built: Nov 3 2011 02:13:18 Server's Module Magic Number: 20051115:25 Server loaded: APR 1.4.2, APR-Util 1.3.9 Compiled using: APR 1.4.2, APR-Util 1.3.9 Architecture: 32-bit Server MPM: Worker threaded: yes (fixed thread count) forked: yes (variable process count) Server compiled with.... -D APACHE_MPM_DIR="server/mpm/worker" -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="/etc/apache2" -D SUEXEC_BIN="/usr/lib/apache2/suexec" -D DEFAULT_PIDLOG="/var/run/apache2.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="mime.types" -D SERVER_CONFIG_FILE="apache2.conf"
As you can see i'm not using prefork MPM and that's why I thought apache could create threads while executing my perl script... Is my reasoning wrong? Maybe I'm missing some parameter or I misconfigured some IfModule statement.

Replies are listed 'Best First'.
Re^3: cgi thread creation segfault
by Eliya (Vicar) on Dec 28, 2011 at 14:19 UTC
    I thought apache could create threads while executing my perl script...

    The worker model uses threads for handling multiple requests.  From the docs:

    "A single control process (the parent) is responsible for launching child processes. Each child process creates a fixed number of server threads as specified in the ThreadsPerChild directive, as well as a listener thread which listens for connections and passes them to a server thread for processing when they arrive."

    This is not the same as creating threads "while executing" the Perl script. The situation you have is that one of the worker threads - with Perl being an integral part of them - is again trying to create further threads.  I'm not too familiar with the implementation details of the worker module to tell if that's supposed to work or not... (Practice shows, it doesn't :)