You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by David Winter <da...@zeec.biz> on 2009/06/29 16:56:08 UTC

64 bit libapreq2 segfaults

Hi all,

I'll summarize my problem:
my module runs fine on 32 bit (i386) machines but segfaults constantly  
on 64 bit (x86_64) machines.
It seems that the address returned by apreq_handle_apache2 is out of  
bounds, accessing it (e.g. with other libapreq2 functions) leads to a  
segfault. Funny thing is: I got a valid address from  
apreq_handle_apache2 when debugging it with gdb.

The machines I tested are Xen DomUs running CentOS 5.3. I tested  
libapreq2-2.12 as well as svn-trunk (r783546).

This is the output of my gdb session:

(gdb) run -X -d /etc/httpd
...
Program received signal SIGSEGV, Segmentation fault.
apreq_param (req=0xffffffffad4fff80, key=0x2ad7a140e981 "s")
     at ../include/apreq_module.h:196
196	    return req->module->args_get(req, name);

(gdb) bt full
#0  apreq_param (req=0xffffffffad4fff80, key=0x2ad7a140e981 "s")
     at ../include/apreq_module.h:196
	param = <value optimized out>
#1  0x00002ad7a140e440 in cod_handler (r=0x2ad7ad4fb048) at  
mod_zeec_cod.c:179
	req = (apreq_handle_t *) 0xffffffffad4fff80
	s = <value optimized out>
#2  0x00002ad7960c89ba in ap_run_handler () from /usr/sbin/httpd
No symbol table info available.
#3  0x00002ad7960cbe32 in ap_invoke_handler () from /usr/sbin/httpd
No symbol table info available.
#4  0x00002ad7960d6888 in ap_process_request () from /usr/sbin/httpd
No symbol table info available.
#5  0x00002ad7960d3ac0 in ?? () from /usr/sbin/httpd
No symbol table info available.
...
(gdb) p *req
Cannot access memory at address 0xffffffffad4fff80
(gdb) return
Make apreq_param return now? (y or n) y
#0  0x00002ad7a140e440 in cod_handler (
     r=0x2ad7ad4fb048) at mod_zeec_cod.c:179
179		if (apreq_param(req, "s"))
(gdb) p *apreq_handle_apache2(r)
$3 = {module = 0x2ad7a11fe8a0, pool = 0x2ad7ad4fafd8,
   bucket_alloc = 0x2ad7ad4f8fc8}


Many thanks in advance and let me know if you need more information.

David

Re: 64 bit libapreq2 segfaults

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
David Winter wrote:
> Hi all,
> 
> I'll summarize my problem:
> my module runs fine on 32 bit (i386) machines but segfaults constantly
> on 64 bit (x86_64) machines.
> It seems that the address returned by apreq_handle_apache2 is out of
> bounds, accessing it (e.g. with other libapreq2 functions) leads to a
> segfault. Funny thing is: I got a valid address from
> apreq_handle_apache2 when debugging it with gdb.

It must be something else, I can't remember the last time I used
libapreq2 on !amd64.

I've yet to try a DomUs but I'm sure it works on CentOS, one of my
contract clients is using it internally on that.


Are you hitting this from perl code or directly from some custom C
you've written.  Either way, can you show the snippet in question ?

httpd -V
perl -V
apr-1-config --version
httpd.conf