You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Eryq <er...@zeegee.com> on 2001/07/31 22:52:50 UTC

RESOLVED: mod_webapp hanging/core-dumping on Solaris

When Pier told me that he'd never seen libhttpd.ep in his
own Apache directory, that gave me the first clue: my
Apache was somehow different from other Solaris builds.

Here's why.
Pursuant to this document: http://httpd.apache.org/docs/dso.html
I did this:

	./configure --enable-rule=SHARED_CORE ...

My advice: DO NOT DO THIS, at least not on Solaris with gcc.
Solaris dynaloading works fine without it.
For the benefit of others, here is my setup.
I set up this environment (tcsh syntax):

	setenv CC gcc
	setenv LD_SHLIB gcc
	setenv CFLAGS "-g -fPIC"
	setenv CFLAGS_SHLIB "-g -fPIC"

Then ran this Apache config:

	./configure \
	"--with-layout=Apache" \
	"--prefix=/export/home/cs/depot/package/apache_1.3.20" \
	"--enable-module=rewrite" "--enable-shared=rewrite" \
	"--enable-module=so" \
	"$@"

Then a "make" and "make install".
The produces a libexec directory containing:

	httpd.exp
	mod_rewrite.so

I then used "apxs -g" to create a bogus little loadable
against this, and installed it.  It worked fine.
Finally, on to mod_webapp.so, and that worked fine.

LESSONS LEARNED, for the benefit of those whose
warp connections are causing core dumps:

1. Always use gcc.  Always use gcc.  Always use gcc.
   Why?  Because it's the lowest common denominator.
   Because the developers are building/testing with it.
   Because ./configure likes it.  Always use gcc.

2. Remember that ./configure scripts pay attention
   to **environment variables** as well as command-line
   options.  This is evil and confusing, but that's
   reality for you.  Setenv CC, LD, etc.

	a. Use gcc as the linker, not ld.
	b. Make sure -fPIC is in the CFLAGS.

3. Look at "apxs" and make sure it matches those
   aforementioned environment variables EXACTLY.
   Especially look at the "LD" variables.

4. You don't need to use SHARED_CORE on Solaris 5.8
   with mod_webapp.

5. After the 3rd recompile, "rm -rf" and start over.
   You never know what garbage is lying around
   that "make distclean" didn't get rid of. 

Perhaps some of these advicelets are unnecessary,
but the combination worked for me.
Thanks to all who helped. 

Eryq

Re: RESOLVED: mod_webapp hanging/core-dumping on Solaris

Posted by "Pier P. Fumagalli" <pi...@betaversion.org>.
Thom Park at tpark@borland.com wrote:

> Hello!
> 
> My tuppence worth on one comment here:
> 
>> 1. Always use gcc.  Always use gcc.  Always use gcc.
>  Why?  Because it's the lowest common denominator.
>  Because the developers are building/testing with it.
>  Because ./configure likes it.  Always use gcc.
> 
> Only do this if your absolutely guaranteed that any libraries that you
> link with have not been compiled with Sun's native C++ compiler ;-)
> 
> There is serious grief in store trying to resolve name-mangled symbols
> between gcc and a C++ library (even with extern "C" used).
> 
> I learned this the hardway :(

If there's a problem with Sun's C++, I bet it's in APR (as mod_webapp relies
100% on it). And it can be fixed (here or there). And I don't quite get why
Sun's and GCC aren't interoperable... They should both spit out ELF on
Solaris...

> Apart from that - excellent job on debugging!

FUCK YEAH... (Ok, I can be somehow happy at this point)

Guys, we need to shoot at the bug I filed today... #2933... It's the only
step which still forbids me to put out a beta-1... :) Can you please check
if it's my setup or it can be reproduced also on yours?

    Pier


RE: RESOLVED: mod_webapp hanging/core-dumping on Solaris

Posted by Thom Park <tp...@borland.com>.
Hello!

My tuppence worth on one comment here:

>1. Always use gcc.  Always use gcc.  Always use gcc.
   Why?  Because it's the lowest common denominator.
   Because the developers are building/testing with it.
   Because ./configure likes it.  Always use gcc.

Only do this if your absolutely guaranteed that any libraries that you
link with have not been compiled with Sun's native C++ compiler ;-)

There is serious grief in store trying to resolve name-mangled symbols
between gcc and a C++ library (even with extern "C" used).

I learned this the hardway :(

Apart from that - excellent job on debugging!

-Thom


Re: RESOLVED: mod_webapp hanging/core-dumping on Solaris

Posted by "Pier P. Fumagalli" <pi...@betaversion.org>.
YEAH! I know there was something wrong with your Apache installation...
Now, we shouldn't have problems also with SHARED_CORE, but now at least I
know what to tackle...

Can you do me another favor and confirm (or not) bug # 2933?

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2933

Thanks :)

    Pier


Eryq at eryq@zeegee.com wrote:

> When Pier told me that he'd never seen libhttpd.ep in his
> own Apache directory, that gave me the first clue: my
> Apache was somehow different from other Solaris builds.
> 
> Here's why.
> Pursuant to this document: http://httpd.apache.org/docs/dso.html
> I did this:
> 
> ./configure --enable-rule=SHARED_CORE ...
> 
> My advice: DO NOT DO THIS, at least not on Solaris with gcc.
> Solaris dynaloading works fine without it.
> For the benefit of others, here is my setup.
> I set up this environment (tcsh syntax):
> 
> setenv CC gcc
> setenv LD_SHLIB gcc
> setenv CFLAGS "-g -fPIC"
> setenv CFLAGS_SHLIB "-g -fPIC"
> 
> Then ran this Apache config:
> 
> ./configure \
> "--with-layout=Apache" \
> "--prefix=/export/home/cs/depot/package/apache_1.3.20" \
> "--enable-module=rewrite" "--enable-shared=rewrite" \
> "--enable-module=so" \
> "$@"
> 
> Then a "make" and "make install".
> The produces a libexec directory containing:
> 
> httpd.exp
> mod_rewrite.so
> 
> I then used "apxs -g" to create a bogus little loadable
> against this, and installed it.  It worked fine.
> Finally, on to mod_webapp.so, and that worked fine.
> 
> LESSONS LEARNED, for the benefit of those whose
> warp connections are causing core dumps:
> 
> 1. Always use gcc.  Always use gcc.  Always use gcc.
>  Why?  Because it's the lowest common denominator.
>  Because the developers are building/testing with it.
>  Because ./configure likes it.  Always use gcc.
> 
> 2. Remember that ./configure scripts pay attention
>  to **environment variables** as well as command-line
>  options.  This is evil and confusing, but that's
>  reality for you.  Setenv CC, LD, etc.
> 
> a. Use gcc as the linker, not ld.
> b. Make sure -fPIC is in the CFLAGS.
> 
> 3. Look at "apxs" and make sure it matches those
>  aforementioned environment variables EXACTLY.
>  Especially look at the "LD" variables.
> 
> 4. You don't need to use SHARED_CORE on Solaris 5.8
>  with mod_webapp.
> 
> 5. After the 3rd recompile, "rm -rf" and start over.
>  You never know what garbage is lying around
>  that "make distclean" didn't get rid of.
> 
> Perhaps some of these advicelets are unnecessary,
> but the combination worked for me.
> Thanks to all who helped.
> 
> Eryq