Re: Apache alpha and mod_jk

2010-10-15 Thread Igor Galić

- "Damon Green"  wrote:

> Hi httpd dev, We have a scenario presently that is causing us some
> difficulties. Env is SPARC Solaris10, gcc. We wish to use the current
> alpha build of Apache because it includes new features in mod_cache
> that we want to use, specifically the option to persist disk cache on
> 500 errors from Tomcat. They are checked into trunk.
> http://svn.apache.org/viewvc/httpd/httpd/trunk/ We also wish to use
> mod_jk to connect to Tomcat. Our issue is that we cannot get any
> version of mod_jk to work with this Apache. We have tried the
> pre-compiled binaries of mod_jk, and tried to compile our own mod_jk.
> Both scenarios are failing. When we use the pre-compiled binary
> mod_jk.so provided by the Tomcat connectors.
> http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/solaris/jk-1.2.30/sparc/
> mod_jk-1.2.30-httpd-2.2.X.so bash-3.00# ./apachectl configtest
> httpd: Syntax error on line 139 of /apps/apache-2.3.8/conf/httpd.conf:
> Cannot load /apps/apache-2.3.8/modules/mod_jk.so into server: ld.so.1:
> httpd: fatal: relocation error: file
> /apps/apache-2.3.8/modules/mod_jk.so: symbol ap_log_error: referenced
> symbol not found
> bash-3.00#

httpd 2.3 and 2.2 are NOT binary (or even API) compatible.

> and when we try to compile mod_jk to work with the Apache it fails
> with the following errors. This mod_jk compiles fine for Apache 2.2
> 
> 
> 
> 
> /home/tomcat- connectors-1.2.30-src/native#. /configure
> --with-apxs=/apps/apache-2.3. 8/bin/apxs
> 
> no errors
> 
> 
> /home/tomcat-connectors-1.2.30-src/native#make
> Making all in common
> /apps/apache-2.3.8/build/libtool --silent --mode=compile gcc
> -std=gnu99 -I/apps/apache-2.3.8/include -g -O2 -g -O2 -DHAVE_APR
> -I/apps/apache-2.3.8/include -I/apps/apache-2.3.8/include -g -O2
> -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE -I /include -I /include/ -c jk_ajp12_worker.c -o
> jk_ajp12_worker.lo
> /apps/apache-2.3.8/build/libtool --silent --mode=compile gcc
> -std=gnu99 -I/apps/apache-2.3.8/include -g -O2 -g -O2 -DHAVE_APR
> -I/apps/apache-2.3.8/include -I/apps/apache-2.3.8/include -g -O2
> -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE -I /include -I /include/ -c jk_connect.c -o
> jk_connect.lo
> /apps/apache-2.3.8/build/libtool --silent --mode=compile gcc
> -std=gnu99 -I/apps/apache-2.3.8/include -g -O2 -g -O2 -DHAVE_APR
> -I/apps/apache-2.3.8/include -I/apps/apache-2.3.8/include -g -O2
> -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE -I /include -I /include/ -c jk_msg_buff.c -o
> jk_msg_buff.lo
> /apps/apache-2.3.8/build/libtool --silent --mode=compile gcc
> -std=gnu99 -I/apps/apache-2.3.8/include -g -O2 -g -O2 -DHAVE_APR
> -I/apps/apache-2.3.8/include -I/apps/apache-2.3.8/include -g -O2
> -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE -I /include -I /include/ -c jk_util.c -o
> jk_util.lo
> /apps/apache-2.3.8/build/libtool --silent --mode=compile gcc
> -std=gnu99 -I/apps/apache-2.3.8/include -g -O2 -g -O2 -DHAVE_APR
> -I/apps/apache-2.3.8/include -I/apps/apache-2.3.8/include -g -O2
> -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE -I /include -I /include/ -c jk_ajp13.c -o
> jk_ajp13.lo
> /apps/apache-2.3.8/build/libtool --silent --mode=compile gcc
> -std=gnu99 -I/apps/apache-2.3.8/include -g -O2 -g -O2 -DHAVE_APR
> -I/apps/apache-2.3.8/include -I/apps/apache-2.3.8/include -g -O2
> -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE -I /include -I /include/ -c jk_pool.c -o
> jk_pool.lo
> /apps/apache-2.3.8/build/libtool --silent --mode=compile gcc
> -std=gnu99 -I/apps/apache-2.3.8/include -g -O2 -g -O2 -DHAVE_APR
> -I/apps/apache-2.3.8/include -I/apps/apache-2.3.8/include -g -O2
> -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE -I /include -I /include/ -c jk_worker.c -o
> jk_worker.lo
> /apps/apache-2.3.8/build/libtool --silent --mode=compile gcc
> -std=gnu99 -I/apps/apache-2.3.8/include -g -O2 -g -O2 -DHAVE_APR
> -I/apps/apache-2.3.8/include -I/apps/apache-2.3.8/include -g -O2
> -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE -I /include -I /include/ -c jk_ajp13_worker.c -o
> jk_ajp13_worker.lo
> /apps/apache-2.3.8/build/libtool --silent --mode=compile gcc
> -std=gnu99 -I/apps/apache-2.3.8/include -g -O2 -g -O2 -DHAVE_APR
> -I/apps/apache-2.3.8/include -I/apps/apache-2.3.8/include -g -O2
> -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE -I /include -I /include/ -c jk_lb_worker.c -o
> jk_lb_worker.lo
> /apps/apache-2.3.8/build/libtool --silent --mode=compile gcc
> -std=gnu99 -I/apps/apache-2.3.8/include -g -O2 -g -O2 -DHAVE_APR
> -I/apps/apache-2.3.8/include -I/apps/apache-2.3.8/include -g -O2
> -DSOLARIS2=10 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
> -D_LARGEFILE64_SOURCE -I /include -I /include/ -c jk_sockbuf.c -o
> jk_sockbuf.lo
> /apps/

