httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wilson Cheung <>
Subject [users@httpd] apache-1.3.33: mod_log_forensic module use of assert() vs. ap_assert() introduces __eprintf() gcc-ism?
Date Sun, 14 Nov 2004 01:23:34 GMT
apache-1.3.33: mod_log_forensic module use of assert() vs. ap_assert() introduces __eprintf()

Since the production introduction of the module
starting in apache-1.3.31, I've run into the following problem whenever
starting the Apache "httpd" process after freshly compiling it for
Solaris 8 UNIX (/etc/init.d/httpd is symbolically linked to the "apachectl"

# uname -a
SunOS euclid 5.8 Generic_117350-12 sun4u sparc SUNW,Ultra-2

# gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/specs
gcc version 2.95.3 20010315 (release)

# /etc/init.d/httpd startssl
Syntax error on line 235 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/ into server: /usr/local/apache/bin/httpd:
fatal: relocation error: file /usr/local/apache/libexec/ symbol __eprintf:
referenced symbol not found
/etc/init.d/httpd startssl: httpd could not be started

Normally, I would just comment out the two lines in httpd.conf:

LoadModule log_forensic_module libexec/
AddModule mod_log_forensic.c

and continue on but since the problem still appears to be present in
in the recently-released apache 1.3.33, I took a closer look.

A Google search reveals that the issue with the "__eprintf: referenced
symbol not found" seems to be a common problem with some other software
when using gcc to compile code that has a "#include <assert.h>" line
and later calls the "assert()" function.  

There are various further detailed discussions about the compiler either
including the wrong assert.h header file (/usr/include/assert.h vs.
/usr/local/include/sparc-sun-solaris2.8/include/assert.h) and/or calling
the assert() function in the wrong library (system libraries vs. GCC

The most commonly-proposed solution to this problem seems to be to just
force linking against the "libgcc.a" GCC library so that the correct
assert() function is called that includes the __eprintf() function.

However, I notice that src/include/httpd.conf specifically defines an
"ap_assert()" macro that seems to be used in other parts of the apache
code for assert()-type purposes.

If I just replace all the assert() calls in 
src/modules/standard/mod_log_forensic.c with ap_assert(), the code still
compiles OK and I don't get the above errors on starting httpd.

Adding a "ForensicLog logs/forensic_log" entry in httpd.conf then results
in working forensic logging.

# diff mod_log_forensic.c.orig mod_log_forensic.c
< #include <assert.h>
<         assert(q < e);
>         ap_assert(q < e);
<             assert(q+2 < e);
>             ap_assert(q+2 < e);
<     assert(q < e);
>     ap_assert(q < e);
<     assert(h.pos < h.end);
>     ap_assert(h.pos < h.end);

What's not clear to me is whether there's a better way of fixing this?


Wilson Cheung      UCSD Mathematics Department Computing Support (MCS)   9500 Gilman Drive, Dept 0112, La Jolla, CA  92093-0112
          | (858) 534-2762 | AP&M 5712

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message