You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Flavio Kenji Yanai <ya...@agestado.com.br> on 2002/01/15 18:59:30 UTC

apache child dies under mod_perl

Hi !


I'm having a problem under mod_perl , when my script is executed under
cgi-bin I don't have any problems, but under mod_perl  I have a SIGABRT.


 ![Tue Jan 15 17:03:41 2002] [notice] child pid 27481 exit signal
Aborted (6)



Probaly  I'm having problems with mmap system call, in the
implementation of the Debian's glibc nothing wrong has occurred ! But in
RedHat ... (both are under mod_perl 1.26)


----------------------------------------------------------------------


STRACE in DEBIAN : apache-1.3.22 perl-5.6.1  mod_perl-1.26 (OK)

stat("/home/yanai/main.pl", {st_mode=S_IFREG|0755, st_size=274, ...}) =
0
getgroups(32, [33])                     = 1
getgroups(32, [33])                     = 1
chdir("/home/yanai")                    = 0
open("./index", O_RDONLY|O_LARGEFILE)   = 57
dup2(57, 0)                             = 0
fstat(0, {st_mode=S_IFREG|0755, st_size=58588, ...}) = 0
mmap2(NULL, 58588, PROT_READ, MAP_PRIVATE, 0, 0) = -1 ENOSYS (Function
not implemented)
>>>>old_mmap(NULL, 58588, PROT_READ, MAP_PRIVATE, 0, 0) = 0x41474000    
>>>>old_mmap(NULL, 266240, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x41483000
chdir("/root")                          = 0
select(4, [3], NULL, NULL, {0, 0})      = 0 (Timeout)
write(3, "HTTP/1.1 200 OK\r\nDate: Tue, 15 J"..., 373) = 373
time(NULL)                              = 1011114962
write(17, "172.17.23.44 - - [15/Jan/2002:17"..., 153) = 153
gettimeofday({1011114962, 796847}, NULL) = 0
times({tms_utime=94, tms_stime=13, tms_cutime=0, tms_cstime=0}) =
2210036
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigaction(SIGALRM, {0x805a4f0, [], SA_RESTART|0x4000000}, {0x805a4f0,
[], SA_RESTART|0x4000000}, 8) = 0
rt_sigaction(SIGUSR1, {0x805b2f4, [], SA_INTERRUPT|0x4000000},
{SIG_IGN}, 8) = 0
read(3, "GET /favicon.ico HTTP/1.1\r\nHost:"..., 4096) = 431
rt_sigaction(SIGUSR1, {SIG_IGN}, {0x805b2f4, [],
SA_INTERRUPT|0x4000000}, 8) = 0
time(NULL)                              = 1011114962
gettimeofday({1011114962, 840619}, NULL) = 0
stat("/var/www/favicon.ico", 0xbffffb5c) = -1 ENOENT (No such file or
directory)
stat("/var/www", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
lstat("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/www", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
open("/var/www/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 58
fstat(58, {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
fcntl(58, F_SETFD, FD_CLOEXEC)          = 0
getdents(58, /* 9 entries */, 2980)     = 172
getdents(58, /* 0 entries */, 2980)     = 0


----------------------------------------------------------------------

strace in RedHat(7.2) apache-1.3.22 perl-5.6.0 mod_perl-1.26

open("./index", O_RDONLY)               = 6
dup2(6, 0)                              = 0
fstat64(0, {st_mode=S_IFREG|0775, st_size=58588, ...}) = 0
old_mmap(NULL, 58588, PROT_READ, MAP_PRIVATE, 0, 0) = 0x42c22000
>>>>> alarm(0)                                = 0
>>>>> brk(0x83b6000)                          = 0x83b6000
time([1011122651])                      = 1011122651
open("/etc/localtime", O_RDONLY)        = 8
fstat64(8, {st_mode=S_IFREG|0644, st_size=721, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x40018000
read(8, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0\0\0\3\0"...,
4096) = 721
close(8)                                = 0
munmap(0x40018000, 4096)                = 0
rt_sigaction(SIGPIPE, {0x4002e43c, [], 0x4000000}, {SIG_IGN}, 8) = 0
socket(PF_UNIX, SOCK_DGRAM, 0)          = 8
fcntl64(0x8, 0x2, 0x1, 0x2)             = 0
connect(8, {sin_family=AF_UNIX, path="/dev/log"}, 16) = 0
send(8, "<9>Jan 15 17:24:11 httpd: IMAP t"..., 59, 0) = 59
rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
kill(27536, SIGABRT)                    = 0
--- SIGABRT (Aborted) ---
chdir("/etc/httpd")                     = 0
rt_sigaction(SIGABRT, {SIG_DFL}, {SIG_DFL}, 8) = 0
getpid()                                = 27536
kill(27536, SIGABRT)                    = 0
sigreturn()                             = ? (mask now [])
--- SIGABRT (Aborted) ---
----------------------------------------------------------------------

The function where the error is occuring ...
(in C / made with SWIG)

static void
init(void)
{
  struct stat st;
  struct meta meta;

  if( -1 == fstat(0, &st) ){
    fprintf(stderr, "Can't stat 0: %s\n", strerror(errno));
    exit(1);
  }
  mapsize = st.st_size;
  errno = 0;
>>>>  map = mmap(0, st.st_size, PROT_READ, MAP_FILE|MAP_PRIVATE, 0, 0);
  if( (int)map <= 0 ){
    fprintf(stderr, "Can't map 0: %s\n", strerror(errno));
    exit(1);
  }
  memcpy(&meta, map, sizeof(meta));
  if( strcmp(meta.magic, MAGIC) ){
    fprintf(stderr, "Bad magic in file\n");
    munmap(map, st.st_size);
    exit(2);
  }
  locations = map + sizeof(meta);
  words = locations + meta.locations_size;
  end = words + meta.words_size;

}

--------------------------------------------------------------------------



I had tried change the version of perl to 5.6.1 , but the problems
remained.

Somebody could help me ??


Thanks !!


Re: apache child dies under mod_perl

Posted by Ged Haywood <ge...@www2.jubileegroup.co.uk>.
Hi there,

On 15 Jan 2002, Flavio Kenji Yanai wrote:

> I'm having a problem under mod_perl , when my script is executed under
> cgi-bin I don't have any problems, but under mod_perl  I have a SIGABRT.
> [snip]
> I had tried change the version of perl to 5.6.1 , but the problems
> remained.

Did you recompile mod_perl after doing this?
Did you compile Perl and mod_perl with the same compiler?

73,
Ged.