Chapter 23. Getting Help and Online ResourcesIn this chapter, we propose a way to solve your mod_perl-related problems and provide starting points for information resources related to mod_perl. If you have any problem with mod_perl itself, be it a build problem or a runtime problem, you should follow the steps below. But before you follow them, think carefully about whether the problem you are experiencing is mod_perl-related. It's quite possible that the problem is in the Perl code, SQL code, Apache itself, or something else entirely. In such cases, you should refer to other resources presented later in this chapter. Remember that although mod_perl resources might help you with many related things, they will never be as detailed as resources devoted to the topic at hand. If you still think that the problem has something to do with mod_perl, these are the steps to follow:
23.1. How to Report ProblemsWhen reporting a problem to the mod_perl mailing list, always send these details:
Also check whether:
You should try to isolate the problem and send the smallest possible code snippet that reproduces the problem. 23.1.1. Getting the Backtrace from Core DumpsIf you get a core dump (segmentation fault), send a backtrace if possible. Before you try to produce it, rebuild mod_perl with: panic% perl Makefile.PL PERL_DEBUG=1 which will:
You can read a full explanation in Chapter 21, but here is a summary of how to get a backtrace: panic% cd mod_perl-1.xx panic% gdb ../apache_1.3.xx/src/httpd (gdb) run -X -f `pwd`/t/conf/httpd.conf -d `pwd`/t [now make request that causes core dump] (gdb) bt In English: cd to the mod_perl source directory and start gdb with a path to the httpd binary, which is located in the Apache source tree. (Of course, replace x with real version numbers.) Next, start the httpd process from within gdb and issue a request that causes a core dump. When the code has died with the SIGSEGVsignal, run bt to get the backtrace. Alternatively, you can also attach to an already running process like so: panic% gdb httpd <process id number> If the dump is happening in libperl, you have to rebuild Perl with -DDEBUGGING enabled during the ./Configure stage. A quick way to this is to go to your Perl source tree and run these commands: panic% rm *.[oa] panic% make LIBPERL=libperld.a panic% cp libperld.a $Config{archlibexp}/CORE where $Config{archlibexp} is: % perl -V:archlibexp 23.1.2. Spinning ProcessesThe gdb attaching to the live process approach is helpful when debugging a spinning process. You can also get a Perl stack trace of a spinning process by installing a $SIG{USR1} handler in your code: use Carp ( ); $SIG{USR1} = \&Carp::confess; While the process is spinning, send it a USR1 signal: panic% kill -USR1 <process id number> and the Perl stack trace will be printed. Alternatively, you can use gdb to find which Perl code is causing the spin: panic% gdb httpd <pid of spinning process> (gdb) where (gdb) source mod_perl-x.xx/.gdbinit (gdb) curinfo After loading the special macros file (.gdbinit), you can use the curinfo gdb macro to figure out the file and line number in which the code stuck. Chapter 21 talks in more detail about tracing techniques. Finally, send all these details to modperl@perl.apache.org . Copyright © 2003 O'Reilly & Associates. All rights reserved. |
|