mod_perl logo perl icon
previous page: Porting Apache:: XS Modules from mod_perl 1.0 to 2.0page up: Developer's guidenext page: Debugging mod_perl C Internals

Debugging mod_perl Perl Internals






Writing Apache Modules with Perl and C

Writing Apache Modules with Perl and C

By Lincoln Stein, Doug MacEachern
Embedding Perl in HTML with Mason

Embedding Perl in HTML with Mason

By Dave Rolsky, Ken Williams
mod_perl2 User's Guide

mod_perl2 User's Guide

By Stas Bekman, Jim Brandt
Practical mod_perl

Practical mod_perl

By Stas Bekman, Eric Cholet
The mod_perl Developer's Cookbook

The mod_perl Developer's Cookbook

By Geoffrey Young, Paul Lindner, Randy Kobes
mod_perl Pocket Reference

mod_perl Pocket Reference

By Andrew Ford


Table of Contents

Description

This document explains how to debug Perl code under mod_perl.

Most of the mod_perl 1.0 debug documentation applies to mod_perl 2.0:



TOP

Detecting Hanging Processes

See Hanging Processes: Detection and Diagnostics for the explanation, but under mp2 to use signals to detect where the process is spinning, you can't use $SIG{USR2}, you have to use POSIX signals. i.e. the code becomes:

  use Carp ();
  use POSIX qw(SIGUSR2);
  my $mask      = POSIX::SigSet->new( SIGUSR2 );
  my $action    = POSIX::SigAction->new(\&tell_where_spinning, $mask);
  my $oldaction = POSIX::SigAction->new();
  POSIX::sigaction(SIGUSR2, $action, $oldaction );
  
  sub tell_where_spinning {
      Carp::confess("caught SIGUSR2!");
  };

and then:

  % kill USR2 <pid_of_the_spinning_process>

and watch for the trace in error_log.



TOP

Maintainers

Maintainer is the person(s) you should contact with updates, corrections and patches.



TOP

Authors

Only the major authors are listed above. For contributors see the Changes file.






TOP
previous page: Porting Apache:: XS Modules from mod_perl 1.0 to 2.0page up: Developer's guidenext page: Debugging mod_perl C Internals