Loading ...
Sorry, an error occurred while loading the content.
 

[mp1] Apache::AuthDBI segfaults under Fedora Core 1?

Expand Messages
  • John Callender
    In moving some web sites from a server running Red Hat Linux release 7.3 (Valhalla) to one running Fedora Core release 1 (Yarrow), I m finding that attempts to
    Message 1 of 4 , Apr 4, 2005
      In moving some web sites from a server running Red Hat Linux release
      7.3 (Valhalla) to one running Fedora Core release 1 (Yarrow), I'm
      finding that attempts to authenticate under mod_perl using
      Apache::AuthDBI, which were working normally on the RH 7.3 server, are
      producing segfaults on the FC1 server. I've searched the Web and the
      list archives to try to find other reports of a similar problem, but
      have come up empty so far. I'd appreciate any suggestions on what I
      might try to get Apache::AuthDBI working under FC1. Thanks.

      Software versions on the FC1 server:

      kernel: Linux 2.4.22-1.2199.nptlsmp
      Perl: 5.8.3
      DBI: 1.37
      Apache: 1.3.33
      mod_perl: 1.29
      Apache::AuthDBI: 0.93

      httpd.conf contains the following:

      PerlModule Apache::AuthDBI

      .htaccess contains the following:

      AuthName "Member Services"
      AuthType Basic

      PerlAuthenHandler Apache::AuthDBI::authen
      PerlAuthzHandler Apache::AuthDBI::authz

      PerlSetVar Auth_DBI_data_source [dsn deleted]
      PerlSetVar Auth_DBI_username [username deleted]
      PerlSetVar Auth_DBI_password [password deleted]
      PerlSetVar Auth_DBI_encrypted off

      PerlSetVar Auth_DBI_pwd_table members_data
      PerlSetVar Auth_DBI_uid_field unamo
      PerlSetVar Auth_DBI_pwd_field pass

      require valid-user

      When I set $Apache::AuthDBI::DEBUG = 2, I get lots of output from
      Apache::AuthDBI::authen() in the virtual host's error log; it seems to
      indicate that the authen() handler is completing normally, with either
      a successful or a failed username/password lookup (depending on whether
      I give valid or invalid credentials). Here's some sample output from
      that virtualhost error log, for example:

      4858 Apache::AuthDBI::authen passwd not found in cache
      4858 Apache::AuthDBI::authen statement: SELECT pass FROM members_data
      WHERE unamo = '[username deleted]'
      4858 Apache::AuthDBI::authen passwd = >[password deleted]<
      4858 Apache::AuthDBI::authen user [username deleted]: password match
      for >[password deleted]<
      4858 Apache::AuthDBI::authen return OK

      At that point, regardless of whether the login credentials were valid
      or not, the browser reports a "Bad Server Response" error, and the
      apache error log records:

      [Mon Apr 4 14:03:49 2005] [notice] child pid 4858 exit signal
      Segmentation fault (11)

      I tried recompiling mod_perl with PERL_DEBUG=1 and reproducing the
      problem under gdb to get a backtrace; here's the result of that:

      (gdb) run -X -f `pwd`/t/conf/httpd.conf.test -d `pwd`/t
      Starting program: /home/w1/src/apache_1.3.33/src/httpd -X -f
      `pwd`/t/conf/httpd.conf.test -d `pwd`/t
      [Thread debugging using libthread_db enabled]
      [New Thread -1084376928 (LWP 30800)]

      Program received signal SIGSEGV, Segmentation fault.
      [Switching to Thread -1084376928 (LWP 30800)]
      0x00624082 in _int_free () from /lib/tls/libc.so.6
      (gdb) bt
      #0 0x00624082 in _int_free () from /lib/tls/libc.so.6
      #1 0x0062301b in free () from /lib/tls/libc.so.6
      #2 0x004f37a5 in Perl_safesysfree (where=0x95bc640) at util.c:140
      #3 0x0051ab6c in Perl_sv_clear (my_perl=0x92516a8, sv=0x95bc278) at
      sv.c:5210
      #4 0x0051b0fb in Perl_sv_free (my_perl=0x92516a8, sv=0x95bc278) at
      sv.c:5355
      #5 0x004fa032 in Perl_mg_free (my_perl=0x92516a8, sv=0x95bb7c8) at
      mg.c:388
      #6 0x0051ad32 in Perl_sv_clear (my_perl=0x92516a8, sv=0x95bb7c8) at
      sv.c:5144
      #7 0x0051b0fb in Perl_sv_free (my_perl=0x92516a8, sv=0x95bb7c8) at
      sv.c:5355
      #8 0x0051a923 in Perl_sv_clear (my_perl=0x92516a8, sv=0x95bc260) at
      sv.c:5207
      #9 0x0051b0fb in Perl_sv_free (my_perl=0x92516a8, sv=0x95bc260) at
      sv.c:5355
      #10 0x004fa032 in Perl_mg_free (my_perl=0x92516a8, sv=0x95bb4a4) at
      mg.c:388
      #11 0x0051ad32 in Perl_sv_clear (my_perl=0x92516a8, sv=0x95bb4a4) at
      sv.c:5144
      #12 0x0051b0fb in Perl_sv_free (my_perl=0x92516a8, sv=0x95bb4a4) at
      sv.c:5355
      #13 0x00520202 in Perl_sv_unref_flags (my_perl=0x92516a8, sv=0x944a330,
      flags=1) at sv.c:7937
      #14 0x00518ea3 in Perl_sv_force_normal_flags (my_perl=0x92516a8,
      sv=0x944a330,
      flags=1) at sv.c:4271
      #15 0x0053a0ac in Perl_leave_scope (my_perl=0x92516a8, base=16) at
      scope.c:912
      #16 0x005381bc in Perl_pop_scope (my_perl=0x95bc638) at scope.c:138
      #17 0x00540ea7 in Perl_pp_return (my_perl=0x92516a8) at pp_ctl.c:1882
      #18 0x004f2ead in Perl_runops_debug (my_perl=0x92516a8) at dump.c:1438
      #19 0x004a29b9 in S_call_body (my_perl=0x92516a8, myop=0xbfefc1e0,
      is_eval=0)
      at perl.c:2222
      #20 0x004a2685 in Perl_call_sv (my_perl=0x92516a8, sv=0x0, flags=4)
      at perl.c:2140
      #21 0x0817416e in perl_call_handler (sv=0x9509944, r=0x9567f7c,
      args=0x0)
      at mod_perl.c:1668
      #22 0x08173403 in perl_run_stacked_handlers (hook=0x9509944
      "\030ÉD\t\001",
      r=0x9567f7c, handlers=0x95098fc) at mod_perl.c:1381
      #23 0x08171faa in perl_authenticate (r=0x9567f7c) at mod_perl.c:1033
      #24 0x081b61f5 in run_method ()
      #25 0x081b632a in ap_check_user_id ()
      #26 0x081cb82a in process_request_internal ()
      #27 0x081cbaf2 in ap_process_request ()
      #28 0x081c2b9b in child_main ()
      #29 0x081c2d61 in make_child ()
      #30 0x081c2ec7 in startup_children ()
      #31 0x081c357e in standalone_main ()
      #32 0x081c3db6 in main ()

      Additional information that may be helpful:

      perl -V output:

      # perl -V
      Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration:
      Platform:
      osname=linux, osvers=2.4.21-9.elsmp,
      archname=i386-linux-thread-multi
      uname='linux bugs.devel.redhat.com 2.4.21-9.elsmp #1 smp thu jan 8
      17:08:56 est 2004 i686 i686 i386 gnulinux '
      config_args='-des -Doptimize=-O2 -g -pipe -march=i386 -mcpu=i686
      -Dversion=5.8.3 -Dmyhostname=localhost -Dperladmin=root@localhost
      -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr
      -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr
      -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid
      -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog
      -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005
      -Uversiononly -Dpager=/usr/bin/less -isr -Dinc_version_list=5.8.2 5.8.1
      5.8.0'
      hint=recommended, useposix=true, d_sigaction=define
      usethreads=define use5005threads=undef useithreads=define
      usemultiplicity=define
      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 -DTHREADS_HAVE_PIDS
      -DDEBUGGING -fno-strict-aliasing -I/usr/local/include
      -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
      optimize='-O2 -g -pipe -march=i386 -mcpu=i686',
      cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
      -DDEBUGGING -fno-strict-aliasing -I/usr/local/include
      -I/usr/include/gdbm'
      ccversion='', gccversion='3.3.2 20031218 (Red Hat Linux 3.3.2-5)',
      gccosandvers=''
      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.2.so, so=so, useshrplib=true, libperl=libperl.so
      gnulibc_version='2.3.2'
      Dynamic Linking:
      dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic
      -Wl,-rpath,/usr/lib/perl5/5.8.3/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 Mar 23 2004 20:56:34
      @INC:
      /usr/lib/perl5/5.8.3/i386-linux-thread-multi
      /usr/lib/perl5/5.8.3
      /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.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.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.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
      .

      Options given to Makefile.PL when compiling mod_perl:

      perl Makefile.PL APACHE_SRC=../apache_1.3.33/src DO_HTTPD=1 USE_APACI=1
      PREP_HTTPD=1 EVERYTHING=1

      (and subsequently, in anticipation of running gdb:)

      perl Makefile.PL APACHE_SRC=../apache_1.3.33/src DO_HTTPD=1 USE_APACI=1
      PREP_HTTPD=1 EVERYTHING=1 PERL_DEBUG=1

      In each case of compiling mod_perl, all tests were successful.

      As I said, any suggestions on how I might fix this, such that I can use
      Apache::AuthDBI to authenticate on the Fedora Core 1 server, would be
      appreciated. Thanks.

      John Callender
      jbc@...
    • Stas Bekman
      ... [...] ... [...] ... [...] ... I d suggest to cleanup your perl s lib tree first, nuking all paths with 5.8.2, 5.8.1 and 5.8.0 in it. May be you get some
      Message 2 of 4 , Apr 4, 2005
        John Callender wrote:
        > In moving some web sites from a server running Red Hat Linux release 7.3
        > (Valhalla) to one running Fedora Core release 1 (Yarrow), I'm finding
        > that attempts to authenticate under mod_perl using Apache::AuthDBI,
        > which were working normally on the RH 7.3 server, are producing
        > segfaults on the FC1 server. I've searched the Web and the list archives
        > to try to find other reports of a similar problem, but have come up
        > empty so far. I'd appreciate any suggestions on what I might try to get
        > Apache::AuthDBI working under FC1. Thanks.
        >
        > Software versions on the FC1 server:
        >
        > kernel: Linux 2.4.22-1.2199.nptlsmp
        > Perl: 5.8.3
        > DBI: 1.37
        > Apache: 1.3.33
        > mod_perl: 1.29
        > Apache::AuthDBI: 0.93
        >
        > httpd.conf contains the following:
        >
        > PerlModule Apache::AuthDBI
        [...]
        > #0 0x00624082 in _int_free () from /lib/tls/libc.so.6
        > #1 0x0062301b in free () from /lib/tls/libc.so.6
        > #2 0x004f37a5 in Perl_safesysfree (where=0x95bc640) at util.c:140
        > #3 0x0051ab6c in Perl_sv_clear (my_perl=0x92516a8, sv=0x95bc278) at
        > sv.c:5210
        > #4 0x0051b0fb in Perl_sv_free (my_perl=0x92516a8, sv=0x95bc278) at
        > sv.c:5355
        > #5 0x004fa032 in Perl_mg_free (my_perl=0x92516a8, sv=0x95bb7c8) at
        > mg.c:388
        > #6 0x0051ad32 in Perl_sv_clear (my_perl=0x92516a8, sv=0x95bb7c8) at
        > sv.c:5144
        > #7 0x0051b0fb in Perl_sv_free (my_perl=0x92516a8, sv=0x95bb7c8) at
        > sv.c:5355
        > #8 0x0051a923 in Perl_sv_clear (my_perl=0x92516a8, sv=0x95bc260) at
        > sv.c:5207
        > #9 0x0051b0fb in Perl_sv_free (my_perl=0x92516a8, sv=0x95bc260) at
        > sv.c:5355
        > #10 0x004fa032 in Perl_mg_free (my_perl=0x92516a8, sv=0x95bb4a4) at
        > mg.c:388
        > #11 0x0051ad32 in Perl_sv_clear (my_perl=0x92516a8, sv=0x95bb4a4) at
        > sv.c:5144
        > #12 0x0051b0fb in Perl_sv_free (my_perl=0x92516a8, sv=0x95bb4a4) at
        > sv.c:5355
        > #13 0x00520202 in Perl_sv_unref_flags (my_perl=0x92516a8, sv=0x944a330,
        > flags=1) at sv.c:7937
        > #14 0x00518ea3 in Perl_sv_force_normal_flags (my_perl=0x92516a8,
        > sv=0x944a330,
        > flags=1) at sv.c:4271
        > #15 0x0053a0ac in Perl_leave_scope (my_perl=0x92516a8, base=16) at
        > scope.c:912
        > #16 0x005381bc in Perl_pop_scope (my_perl=0x95bc638) at scope.c:138
        > #17 0x00540ea7 in Perl_pp_return (my_perl=0x92516a8) at pp_ctl.c:1882
        > #18 0x004f2ead in Perl_runops_debug (my_perl=0x92516a8) at dump.c:1438
        > #19 0x004a29b9 in S_call_body (my_perl=0x92516a8, myop=0xbfefc1e0,
        > is_eval=0)
        > at perl.c:2222
        > #20 0x004a2685 in Perl_call_sv (my_perl=0x92516a8, sv=0x0, flags=4)
        > at perl.c:2140
        > #21 0x0817416e in perl_call_handler (sv=0x9509944, r=0x9567f7c, args=0x0)
        [...]
        > usethreads=define use5005threads=undef useithreads=define
        [...]
        > /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.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.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

        I'd suggest to cleanup your perl's lib tree first, nuking all paths with
        5.8.2, 5.8.1 and 5.8.0 in it. May be you get some binary incompatible
        module loaded which causes the crush.

        Your perl is thread-enabled, do you by chance spawn perl threads anywhere?
        Did you try building perl with -Uusethreads?


        --
        __________________________________________________________________
        Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
        http://stason.org/ mod_perl Guide ---> http://perl.apache.org
        mailto:stas@... http://use.perl.org http://apacheweek.com
        http://modperlbook.org http://apache.org http://ticketmaster.com
      • John Callender
        ... That appears to have solved my problem. I needed to install DBI and DBD::mysql from source after removing the 5.8.0, 5.8.1, and 5.8.2 paths from the perl
        Message 3 of 4 , Apr 5, 2005
          On Apr 4, 2005, at 7:56 PM, Stas Bekman wrote:

          > John Callender wrote:
          >> In moving some web sites from a server running Red Hat Linux release
          >> 7.3 (Valhalla) to one running Fedora Core release 1 (Yarrow), I'm
          >> finding that attempts to authenticate under mod_perl using
          >> Apache::AuthDBI, which were working normally on the RH 7.3 server,
          >> are producing segfaults on the FC1 server.

          > I'd suggest to cleanup your perl's lib tree first, nuking all paths
          > with 5.8.2, 5.8.1 and 5.8.0 in it. May be you get some binary
          > incompatible module loaded which causes the crush.

          That appears to have solved my problem. I needed to install DBI and
          DBD::mysql from source after removing the 5.8.0, 5.8.1, and 5.8.2 paths
          from the perl lib tree, because the FC1 distribution apparently came
          with those installed under 5.8.0. But having done that, Apache::AuthDBI
          is authenticating properly, with no segfaults.

          Thank you very much for your help.

          > Your perl is thread-enabled, do you by chance spawn perl threads
          > anywhere? Did you try building perl with -Uusethreads?

          As far as I'm aware, we're not using threads anywhere on the server. I
          haven't tried building perl with -Uusethreads, no.

          Thanks again.

          John Callender
          jbc@...
        • Stas Bekman
          ... Excellent :) ... If you don t use threads and you build your own perl, you should build it with threads disabled. You will get a faster and smaller perl.
          Message 4 of 4 , Apr 5, 2005
            John Callender wrote:
            > On Apr 4, 2005, at 7:56 PM, Stas Bekman wrote:
            >
            >> John Callender wrote:
            >>
            >>> In moving some web sites from a server running Red Hat Linux release
            >>> 7.3 (Valhalla) to one running Fedora Core release 1 (Yarrow), I'm
            >>> finding that attempts to authenticate under mod_perl using
            >>> Apache::AuthDBI, which were working normally on the RH 7.3 server,
            >>> are producing segfaults on the FC1 server.
            >
            >
            >> I'd suggest to cleanup your perl's lib tree first, nuking all paths
            >> with 5.8.2, 5.8.1 and 5.8.0 in it. May be you get some binary
            >> incompatible module loaded which causes the crush.
            >
            >
            > That appears to have solved my problem. I needed to install DBI and
            > DBD::mysql from source after removing the 5.8.0, 5.8.1, and 5.8.2 paths
            > from the perl lib tree, because the FC1 distribution apparently came
            > with those installed under 5.8.0. But having done that, Apache::AuthDBI
            > is authenticating properly, with no segfaults.

            Excellent :)

            > Thank you very much for your help.
            >
            >> Your perl is thread-enabled, do you by chance spawn perl threads
            >> anywhere? Did you try building perl with -Uusethreads?
            >
            >
            > As far as I'm aware, we're not using threads anywhere on the server. I
            > haven't tried building perl with -Uusethreads, no.

            If you don't use threads and you build your own perl, you should build it
            with threads disabled. You will get a faster and smaller perl.


            --
            __________________________________________________________________
            Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
            http://stason.org/ mod_perl Guide ---> http://perl.apache.org
            mailto:stas@... http://use.perl.org http://apacheweek.com
            http://modperlbook.org http://apache.org http://ticketmaster.com
          Your message has been successfully submitted and would be delivered to recipients shortly.