Apache-Talk mailing list archive (apache-talk@lists.lexa.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [apache-talk] apache + mod_accel
On Tue, Mar 18, 2008 at 06:21:49PM +0300, Pavel Yudin wrote:
> Ну вроде бы что-то осмысленное получилось... хотя сам я понять, что
> происходит не могу...
>
> (gdb) core /var/tmp/httpd.core
> Core was generated by `httpd'.
> Program terminated with signal 11, Segmentation fault.
> Reading symbols from /lib/libcrypt.so.4...done.
> Loaded symbols for /lib/libcrypt.so.4
> Reading symbols from /usr/local/lib/libmm.so.14...done.
> Loaded symbols for /usr/local/lib/libmm.so.14
> Reading symbols from /lib/libc.so.7...done.
> Loaded symbols for /lib/libc.so.7
> Reading symbols from /libexec/ld-elf.so.1...done.
> Loaded symbols for /libexec/ld-elf.so.1
> #0 0x00000000809b6770 in strtol () from /lib/libc.so.7
> (gdb) backtrace
> #0 0x00000000809b6770 in strtol () from /lib/libc.so.7
> #1 0x0000000080997ed0 in atoi () from /lib/libc.so.7
> #2 0x000000000041213a in ap_set_kilobytes_slot (cmd=0x7fffffffea80,
> struct_ptr=0x80c059e8 "ЪЪЪЪ\001", arg=-2134701224) at ap_ext_accel.c:25
> #3 0x0000000000432ff0 in invoke_cmd (cmd=0x48a9f8, parms=0x7fffffffea80,
> mconfig=0x80c059e8, args=0x7fffffffc9d5 "") at http_config.c:815
> #4 0x0000000000433c44 in ap_handle_command (parms=0x7fffffffea80,
> config=0x80c05750, l=0x7fffffffc9c0 "AccelBkRcvBuffSize 64")
> at http_config.c:1038
> #5 0x0000000000433cc5 in ap_srm_command_loop (parms=0x7fffffffea80,
> config=0x80c05750) at http_config.c:1052
> #6 0x0000000000434613 in ap_process_resource_config (s=0x80c04070,
> fname=0x80c30058 "/usr/local/apache-frontend/conf/httpd.conf",
> p=0x80c04020, ptemp=0x80c0a020) at http_config.c:1344
> #7 0x0000000000435157 in ap_read_config (p=0x80c04020, ptemp=0x80c0a020,
> confname=0x5a7120 "conf/httpd.conf") at http_config.c:1636
> #8 0x0000000000442418 in main (argc=1, argv=0x7fffffffec58)
> at http_main.c:5848
> (gdb)
Функция ap_set_kilobytes_slot() в mod_accel/ap_ext_accel.c
описана и начинается так:
API_EXPORT_NONSTD(const char *) ap_set_kilobytes_slot(cmd_parms *cmd,
char *struct_ptr, int arg)
{
int offset = (int) (long) cmd->info;
int size = atoi((char *)arg);
При этом в аргумент arg апач передает const char*,
видимо на 64 битах тут происходит усечение указателя при двойном
преобразовании в int и обратно или ещё какая хрень.
Попробуй такой патч (compile-only tested, и на i386 вдобавок).
Если не пойдет, пиши автору mod_accel :-)
--- ap_ext_accel.h.orig Tue Mar 18 23:20:33 2008
+++ ap_ext_accel.h Tue Mar 18 23:21:05 2008
@@ -6,10 +6,10 @@
#include "http_config.h"
API_EXPORT_NONSTD(const char *) ap_set_integer_slot(cmd_parms *cmd,
- char *struct_ptr, int arg);
+ char *struct_ptr, char* arg);
API_EXPORT_NONSTD(const char *) ap_set_kilobytes_slot(cmd_parms *cmd,
- char *struct_ptr, int arg);
+ char *struct_ptr, char* arg);
#ifdef NO_SETPROCTITLE
#define ap_setproctitle(title)
--- ap_ext_accel.c.orig Tue Mar 18 23:20:04 2008
+++ ap_ext_accel.c Tue Mar 18 23:21:43 2008
@@ -5,10 +5,10 @@
#include "ap_ext_accel.h"
API_EXPORT_NONSTD(const char *) ap_set_integer_slot(cmd_parms *cmd,
- char *struct_ptr, int arg)
+ char *struct_ptr, char* arg)
{
int offset = (int) (long) cmd->info;
- int size = atoi((char *)arg);
+ int size = atoi(arg);
if (size < 0)
return ap_pstrcat(cmd->pool, cmd->cmd->name,
@@ -19,10 +19,10 @@
}
API_EXPORT_NONSTD(const char *) ap_set_kilobytes_slot(cmd_parms *cmd,
- char *struct_ptr, int arg)
+ char *struct_ptr, char* arg)
{
int offset = (int) (long) cmd->info;
- int size = atoi((char *)arg);
+ int size = atoi(arg);
if (size < 0)
return ap_pstrcat(cmd->pool, cmd->cmd->name,
|