c++ - apache 上的 ap_log_error 转储从 apache 2.4 开始

标签 c++ apache aix apache2.4

我在 apache 2.4 上构建了一个共享模块。我可以让 apache 构建成功。在 apache 启动时,下面一行有一个转储:

if (r != NULL)        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r, "test");

我取消引用 server_rec(apache struct) 类型的结构变量 r,下面是 dbx 中的值

(dbx) p *r
(process = 0x000000011001fa88, next = (nil), error_fname = "logs/error_log", error_log = 0x000000011001fa10, log = (module_levels = (nil), level = 4), module_config = 0x0000000110053420, lookup_defaults = 0x0000000110054ef8, defn_name = (nil), defn_line_number = 0, is_virtual = '\0', port = 0, server_scheme = (nil), server_admin = "you@example.com", server_hostname = "isi081.wdf.sap.corp", addrs = 0x000000011004e410, timeout = 60000000, keep_alive_timeout = 5000000, keep_alive_max = 100, keep_alive = 1, names = (nil), wild_names = (nil), path = (nil), pathlen = 0, limit_req_line = 8190, limit_req_fieldsize = 8190, limit_req_fields = 100, context = (nil))

我没有看到内存有任何损坏。但是在 apache 启动时仍然有一个转储。 如果我注释掉这一行,那么一切都会按预期进行。 Apache 启动,我也能够完成操作。但是我们需要这条语句才能启用日志记录。是否有任何其他替代方案或修复方法。

相同的代码适用于其他平台,如 linux、solaris 和 HP on apache 2.4。 同样在带有 apache 2.2 的 aix 上也可以使用相同的代码。仅在 apache 2.4 上观察到此问题。

如有任何帮助,我们将不胜感激。

最佳答案

我认为您没有完全针对 2.4 header 进行编译,并且“ap_log_error”未被视为 2.4 中的宏。

此外,名为“r”的 server_rec 具有极强的误导性。 “r”传统上是一个 request_rec。我不敢相信这实际上不是您问题的根源,也许它是间接的。

关于c++ - apache 上的 ap_log_error 转储从 apache 2.4 开始,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39523761/

相关文章:

linux - shell 脚本 (AIX) : Extracting OS and browser information from user agent string

c++ - 在原生c++中查找直接或间接使用特定方法的所有方法

c++ - Node JS - 模块没有自行注册

php - 目录重定向规则

apache RewriteRule 将页面重定向到 root 不工作

c++ - 由于在 aix6.1 上使用 g++4.6.1 出现 "The displacement must be greater than or equal to -32768 and less than or equal to 32767",编译失败

c++ - 在 AIX 系统上使用 winsock - 可能吗?

c++ - 访问对象void pointer c++的成员

c++ - qt C++信号与槽中删除函数错误的使用

java - 使用java创建impala表并添加数据