Re: Problems with tomcat-connectors-1.2.41 on 32bit linux

2015-08-27 Thread Falco Schwarz
On Wed, Aug 26, 2015 at 8:13 PM, Rainer Jung rainer.j...@kippdata.de
wrote:

 I added a configure check in

   http://svn.apache.org/viewvc?view=revisionrevision=1697985

 and documented the problem in

   https://bz.apache.org/bugzilla/show_bug.cgi?id=58285

 You might want to cross check.


After successfully applying the patches to a fresh copy of 1.2.41 (not
trunk) and figuring out how to rebuild the configure script I successfully
built mod_jk with disabled gcc atomics [1]. So I guess the patch works as
intended.

[1] I saw this message in the configure output, so the changes were
applied, I guess:

on 32bit SLES11 SP3:
 checking whether the compiler provides atomic builtins... no

on 64bit SLES11 SP3:
 checking whether the compiler provides atomic builtins... yes

Again, thank you for your help and the patch.

Regards,
Falco


Re: Problems with tomcat-connectors-1.2.41 on 32bit linux

2015-08-26 Thread Rainer Jung

Am 26.08.2015 um 08:00 schrieb Falco Schwarz:

On Tue, Aug 25, 2015 at 5:13 PM, Rainer Jung rainer.j...@kippdata.de
wrote:


Am 25.08.2015 um 14:58 schrieb Falco Schwarz:


If I try to startup httpd though the following error occurs:

httpd: Syntax error on line 88 of /opt/apache/conf/alles/httpd.conf:
Cannot
load /opt/apache/modules/mod_jk.so into server:
/opt/apache/modules/mod_jk.so: undefined symbol: __sync_add_and_fetch_4



simply change the #elif line 436 e.g. to

#elif defined(JK_USE_GCC_ATOMICS)  defined(__GNUC__)  (__GNUC__  4 ||
(__GNUC__ == 4  __GNUC_MINOR__ = 1))


Since JK_USE_GCC_ATOMICS is not defined, the elif will be skipped and the
next option (APR atomics) will be used, but you can later switch back to
the GCC version by compiling with -DJK_USE_GCC_ATOMICS. We might add
something like this and make the define be chosen according to configure
flags (--disable-gcc-atomics). Or maybe we should even use a configure
check to detect real support for GCC atomics on the target platform.
users-h...@tomcat.apache.org



I switched the logic to better suit my needs, but that works:

#elif !defined(JK_NO_GCC_ATOMICS)  defined(__GNUC__)  (__GNUC__  4 ||
(__GNUC__ == 4  __GNUC_MINOR__ = 1))


So on our 32bit systems jk is built with:
CFLAGS='-DJK_NO_GCC_ATOMICS' ./configure --with-apxs=/opt/apache/bin/apxs

It would be nice if something like that (preferably a configure option)
would be built in. It would of course be even better if configure could
detect if gcc atomics work and decide whether to use them or not. Anyways,
thank you for your quick and very helpful response.


I added a configure check in

  http://svn.apache.org/viewvc?view=revisionrevision=1697985

and documented the problem in

  https://bz.apache.org/bugzilla/show_bug.cgi?id=58285

You might want to cross check.

Thanks for helping!

Regards,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Problems with tomcat-connectors-1.2.41 on 32bit linux

2015-08-26 Thread Falco Schwarz
On Tue, Aug 25, 2015 at 5:13 PM, Rainer Jung rainer.j...@kippdata.de
wrote:

 Am 25.08.2015 um 14:58 schrieb Falco Schwarz:

 If I try to startup httpd though the following error occurs:

 httpd: Syntax error on line 88 of /opt/apache/conf/alles/httpd.conf:
 Cannot
 load /opt/apache/modules/mod_jk.so into server:
 /opt/apache/modules/mod_jk.so: undefined symbol: __sync_add_and_fetch_4


 simply change the #elif line 436 e.g. to

 #elif defined(JK_USE_GCC_ATOMICS)  defined(__GNUC__)  (__GNUC__  4 ||
 (__GNUC__ == 4  __GNUC_MINOR__ = 1))


 Since JK_USE_GCC_ATOMICS is not defined, the elif will be skipped and the
 next option (APR atomics) will be used, but you can later switch back to
 the GCC version by compiling with -DJK_USE_GCC_ATOMICS. We might add
 something like this and make the define be chosen according to configure
 flags (--disable-gcc-atomics). Or maybe we should even use a configure
 check to detect real support for GCC atomics on the target platform.
 users-h...@tomcat.apache.org


I switched the logic to better suit my needs, but that works:

#elif !defined(JK_NO_GCC_ATOMICS)  defined(__GNUC__)  (__GNUC__  4 ||
(__GNUC__ == 4  __GNUC_MINOR__ = 1))


