[mp2] threaded applications inside of mod_perl

[prev] [thread] [next] [Date index for 2005/02/03]

From: bob-modperl
Subject: [mp2] threaded applications inside of mod_perl
Date: 03:15 on 03 Feb 2005
-------------8<---------- Start Bug Report ------------8<----------
1. Problem Description:

This program when run under :

=====================
#!/usr/bin/perl
use strict;
use threads;

my $thread = threads->create(sub { print "I am a thread"; },undef);

=====================

Causes a segfault

[Wed Feb 02 16:55:57 2005] [notice] child pid 15039 exit signal 
Segmentation
fault (11)

The "interoperation of threads.pm and threaded apps embedding perl" March 
1, 2003 email to the devel list by Stas Bekman was the closest I have been 
able to find directly regarding this issue.  I am wondering is this a 
known bug or is this something others can do and I should look at my 
configuration in greater detail.


2. Used Components and their Configuration:

*** mod_perl version 1.999021

*** using 
/usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi/Apache/BuildC
onfig.pm

*** Makefile.PL options:
    MP_APR_CONFIG  => /usr/bin/apr-config
    MP_APR_LIB     => aprext
    MP_APXS        => /usr/sbin/apxs
    MP_COMPAT_1X   => 1
    MP_GENERATE_XS => 1
    MP_LIBNAME     => mod_perl
    MP_USE_DSO     => 1


*** The httpd binary was not found
Server version: Apache/2.0.51
Server built:   Nov 12 2004 10:10:20
Server's Module Magic Number: 20020903:9
Architecture:   32-bit
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 HTTPD_ROOT="/etc/httpd"
   -D SUEXEC_BIN="/usr/sbin/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"


*** (apr|apu)-config linking info

   -lapr-0 -lrt -lm -lcrypt  -lpthread -ldl
   -laprutil-0 -lldap -llber -ldb-4.2 -lexpat



*** /usr/bin/perl -V
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
    Platform:
      osname=linux, osvers=2.4.22, archname=i386-linux-thread-multi
      uname='linux why.ak.technogeeks.com 2.4.22 #7 thu aug 26 02:44:38 pdt 
2004 i
686 athlon i386 gnulinux '
      config_args='-des -Doptimize=-O2 -g -march=i386 -mcpu=i686 
-Dversion=5.8.6 -
Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, 
Inc.
-Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux 
-Dvendorprefix=/usr -Ds
iteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles 
-Dd_dosui
d -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog 
-Dman3ext=3pm
-Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly 
-Dpager=/usr/bin/l
ess -isr -Dinc_version_list=5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0'
      hint=recommended, useposix=true, d_sigaction=define
      usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=de
fine
      useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
      use64bitint=undef use64bitall=undef uselongdouble=undef
      usemymalloc=n, bincompat5005=undef
    Compiler:
      cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING 
-fno-strict-alias
ing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-I/usr
/include/gdbm',
      optimize='-O2 -g -march=i386 -mcpu=i686',
      cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing 
-pipe
-I/usr/local/include -I/usr/include/gdbm'
      ccversion='', gccversion='3.3.3 20040412 (Red Hat Linux 3.3.3-7)', 
gccosandv
ers=''
      intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
      d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
      ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize
=8
      alignbytes=4, prototype=define
    Linker and Libraries:
      ld='gcc', ldflags =' -L/usr/local/lib'
      libpth=/usr/local/lib /lib /usr/lib
      libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
      perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
      libc=/lib/libc-2.3.3.so, so=so, useshrplib=true, libperl=libperl.so
      gnulibc_version='2.3.3'
    Dynamic Linking:
      dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E 
-Wl,-rpath,
/usr/lib/perl5/5.8.6/i386-linux-thread-multi/CORE'
      cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
    Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS 
USE_LARGE_FILES PERL
_IMPLICIT_CONTEXT
    Built under linux
    Compiled at Feb  2 2005 15:56:04
    %ENV:
      PERL_LWP_USE_HTTP_10="1"
    @INC:
      /usr/lib/perl5/5.8.6/i386-linux-thread-multi
      /usr/lib/perl5/5.8.6
      /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi
      /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
      /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi
      /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi
      /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi
      /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
      /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
      /usr/lib/perl5/site_perl/5.8.6
      /usr/lib/perl5/site_perl/5.8.5
      /usr/lib/perl5/site_perl/5.8.4
      /usr/lib/perl5/site_perl/5.8.3
      /usr/lib/perl5/site_perl/5.8.2
      /usr/lib/perl5/site_perl/5.8.1
      /usr/lib/perl5/site_perl/5.8.0
      /usr/lib/perl5/site_perl
      /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi
      /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
      /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi
      /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi
      /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi
      /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
      /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
      /usr/lib/perl5/vendor_perl/5.8.6
      /usr/lib/perl5/vendor_perl/5.8.5
      /usr/lib/perl5/vendor_perl/5.8.4
      /usr/lib/perl5/vendor_perl/5.8.3
      /usr/lib/perl5/vendor_perl/5.8.2
      /usr/lib/perl5/vendor_perl/5.8.1
      /usr/lib/perl5/vendor_perl/5.8.0
      /usr/lib/perl5/vendor_perl
      .

*** Packages of interest status:

Apache::Request: -
CGI            : 3.05
LWP            : 5.79
mod_perl       : 1.999021, 1.999021


3. This is the core dump trace: (if you get a core dump):

    [CORE TRACE COMES HERE]

This report was generated by /usr/bin/mp2bug on Thu Feb  3 02:55:12 2005 
GMT.

-------------8<---------- End Bug Report --------------8<----------

Note: Complete the rest of the details and post this bug report to
modperl <at> perl.apache.org. To subscribe to the list send an empty
email to modperl-subscribe@xxxx.xxxxxx.xxx.

(message missing)

[mp2] threaded applications inside of mod_perl
bob-modperl 03:15 on 03 Feb 2005

Generated at 11:21 on 20 Feb 2005 by mariachi v0.52