On Tue, 30 Mar 2004, Stas Bekman wrote:
> Date: Tue, 30 Mar 2004 19:23:06 -0800
> From: Stas Bekman <[EMAIL PROTECTED]>
> To: Jie Gao <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: Re: [mp2] bug report: modperl_env.c
>
> Jie Gao wrote:
> > -------------8<---------- Start Bug Report ------------8<----------
> > 1. Problem Description:
> >
> > Apache segmentation faults trying to run a registry script.
>
> Thanks for the detailed report Jie, but how do we reproduce it without the
> test script and relevant configuration?
>
>
>
> [...]
> > [EMAIL PROTECTED]/usr/local/apache:> truss -f bin/httpd -k start -DSSL -X
> >
> >
> > ....
> >
> > 10075/12:
> > open("/usr/local/apache_2.0.49/htdocs/test2/mobile_proxy/nph-proxy.cgi", O_RDONLY)
> > = 13
> > 10075/12: read(13, " # ! / u s r / l o c a l".., 4096) = 4096
> > 10075/12: close(13) = 0
> > 10075/12: getpid() = 10075 [10074]
> > 10075/12: stat("/usr/local/apache_2.0.49/htdocs/010110A/x-proxy/start",
> > 0xFDBFB4F8) Err#2 ENOENT
> > 10075/12: lstat("/usr", 0xFDBFB488) = 0
> > 10075/12: lstat("/usr/local", 0xFDBFB488) = 0
> > 10075/12: stat("/usr/local", 0xFDBFB420) = 0
> > 10075/12: lstat("/usr/local/apache_2.0.49", 0xFDBFB488) = 0
> > 10075/12: lstat("/usr/local/apache_2.0.49/htdocs", 0xFDBFB488) = 0
> > 10075/12: lstat("/usr/local/apache_2.0.49/htdocs/010110A", 0xFDBFB488) Err#2
> > ENOENT
> > 10075/12: dup(14) = 13
>
> what's fd 14? earlier trace?
It's the CGIProxy script:
12086/12:
open("/usr/local/apache_2.0.49/htdocs/test2/mobile_proxy/nph-proxy.cgi", O_RDONLY) = 14
12086/12: read(14, " # ! / u s r / l o c a l".., 250298) = 250298
>
> > 10075/12: fstat64(13, 0x015E4460) = 0
> > 10075/12: fcntl(13, F_SETFD, 0x00000001) = 0
> > 10075/12: llseek(14, 0, SEEK_CUR) = 1176438
> > 10075/12: close(14) = 0
> > 10075/12: dup(12) = 14
> > 10075/12: fstat64(14, 0x015E4460) = 0
> > 10075/12: fcntl(14, F_SETFD, 0x00000001) = 0
> > 10075/12: dup(12) = 15
> > 10075/12: close(15) = 0
> > 10075/12: close(12) = 0
> > 10075/12: Incurred fault #6, FLTBOUNDS %pc = 0xFEA9BBBC
> > 10075/12: siginfo: SIGSEGV SEGV_MAPERR addr=0x00000010
> > 10075/12: Received signal #11, SIGSEGV [default]
> > 10075/12: siginfo: SIGSEGV SEGV_MAPERR addr=0x00000010
> >
> > ---------------------------------------------------------------------------
> >
> > [EMAIL PROTECTED]/usr/local/apache/bin:1008> gdb ./httpd
> > GNU gdb 5.0
> > Copyright 2000 Free Software Foundation, Inc.
> > GDB is free software, covered by the GNU General Public License, and you are
> > welcome to change it and/or distribute copies of it under certain conditions.
> > Type "show copying" to see the conditions.
> > There is absolutely no warranty for GDB. Type "show warranty" for details.
> > This GDB was configured as "sparc-sun-solaris2.9"...
> > (gdb) run -X -f /usr/local/apache/conf/httpd.conf -k start -DSSL -X
> > Starting program: /u0/local/apache_2.0.49/bin/./httpd -X -f
> > /usr/local/apache/conf/httpd.conf -k start -DSSL -X
> > [New LWP 1]
> > [New LWP 2]
> > [New LWP 3]
> > [New LWP 4]
> > [New LWP 5]
> > [New LWP 6]
> > [New LWP 7]
> > [New LWP 8]
> > [New LWP 9]
> > [New LWP 10]
> > [New LWP 11]
> > [New LWP 12]
> > [New LWP 13]
> > [LWP 2 exited]
> > [New LWP 2]
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to LWP 12]
> > 0xfea9bbbc in modperl_env_request_tie (my_perl=0x1026fe0, r=0x17a8c78) at
> > modperl_env.c:355
> > 355 EnvMgObj = (char *)r;
> > (gdb)
>
> and you forgot to run 'bt' or 'where' inside gdb.
(gdb) bt
#0 0xfea9bbbc in modperl_env_request_tie (my_perl=0x1149598, r=0x16985d0) at
modperl_env.c:355
#1 0xfea7edf8 in modperl_response_handler_cgi (r=0x16985d0) at mod_perl.c:934
#2 0xe4864 in ap_run_handler (r=0x16985d0) at config.c:151
#3 0xe5488 in ap_invoke_handler (r=0x16985d0) at config.c:358
#4 0x9190c in ap_process_request (r=0x16985d0) at http_request.c:246
#5 0x88b74 in ap_process_http_connection (c=0x17ab4f8) at http_core.c:250
#6 0xfa390 in ap_run_process_connection (c=0x17ab4f8) at connection.c:42
#7 0xfa96c in ap_process_connection (c=0x17ab4f8, csd=0x17ab408) at connection.c:175
#8 0xdef48 in process_socket (p=0x17ab3d0, sock=0x17ab408, my_child_num=0,
my_thread_num=9,
bucket_alloc=0x17ad3d8)
at worker.c:530
#9 0xdfacc in worker_thread (thd=0x1e30c8, dummy=0xa8f4c0) at worker.c:844
#10 0xff050868 in dummy_worker (opaque=0x1e30c8) at thread.c:88
I hope this helps.
Regards,
Jie
> Though one needs to be careful with threads. Signals aren't necessarily
> delivered to the thread that has sent the signal. So it's quite possible that
> some other thread has caused the segfault and what you see in gdb is just
> where the thread 12 happened to be at the moment. Are you sure that this is
> the only request you were running?
>
> __________________________________________________________________
> Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/ mod_perl Guide ---> http://perl.apache.org
> mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org http://ticketmaster.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]