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