Re: Apache alpha and mod_jk

2010-10-15 Thread Igor Galić
> I'll report back in a bit

compiling mod_jk trunk against httpd trunk (with clang from trunk):

It all looks like good clean fun, until it hits the new logging API:

opt/bw/build/libtool --silent --mode=compile /opt/bw/bin/clang 
-I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -DUSE_APACHE_MD5 -I 
../common -I /include -I /include/unix -
DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -DAP_DEBUG -fPIC -march=core2 -msse4.1 
-D_FORTIFY_SOURCE=2 -g -Wall -Wmissing-prototypes -Wstrict-prototypes 
-Wmissing-declarations -pthread 
-DHAVE_APR  -I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -g -Wall 
-Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread 
-DLINUX=2 -D_REENTRANT -D_GNU_
SOURCE -DAP_DEBUG -c mod_jk.c -o mod_jk.lo
mod_jk.c:639:5: warning: incompatible pointer types initializing 'server_rec *' 
(aka 'struct server_rec *') with an expression of type 'char *'
ap_log_error(file, line, level, 0, s, res);
^~
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
  ^
/opt/bw/include/http_log.h:340:22: note: instantiated from:
do { server_rec *sr = s; if (APLOG_MODULE_IS_LEVEL(sr, mi, level))  \
 ^
mod_jk.c:639:5: error: expected expression
ap_log_error(file, line, level, 0, s, res);
^
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
  ^
/opt/bw/include/http_log.h:341:74: note: instantiated from:
 ap_log_error_(file, line, mi, level, status, sr, __VA_ARGS__); \
 ^
mod_jk.c:641:9: warning: incompatible pointer types initializing 'server_rec *' 
(aka 'struct server_rec *') with an expression of type 'char *'
ap_log_error(file, line, level, 0, NULL, res);
^
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
  ^
/opt/bw/include/http_log.h:340:22: note: instantiated from:
do { server_rec *sr = s; if (APLOG_MODULE_IS_LEVEL(sr, mi, level))  \
 ^
mod_jk.c:641:9: error: expected expression
ap_log_error(file, line, level, 0, NULL, res);
^
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
  ^
/opt/bw/include/http_log.h:341:74: note: instantiated from:
 ap_log_error_(file, line, mi, level, status, sr, __VA_ARGS__); \
 ^
mod_jk.c:2829:56: warning: incompatible pointer types passing 'server_rec *' 
(aka 'struct server_rec *') to parameter of type 'apr_pool_t *' (aka 'struct 
apr_pool_t *')
jk_error_exit(APLOG_MARK, APLOG_EMERG, overrides->s, p, "Memory 
error");
   ^~~~
mod_jk.c:620:40: note: passing argument to parameter 'p' here
  apr_pool_t * p, const char *fmt, ...)
   ^
mod_jk.c:2829:70: warning: incompatible pointer types passing 'apr_pool_t *' 
(aka 'struct apr_pool_t *') to parameter of type 'const char *'
jk_error_exit(APLOG_MARK, APLOG_EMERG, overrides->s, p, "Memory 
error");
 ^
mod_jk.c:620:55: note: passing argument to parameter 'fmt' here
  apr_pool_t * p, const char *fmt, ...)
  ^
mod_jk.c:3272:68: warning: incompatible pointer types passing 'server_rec *' 
(aka 'struct server_rec *') to parameter of type 'apr_pool_t *' (aka 'struct 
apr_pool_t *')
jk_error_exit(APLOG_MARK, APLOG_EMERG, srv, 
   ^~~
mod_jk.c:620:40: note: passing argument to parameter 'p' here
  apr_pool_t * p, const char *fmt, ...)
   ^
mod_jk.c:3273:43: warning: incompatible pointer types passing 'apr_pool_t *' 
(aka 'struct apr_pool_t *') to parameter of type 'const char *'
  srv->process->pool, "Memory error");
  ^~
mod_jk.c:620:55: note: passing argument to parameter 'fmt' here
  apr_pool_t * p, const char *fmt, ...)
  ^
6 warnings and 2 errors generated.
make[1]: *** [mod_jk.lo] Error 1
make[1]: Leaving directory `/home/i.galic/Projects/asf/mod_jk/native/apache-2.0'
make: *** [all

Re: Apache alpha and mod_jk

2010-10-15 Thread Rainer Jung

Igor,

thanks for checking as well. The Op also posted to the Tomcat dev list 
and I applied a change to mod_jk a few minutes ago which at least lets 
it compile for 2.0/2.2/2.3.


The culprit was the usual, we do use APLOG_MARK in other places than 
just ap_log* and since the macro changed its meaning the code broke. 
That's expected and well-documented after adding the per-module log 
config to 2.3.


The change is

http://svn.apache.org/viewvc?view=revision&revision=1022975

and I already answered the other post on the Tomcat dev list.

I didn't yet actually test the resulting code.

Regards,

Rainer

On 15.10.2010 17:50, Igor Galić wrote:

I'll report back in a bit


compiling mod_jk trunk against httpd trunk (with clang from trunk):

It all looks like good clean fun, until it hits the new logging API:

opt/bw/build/libtool --silent --mode=compile /opt/bw/bin/clang 
-I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -DUSE_APACHE_MD5 -I 
../common -I /include -I /include/unix -
DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -DAP_DEBUG -fPIC -march=core2 -msse4.1 
-D_FORTIFY_SOURCE=2 -g -Wall -Wmissing-prototypes -Wstrict-prototypes 
-Wmissing-declarations -pthread
-DHAVE_APR  -I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -g -Wall 
-Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread 
-DLINUX=2 -D_REENTRANT -D_GNU_
SOURCE -DAP_DEBUG -c mod_jk.c -o mod_jk.lo
mod_jk.c:639:5: warning: incompatible pointer types initializing 'server_rec *' 
(aka 'struct server_rec *') with an expression of type 'char *'
 ap_log_error(file, line, level, 0, s, res);
 ^~
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
   ^
/opt/bw/include/http_log.h:340:22: note: instantiated from:
 do { server_rec *sr = s; if (APLOG_MODULE_IS_LEVEL(sr, mi, level))  \
  ^
mod_jk.c:639:5: error: expected expression
 ap_log_error(file, line, level, 0, s, res);
 ^
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
   ^
/opt/bw/include/http_log.h:341:74: note: instantiated from:
  ap_log_error_(file, line, mi, level, status, sr, __VA_ARGS__); \
  ^
mod_jk.c:641:9: warning: incompatible pointer types initializing 'server_rec *' 
(aka 'struct server_rec *') with an expression of type 'char *'
 ap_log_error(file, line, level, 0, NULL, res);
 ^
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
   ^
/opt/bw/include/http_log.h:340:22: note: instantiated from:
 do { server_rec *sr = s; if (APLOG_MODULE_IS_LEVEL(sr, mi, level))  \
  ^
mod_jk.c:641:9: error: expected expression
 ap_log_error(file, line, level, 0, NULL, res);
 ^
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
   ^
/opt/bw/include/http_log.h:341:74: note: instantiated from:
  ap_log_error_(file, line, mi, level, status, sr, __VA_ARGS__); \
  ^
mod_jk.c:2829:56: warning: incompatible pointer types passing 'server_rec *' 
(aka 'struct server_rec *') to parameter of type 'apr_pool_t *' (aka 'struct 
apr_pool_t *')
 jk_error_exit(APLOG_MARK, APLOG_EMERG, overrides->s, p, "Memory 
error");
^~~~
mod_jk.c:620:40: note: passing argument to parameter 'p' here
   apr_pool_t * p, const char *fmt, ...)
^
mod_jk.c:2829:70: warning: incompatible pointer types passing 'apr_pool_t *' 
(aka 'struct apr_pool_t *') to parameter of type 'const char *'
 jk_error_exit(APLOG_MARK, APLOG_EMERG, overrides->s, p, "Memory 
error");
  ^
mod_jk.c:620:55: note: passing argument to parameter 'fmt' here
   apr_pool_t * p, const char *fmt, ...)
   ^
mod_jk.c:3272:68: warning: incompatible pointer types passing 'server_rec *' 
(aka 'struct server_rec *') to parameter of type 'apr_pool_t *' (aka 'struct 
apr_pool_t *')
 jk_error_exit(APLOG_MARK, APLOG_EMERG, srv,
^~~
mod_jk.c:620:40: note: passing argument to parameter 'p' here
   apr_pool_t * p, const char 

Re: Apache alpha and mod_jk

2010-10-15 Thread Igor Galić

- "Rainer Jung"  wrote:

> Igor,
> 
> thanks for checking as well. The Op also posted to the Tomcat dev list
> 
> and I applied a change to mod_jk a few minutes ago which at least lets
> 
> it compile for 2.0/2.2/2.3.

It does indeed compile. I haven't tested it yet myself.
(I usually use mod_proxy_ajp|http)

> The culprit was the usual, we do use APLOG_MARK in other places than 
> just ap_log* and since the macro changed its meaning the code broke. 
> That's expected and well-documented after adding the per-module log 
> config to 2.3.

I remembered that it was documented and was looking for documentation
but failed to find it.

> The change is
> 
> http://svn.apache.org/viewvc?view=revision&revision=1022975

This patch now throws 4 warnings alltogether:



I'm getting:

/opt/bw/build/libtool --silent --mode=compile /opt/bw/bin/clang 
-I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -fPIC -march=core2 
-msse4.1 -D_FORTIFY_SOURCE=2 -g -Wall -Wm
issing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread 
-DHAVE_APR  -I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -DLINUX=2 
-D_REENTRANT -D_GNU_SOURCE -DAP_
DEBUG -I /include -I /include/ -c jk_map.c -o jk_map.lo
jk_map.c:637:24: warning: comparison of unsigned expression >= 0 is always true 
[-Wtautological-compare]
for (i = i - 1; (i >= 0) &&
 ~ ^  ~
1 warning generated.


And, this, which can be ignored, I suppose:

/opt/bw/build/libtool --silent --mode=compile /opt/bw/bin/clang 
-I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -DUSE_APACHE_MD5 -I 
../common -I /include -I /include/unix -
DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -DAP_DEBUG -fPIC -march=core2 -msse4.1 
-D_FORTIFY_SOURCE=2 -g -Wall -Wmissing-prototypes -Wstrict-prototypes 
-Wmissing-declarations -pthread 
-DHAVE_APR  -I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -g -Wall 
-Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread 
-DLINUX=2 -D_REENTRANT -D_GNU_
SOURCE -DAP_DEBUG -c mod_jk.c -o mod_jk.lo
mod_jk.c:647:5: warning: initializing 'server_rec *' (aka 'struct server_rec 
*') with an expression of type 'const server_rec *' (aka 'const struct 
server_rec *') discards
  qualifiers
ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, s, res);   
^~
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
  ^
/opt/bw/include/http_log.h:340:22: note: instantiated from:
do { server_rec *sr = s; if (APLOG_MODULE_IS_LEVEL(sr, mi, level))  \
 ^
mod_jk.c:647:5: warning: format string is not a string literal (potentially 
insecure) [-Wformat-security]
ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, s, res);   
^~
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
  ^
mod_jk.c:647:5: note: instantiated from:
ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, s, res);   
^ ~~~
mod_jk.c:647:63: note: instantiated from:
ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, s, res);   
  ^~~
mod_jk.c:653:9: warning: format string is not a string literal (potentially 
insecure) [-Wformat-security]
ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, NULL, res);
^
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
  ^
mod_jk.c:653:9: note: instantiated from:
ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, NULL, res);
^~~~
mod_jk.c:653:70: note: instantiated from:
ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, NULL, res);
 ^~~
3 warnings generated.






> and I already answered the other post on the Tomcat dev list.
> 
> I didn't yet actually test the resulting code.
> 
> Regards,
> 
> Rainer
> 
> On 15.10.2010 17:50, Igor Galić wrote:
> >> I'll report back in a bit
> >
> > compiling mod_jk trunk against httpd trunk (with clang from trunk):
> >
> > It all looks like good clean fun, until it hits the new logging
> API:
> >
> > opt/bw/build/libtool --silent --mode=compile /opt/bw/bin/clang
> -I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -DUSE_APACHE_MD5
> -I ../common -I /include -I /include/unix -
> > DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -DAP_DEBUG -fPIC -march=core2
> -msse4.1 -D_FORTIFY_SOURCE=2 -g -Wall -Wmissing-prototypes

Re: Apache alpha and mod_jk

2010-10-15 Thread Rainer Jung

On 15.10.2010 18:12, Igor Galić wrote:

- "Rainer Jung"  wrote:

The culprit was the usual, we do use APLOG_MARK in other places than
just ap_log* and since the macro changed its meaning the code broke.
That's expected and well-documented after adding the per-module log
config to 2.3.


I remembered that it was documented and was looking for documentation
but failed to find it.


http://httpd.apache.org/docs/trunk/developer/new_api_2_4.html


I'm getting:

/opt/bw/build/libtool --silent --mode=compile /opt/bw/bin/clang 
-I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -fPIC -march=core2 
-msse4.1 -D_FORTIFY_SOURCE=2 -g -Wall -Wm
issing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread 
-DHAVE_APR  -I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -DLINUX=2 
-D_REENTRANT -D_GNU_SOURCE -DAP_
DEBUG -I /include -I /include/ -c jk_map.c -o jk_map.lo
jk_map.c:637:24: warning: comparison of unsigned expression>= 0 is always true 
[-Wtautological-compare]
 for (i = i - 1; (i>= 0)&&
  ~ ^  ~
1 warning generated.


Fixed in r1023020. Shouldn't impose a real problem, because those tokens 
are not expected to be empty. But better safe than sorry.



And, this, which can be ignored, I suppose:

/opt/bw/build/libtool --silent --mode=compile /opt/bw/bin/clang 
-I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -DUSE_APACHE_MD5 -I 
../common -I /include -I /include/unix -
DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -DAP_DEBUG -fPIC -march=core2 -msse4.1 
-D_FORTIFY_SOURCE=2 -g -Wall -Wmissing-prototypes -Wstrict-prototypes 
-Wmissing-declarations -pthread
-DHAVE_APR  -I/opt/bw/include -fPIC -msse4.1 -D_FORTIFY_SOURCE=2 -g -Wall 
-Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread 
-DLINUX=2 -D_REENTRANT -D_GNU_
SOURCE -DAP_DEBUG -c mod_jk.c -o mod_jk.lo
mod_jk.c:647:5: warning: initializing 'server_rec *' (aka 'struct server_rec 
*') with an expression of type 'const server_rec *' (aka 'const struct 
server_rec *') discards
   qualifiers


That one looks like a minor bug in the ap_log_error macro of httpd, 
which I will bring up separately.



 ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, s, res);
 ^~
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
   ^
/opt/bw/include/http_log.h:340:22: note: instantiated from:
 do { server_rec *sr = s; if (APLOG_MODULE_IS_LEVEL(sr, mi, level))  \
  ^
mod_jk.c:647:5: warning: format string is not a string literal (potentially 
insecure) [-Wformat-security]
 ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, s, res);
 ^~
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
   ^
mod_jk.c:647:5: note: instantiated from:
 ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, s, res);
 ^ ~~~
mod_jk.c:647:63: note: instantiated from:
 ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, s, res);
   ^~~
mod_jk.c:653:9: warning: format string is not a string literal (potentially 
insecure) [-Wformat-security]
 ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, NULL, res);
 ^
In file included from mod_jk.c:40:
/opt/bw/include/http_log.h:337:27: note: instantiated from:
#define ap_log_error(...) ap_log_error__(__VA_ARGS__)
   ^
mod_jk.c:653:9: note: instantiated from:
 ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, NULL, res);
 ^~~~
mod_jk.c:653:70: note: instantiated from:
 ap_log_error(file, line, APLOG_MODULE_INDEX, level, 0, NULL, res);


The format warnings are OK, because

- we don't use the function with any user provided data
- we remove all occurances of "%" from res before passing along the 
ap_log_error


Thanks for checking!

Regards,

Rainer


Re: Apache alpha and mod_jk

2010-10-15 Thread Graham Leggett

On 15 Oct 2010, at 4:32 PM, Damon Green wrote:

We have a scenario presently that is causing us some difficulties.
Env is SPARC Solaris10, gcc.
We wish to use the current alpha build of Apache because it includes  
new features in mod_cache that we want to use, specifically the  
option to persist disk cache on 500 errors from Tomcat. They are  
checked into trunk. http://svn.apache.org/viewvc/httpd/httpd/trunk/

We also wish to use mod_jk to connect to Tomcat.
Our issue is that we cannot get any version of mod_jk to work with  
this Apache.
We have tried the pre-compiled binaries of mod_jk, and tried to  
compile our own mod_jk. Both scenarios are failing.
When we use the pre-compiled binary mod_jk.so provided by the Tomcat  
connectors.

http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/solaris/jk-1.2.30/sparc/
mod_jk-1.2.30-httpd-2.2.X.so
bash-3.00# ./apachectl configtest
httpd: Syntax error on line 139 of /apps/apache-2.3.8/conf/ 
httpd.conf: Cannot load /apps/apache-2.3.8/modules/mod_jk.so into  
server: ld.so.1: httpd: fatal: relocation error: file /apps/ 
apache-2.3.8/modules/mod_jk.so: symbol ap_log_error: referenced  
symbol not found

bash-3.00#
Even if the symbol-not-found error didn't sink you, checks and  
balances in the module loading code will stop you loading a v2.2  
module into a v2.3 server. Because APIs have changed between v2.2 and  
v2.3, if this wasn't stopped, the server would crash as the old API  
was called from new API code.


What you need to do is either find a version of mod_jk that compiles  
against v2.3/2.4 of httpd (assuming one exists), or you need to apply  
a backport of the mod_cache modules back to httpd v2.2.


To make this work from v2.2, the backported patches needed to make  
some minor changes, like reinstate CORE_PRIVATE and reverse the module  
definition, but otherwise can be dropped in as is:


http://people.apache.org/~minfrin/httpd-mod_cache-1022960.patch
http://people.apache.org/~minfrin/httpd-htcacheclean-1022280.patch

Regards,
Graham
--



Re: Apache alpha and mod_jk

2010-10-18 Thread Graham Leggett

On 15 Oct 2010, at 10:40 PM, Graham Leggett wrote:

To make this work from v2.2, the backported patches needed to make  
some minor changes, like reinstate CORE_PRIVATE and reverse the  
module definition, but otherwise can be dropped in as is:


I have updated the patch with all the optimisations for the weekend,  
it is available here:


http://people.apache.org/~minfrin/httpd-mod_cache-1023957.patch

Regards,
Graham
--