httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: libapreq-1.1 SEGV's on AIX
Date Fri, 06 Jun 2003 03:59:03 GMT
Steven M. Carter wrote:
> On Thu, 5 Jun 2003, Stas Bekman wrote:
> 
>>Oh, that's quite different from mine. So it fails in dXSARGS;, we are slowly 
>>getting advanced. This expands as:
>>
>>	dSP; dMARK;	
>>	dAX; dITEMS
>>
>>Can you replace:
>>
>>dXSARGS;
>>
>>with:
>>
>>register SV **sp = PL_stack_sp;
>>register SV **mark = PL_stack_base + POPMARK;
>>I32 ax = MARK - PL_stack_base + 1;
>>I32 items = SP - MARK;
>>
>>in that file (which is the further extension of these 4 macros)
>>
>>run 'make test' and see where it segfaults now?
> 
> 
> Program terminated with signal 11, Segmentation fault.
> #0  0xd00d49cc in boot_Apache__Request (cv=0x204157d4) at Request.c:888
> 888     Request.c: A file or directory in the path name does not exist..
>         in Request.c
> (gdb) bt
> #0  0xd00d49cc in boot_Apache__Request (cv=0x204157d4) at Request.c:888
> #1  0xd25feb90 in Perl_pp_entersub () from 
> /opt/www/apache/libexec/libperl.so
> #2  0xd267d448 in Perl_runops_standard ()
>    from /opt/www/apache/libexec/libperl.so
> #3  0xd264dcac in S_call_body () from /opt/www/apache/libexec/libperl.so
> #4  0xd264df00 in Perl_eval_sv () from /opt/www/apache/libexec/libperl.so
> #5  0xd26b8dc0 in perl_require_module ()
>    from /opt/www/apache/libexec/libperl.so
> #6  0xd25d48a0 in perl_cmd_module () from 
> /opt/www/apache/libexec/libperl.so
> #7  0x10018c90 in invoke_cmd (cmd=0x202cc2d8, parms=0x2ff22530, 
>     mconfig=0x202582bc, args=0x2ff204f2 "") at http_config.c:947
> #8  0x1001948c in ap_handle_command (parms=0x2ff22530, config=0x20234d14, 
>     l=0x2ff204d8 "PerlModule Apache::Request") at http_config.c:1080
> #9  0x10019574 in ap_srm_command_loop (parms=0x2ff22530, 
> config=0x20234d14)
>     at http_config.c:1094
> #10 0x1001a150 in ap_process_resource_config (s=0x2023411c, 
>     fname=0x20002cc0 
> "/dfs/home/scarter/compile/aix_51/libapreq-1.1/t/httpd.conf", 
> p=0x202340f4, ptemp=0x20238134) at http_config.c:1382
> #11 0x1001ae3c in ap_read_config (p=0x202340f4, ptemp=0x20238134, 
>     confname=0x20002cc0 
> "/dfs/home/scarter/compile/aix_51/libapreq-1.1/t/httpd.conf") at 
> http_config.c:1674
> #12 0x100078dc in main (argc=3, argv=0x2ff22814) at http_main.c:5531
> #13 0x100001dc in __start ()
> 
> My Request.c:
> 
>   +884  XS(boot_Apache__Request); /* prototype to pass 
> -Wmissing-prototypes */
>   +885  XS(boot_Apache__Request)
>   +886  {
>   +887      register SV **sp = PL_stack_sp;
>   +888      register SV **mark = PL_stack_base + POPMARK;
>   +889      I32 ax = MARK - PL_stack_base + 1;
>   +890      I32 items = SP - MARK;
>   +891      char* file = __FILE__;
>   +892
>   +893      XS_VERSION_BOOTCHECK ;

Any chance you can try to take it further by yourself? now POPMARK is the next 
candidate (line 888), expand it up by looking it up in the perl headers:

grep -Ir 'define POPMARK' /home/stas/perl/blead/lib/5.9.0/i686-linux/CORE/
/home/stas/perl/blead/lib/5.9.0/i686-linux/CORE/pp.h:#define POPMARK 
   (*PL_markstack_ptr--)

so you replace POPMARK with *PL_markstack_ptr-- and try again.

I suppose that's where it segfaults, PL_markstack_ptr must be bogus and it 
segfaults when dereferencing it.

grep -Ir 'define PL_markstack_ptr' 
/home/stas/perl/blead/lib/5.9.0/i686-linux/CORE/
/home/stas/perl/blead/lib/5.9.0/i686-linux/CORE/embedvar.h:#define 
PL_markstack_ptr     (vTHX->Tmarkstack_ptr)
/home/stas/perl/blead/lib/5.9.0/i686-linux/CORE/perlapi.h:#define 
PL_markstack_ptr      (*Perl_Tmarkstack_ptr_ptr(aTHX))

since you aren't using thread, it's surprising that you get a corrupted 
PL_markstack_ptr. since you got no threads, it should be:

(vTHX->Tmarkstack_ptr);

Ask p5p?

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message