So on our 32bit systems jk is built with:
CFLAGS='-DJK_NO_GCC_ATOMICS' ./configure --with-apxs=/opt/apache/bin/apxs

It would be nice if something like that (preferably a configure option)
would be built in. It would of course be even better if configure could
detect if gcc atomics work and decide whether to use them or not. Anyways,
thank you for your quick and very helpful response.

Falco


Re: Problems with tomcat-connectors-1.2.41 on 32bit linux

2015-08-25 Thread Rainer Jung

Am 25.08.2015 um 14:58 schrieb Falco Schwarz:

Hi there,

I tried to update the connectors to the most recent update but I am stuck
with error messages. Just a few background information on the
infrastructure used:

httpd: 2.2.31
OpenSSL: 1.0.2.d
mod_jk: 1.2.41

Kernel: 3.0.101-0.47.52-pae
OS: SLES 11 SP3 (32bit)
gcc: (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]

httpd configure: ./configure --prefix=/opt/apache
--sysconfdir=/opt/apache/build --enable-mods-shared=all ssl ldap cache
proxy authn_alias authnz_ldap dav_lock --with-mpm=prefork
--with-included-apr --with-pcre --with-ldap --with-ssl=/opt/apache/openssl

jk configure: ./configure --with-apxs=/opt/apache/bin/apxs

configure, make and install runs without any errors. If I try to startup
httpd though the following error occurs:

httpd: Syntax error on line 88 of /opt/apache/conf/alles/httpd.conf: Cannot
load /opt/apache/modules/mod_jk.so into server:
/opt/apache/modules/mod_jk.so: undefined symbol: __sync_add_and_fetch_4


When I added the use of atomics, I checked for the minimal GCC version 
to support it. At that time I didn't notice, that GCC originally had 
only support for some architectures, and for all other architectures 
compiles in a call to a function named __sync_add_and_fetch_4(), which 
it does not implement itself.


There's a couple of options:

- use a newer GCC, it might support x86 atomics. But I guess you'd like 
to stick to your SLES provided GCC, so this probably is not an option 
for you.


- As a workaround fall back to what APR provides as atomics. In file 
common/jk_global.h you could comment out the following lines with a 
leading //:


436 #elif defined(__GNUC__)  (__GNUC__  4 || (__GNUC__ == 4  
__GNUC_MINOR__ = 1))

437 #define JK_ATOMIC_INCREMENT(x) __sync_add_and_fetch(x, 1)
438 #define JK_ATOMIC_DECREMENT(x) \
439 do {\
440 if (__sync_sub_and_fetch(x, 1)  0) __sync_add_and_fetch(x, 1);\
441 } while (0)

or simply change the #elif line 436 e.g. to

#elif defined(JK_USE_GCC_ATOMICS)  defined(__GNUC__)  (__GNUC__  4 
|| (__GNUC__ == 4  __GNUC_MINOR__ = 1))



Since JK_USE_GCC_ATOMICS is not defined, the elif will be skipped and 
the next option (APR atomics) will be used, but you can later switch 
back to the GCC version by compiling with -DJK_USE_GCC_ATOMICS. We might 
add something like this and make the define be chosen according to 
configure flags (--disable-gcc-atomics). Or maybe we should even use a 
configure check to detect real support for GCC atomics on the target 
platform.


Let us know how it works.

Thanks for reporting the problem,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Problems with tomcat-connectors-1.2.41 on 32bit linux

2015-08-25 Thread Falco Schwarz
Hi there,

I tried to update the connectors to the most recent update but I am stuck
with error messages. Just a few background information on the
infrastructure used:

httpd: 2.2.31
OpenSSL: 1.0.2.d
mod_jk: 1.2.41

Kernel: 3.0.101-0.47.52-pae
OS: SLES 11 SP3 (32bit)
gcc: (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]

httpd configure: ./configure --prefix=/opt/apache
--sysconfdir=/opt/apache/build --enable-mods-shared=all ssl ldap cache
proxy authn_alias authnz_ldap dav_lock --with-mpm=prefork
--with-included-apr --with-pcre --with-ldap --with-ssl=/opt/apache/openssl

jk configure: ./configure --with-apxs=/opt/apache/bin/apxs

configure, make and install runs without any errors. If I try to startup
httpd though the following error occurs:

httpd: Syntax error on line 88 of /opt/apache/conf/alles/httpd.conf: Cannot
load /opt/apache/modules/mod_jk.so into server:
/opt/apache/modules/mod_jk.so: undefined symbol: __sync_add_and_fetch_4

It seems to be related to the atomic changes with 1.2.41, yet I cannot
figure out what I am missing here. Could anyone point me in the right
direction?

Regards,
Falco