It seems that Devel::Dprof and diagnostics can't live together. I wanted
to profile the code that uses diagnostics from within mod_perl, but it
segfaults with no core dumped and no error messages, so here is the gdb
trace. The code runs Ok from the command line and produce the right dump
file used by dprofpp.

Oh, when I run it without -X I get this in the error_log:
Argument "diagnostics::unescape" isn't numeric in entersub at
/usr/lib/perl5/5.00503/diagnostics.pm line 290, <POD_DIAG> chunk 2688.

Consider this code:

  use diagnostics;
  print "Content-type: text/html\n\n";
  print "Ok";

Now:

% setenv PERL5OPT -d:DProf
% gdb /usr/local/apache/bin/httpd 
(gdb) set args -X
(gdb) run
Starting program: /usr/local/apache/bin/httpd -X

Now issuing the request to the above code:
Program received signal SIGSEGV, Segmentation fault.
0x400cd4af in _IO_fflush (fp=0x816fb78) at iofflush.c:41
41      iofflush.c: No such file or directory.
(gdb) where
#0  0x400cd4af in _IO_fflush (fp=0x81727e0) at iofflush.c:41
#1  0x400150fb in prof_dump_until ()
   from
/usr/lib/perl5/site_perl/5.005/i386-linux/auto/Devel/DProf/DProf.so
#2  0x4001549c in prof_mark ()
   from
/usr/lib/perl5/site_perl/5.005/i386-linux/auto/Devel/DProf/DProf.so
#3  0x400159d9 in XS_DB_sub ()
   from
/usr/lib/perl5/site_perl/5.005/i386-linux/auto/Devel/DProf/DProf.so
#4  0x80ee5b6 in Perl_pp_entersub ()
#5  0x811855d in Perl_runops_standard ()
#6  0x81069b1 in Perl_pp_exit ()
#7  0x8107982 in Perl_pp_require ()
#8  0x811855d in Perl_runops_standard ()
#9  0x80c09a1 in perl_call_sv ()
#10 0x400159cf in XS_DB_sub ()
   from
/usr/lib/perl5/site_perl/5.005/i386-linux/auto/Devel/DProf/DProf.so
#11 0x80ee5b6 in Perl_pp_entersub ()
#12 0x80c098c in perl_call_sv ()
#13 0x80c2ce9 in Perl_call_list ()
#14 0x80db80f in Perl_newSUB ()
#15 0x80d9340 in Perl_utilize ()
#16 0x80d5014 in Perl_yyparse ()
#17 0x8106f06 in Perl_sv_compile_2op ()
#18 0x8107c75 in Perl_pp_entereval ()
#19 0x811855d in Perl_runops_standard ()
#20 0x80c09a1 in perl_call_sv ()
#21 0x400159cf in XS_DB_sub ()
   from
/usr/lib/perl5/site_perl/5.005/i386-linux/auto/Devel/DProf/DProf.so
#22 0x80ee5b6 in Perl_pp_entersub ()
#23 0x811855d in Perl_runops_standard ()
#24 0x80c09a1 in perl_call_sv ()
#25 0x400159cf in XS_DB_sub ()
   from
/usr/lib/perl5/site_perl/5.005/i386-linux/auto/Devel/DProf/DProf.so
#26 0x80ee5b6 in Perl_pp_entersub ()
#27 0x80c098c in perl_call_sv ()
#28 0x807d7cb in perl_call_handler ()
#29 0x807cfdb in perl_run_stacked_handlers ()
#30 0x807b55d in perl_handler ()
#31 0x80966e3 in ap_invoke_handler ()
#32 0x80a9bb9 in ap_some_auth_required ()
#33 0x80a9c1c in ap_process_request ()
#34 0x80a150e in ap_child_terminate ()
#35 0x80a169c in ap_child_terminate ()
#36 0x80a17f9 in ap_child_terminate ()
#37 0x80a1e26 in ap_child_terminate ()
#38 0x80a25b3 in main ()
#39 0x400941eb in __libc_start_main (main=0x80a226c <main>, argc=2, 
    argv=0xbffffba4, init=0x80600b4 <_init>, fini=0x811863c <_fini>, 
    rtld_fini=0x4000a610 <_dl_fini>, stack_end=0xbffffb9c)
    at ../sysdeps/generic/libc-start.c:90

perl -V:
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.2.5-22smp, archname=i386-linux
    uname='linux porky.devel.redhat.com 2.2.5-22smp #1 smp wed jun 2
09:11:51 edt 1999 i686 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux
(egcs-1.1.2 release)
    cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    stdchar='char', d_stdstdio=undef, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under linux
  Compiled at Aug 30 1999 23:09:51
  %ENV:
    PERL5DB="use Devel::DProf;"
    PERL5OPT="-d:DProf"
  @INC:
    /usr/lib/perl5/5.00503/i386-linux
    /usr/lib/perl5/5.00503
    /usr/lib/perl5/site_perl/5.005/i386-linux
    /usr/lib/perl5/site_perl/5.005
    .


Makefile options:
perl Makefile.PL PERL_DEBUG=1 APACHE_SRC=../apache_1.3.12/src \
      DO_HTTPD=1 USE_APACI=1 PERL_MARK_WHERE=1 EVERYTHING=1 \
       APACI_ARGS=--enable-module=info

mod_perl 1.24 / apache 1.3.12  

Ideas?

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://perl.org     http://stason.org/TULARC
http://singlesheaven.com http://perlmonth.com http://sourcegarden.org

Reply via email to