【发布时间】: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。