【问题标题】:ap_log_error dumps on apache start with apache 2.4apache 上的 ap_log_error 转储从 apache 2.4 开始
【发布时间】:2017-01-24 05:26:29
【问题描述】:

我在 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 启动,我也能够完成操作。但是我们需要这个语句才能启用日志记录。是否有任何其他替代方案或解决方案。

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

任何帮助将不胜感激。

【问题讨论】:

  • 下面是转储文件,r 是 server_rec 类型:
  • 猜你应该用调试器检查核心文件。您可能希望使用“-g”选项重新编译 Apache。

标签: c++ apache aix apache2.4


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-06-13
    • 1970-01-01
    • 1970-01-01
    • 2021-12-01
    • 1970-01-01
    • 2015-01-27
    • 2018-07-24
    • 2015-05-11
    相关资源
    最近更新 更多