You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Brian T. Shelden" <sh...@shelden-associates.com> on 2004/07/27 20:20:29 UTC

Xalan, g++, AIX, and QNAN

Hi all,

I'm trying to build Xerces 2.8.0/Xalan 1.8.0 with g++ on
AIX 4.3.3.   I can't use vacpp because other parts of our
product use Xerces directly, and need to be built with g++.
(G++ and vacpp use different name mangling schemes.)

I know I'm on my own here, and I've made some progress, but
now I'm stumped.

I was sucessful in getting Xerces to compile with some code
and Makefile.incl tweaks.  Xalan needed a few tweaks as well.
(For reference, adding -l -lpthread to runConfigure didn't
work, even though it claimed it did.  I had to add -lpthread
to the EXTRA_LINK_OPTIONS by hand in the AIX section of
Makefile.incl.)

That gets me to DoubleSupport::s_NaN.  It looks like -- when
_AIX is defined -- s_NaN is supposed to set to DBL_QNAN, while
otherwise we use sqrt(-2.01).  However, when I try and compile
that, I get the following:

gmake[2]: Leaving directory `/home/shelden/xalan/c/src/xalanc/Utils'
g++ -g     -fno-elide-constructors -Wall -fPIC -DAIX -D_REENTRANT -DXALAN_INMEM_MSG_LOADER -c 
-I/home/shelden/xalan/c/src -I/home/shelden/xalan/c/include -I../../nls/include 
-I/home/shelden/xerces/src/ -I/home/shelden/xerces/include/xercesc -I/home/shelden/xerces/include/ 
-o ../../obj/DoubleSupport.o /home/shelden/xalan/c/src/xalanc/PlatformSupport/DoubleSupport.cpp
/home/shelden/xalan/c/src/xalanc/PlatformSupport/DoubleSupport.cpp:55: error: `
    DBL_QNAN' was not declared in this scope
gmake[1]: *** [../../obj/DoubleSupport.o] Error 1
gmake[1]: Leaving directory `/home/shelden/xalan/c/src/xalanc'
gmake: *** [all] Error 2
gamma::/home/shelden/xalan/c%

It looks like DBL_QNAN is in /usr/include/float.h, but #including
it doesn't seem to help.  Same error.  Perhaps a namespace issue?

I also tried substituting various things that all get it to compile,
0.0, sqrt(-2.01), etc.  But all of them suceed at compile time,
but at run time immediately produce an Illegal Instruction and
a core dump.  As if we're not getting a "Quiet" NaN as seems to
be the intention.

Any ideas?

Thanks,
-- 
--Brian T. Shelden           shelden@shelden-associates.com
Shelden & Associates, Inc.               New York, NY 10280
Certified MQSeries Specialists               (212) 786-0175

_________________________________________________________
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


Re: Xalan, g++, AIX, and QNAN

Posted by "Brian T. Shelden" <sh...@shelden-associates.com>.
> So it probably doesn't have anything to do with 
 > DoubleSupport::s_NaN.

Fair enough.

 > I see you're using AIX 4.3.3.  What version of GCC are
 > you using?

3.3.4.

-- 
--Brian T. Shelden           shelden@shelden-associates.com
Shelden & Associates, Inc.               New York, NY 10280
Certified MQSeries Specialists               (212) 786-0175

_________________________________________________________
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


Re: Xalan, g++, AIX, and QNAN

Posted by da...@us.ibm.com.
> Sorry to follow up on my own post, but:
>
> >> Even initializing to 0.0 causes a core dump?  That seems very bizarre.
> >> Have you confirmed it's dumping during C++ static initialization, when
> >> DoubleSupport::s_NaN is initialized?
> >
> >
> > If you tell me how to do this, I can answer this for you.
> >
> > I do know that AIX dbx is not happy with the core dump or
> > the executable.  It gets pages of internal errors.  Building
> > gdb right now.
>
> GDB is unhappy too:
> (gdb) gamma::/home/shelden/xalan/c% gdb bin/Xalan core
> GNU gdb 6.1
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
are
> welcome to change it and/or distribute copies of it under certain
conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for
details.
> This GDB was configured as "powerpc-ibm-aix4.3.3.0"...
> Core was generated by `Xalan'.
> Program terminated with signal 4, Illegal instruction.
> Recursive internal problem.
> Abort process (core dumped)
>
> Both with QNAN and with 0.0.

So it probably doesn't have anything to do with DoubleSupport::s_NaN.  I
see you're using AIX 4.3.3.  What version of GCC are you using?

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


Re: Xalan, g++, AIX, and QNAN

Posted by "Brian T. Shelden" <sh...@shelden-associates.com>.
Sorry to follow up on my own post, but:

>> Even initializing to 0.0 causes a core dump?  That seems very bizarre.
>> Have you confirmed it's dumping during C++ static initialization, when
>> DoubleSupport::s_NaN is initialized? 
> 
> 
> If you tell me how to do this, I can answer this for you.
> 
> I do know that AIX dbx is not happy with the core dump or
> the executable.  It gets pages of internal errors.  Building
> gdb right now.

GDB is unhappy too:
(gdb) gamma::/home/shelden/xalan/c% gdb bin/Xalan core
GNU gdb 6.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-ibm-aix4.3.3.0"...
Core was generated by `Xalan'.
Program terminated with signal 4, Illegal instruction.
Recursive internal problem.
Abort process (core dumped)

Both with QNAN and with 0.0.

-- 
--Brian T. Shelden           shelden@shelden-associates.com
Shelden & Associates, Inc.               New York, NY 10280
Certified MQSeries Specialists               (212) 786-0175

_________________________________________________________
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


Re: Xalan, g++, AIX, and QNAN

Posted by "Brian T. Shelden" <sh...@shelden-associates.com>.

david_n_bertoni@us.ibm.com wrote:
> If you can feed back the respective changes to the Xerces-C team, and to
> us, that would be great.

I will.  Let me get everything working -- our apps, Xalan, on all
our supported platforms -- and I'll write it up.  My client has
asked for that writeup anyway, in case I get hit by a bus.

> /home/shelden/xalan/c/src/xalanc/PlatformSupport/DoubleSupport.cpp
> 
>>/home/shelden/xalan/c/src/xalanc/PlatformSupport/DoubleSupport.cpp:55:
> 
> error: `
> 
>>    DBL_QNAN' was not declared in this scope
>>gmake[1]: *** [../../obj/DoubleSupport.o] Error 1
>>gmake[1]: Leaving directory `/home/shelden/xalan/c/src/xalanc'
>>gmake: *** [all] Error 2
>>gamma::/home/shelden/xalan/c%
>>
>>It looks like DBL_QNAN is in /usr/include/float.h, but #including
>>it doesn't seem to help.  Same error.  Perhaps a namespace issue?
> 
> Are you sure GCC is using those header files?

Ah.  It wasn't.  It was using the fixincluded one instead, which
does not have the DBL_QNAN constant.

If I #include "/usr/include/float.h" before the namespace
declaration, it complies.  Yay!

'Course Xalan still crashes immediately with the illegal
instruction core dump.

>>I also tried substituting various things that all get it to compile,
>>0.0, sqrt(-2.01), etc.  But all of them suceed at compile time,
>>but at run time immediately produce an Illegal Instruction and
>>a core dump.  As if we're not getting a "Quiet" NaN as seems to
>>be the intention.
 >
> Even initializing to 0.0 causes a core dump?  That seems very bizarre.
> Have you confirmed it's dumping during C++ static initialization, when
> DoubleSupport::s_NaN is initialized? 

If you tell me how to do this, I can answer this for you.

I do know that AIX dbx is not happy with the core dump or
the executable.  It gets pages of internal errors.  Building
gdb right now.

FWIW, I am just trying to get a usage out of bin/Xalan from
my $XALANCROOT, I'm not trying to actually use anything, so
I suspect it's during C++ static initilization as you say.

 > If so, I'm already considering a patch where we initialize
 > that after the library is loaded.  If you want to
> try to test that patch, I can provide it when it's ready.

Sure.  Please send it along.

-- 
--Brian T. Shelden           shelden@shelden-associates.com
Shelden & Associates, Inc.               New York, NY 10280
Certified MQSeries Specialists               (212) 786-0175

_________________________________________________________
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


Re: Xalan, g++, AIX, and QNAN

Posted by da...@us.ibm.com.
> I was sucessful in getting Xerces to compile with some code
> and Makefile.incl tweaks.  Xalan needed a few tweaks as well.
> (For reference, adding -l -lpthread to runConfigure didn't
> work, even though it claimed it did.  I had to add -lpthread
> to the EXTRA_LINK_OPTIONS by hand in the AIX section of
> Makefile.incl.)

If you can feed back the respective changes to the Xerces-C team, and to
us, that would be great.

> gmake[2]: Leaving directory `/home/shelden/xalan/c/src/xalanc/Utils'
> g++ -g     -fno-elide-constructors -Wall -fPIC -DAIX -D_REENTRANT
-DXALAN_INMEM_MSG_LOADER -c
> -I/home/shelden/xalan/c/src -I/home/shelden/xalan/c/include
-I../../nls/include
> -I/home/shelden/xerces/src/ -I/home/shelden/xerces/include/xercesc
-I/home/shelden/xerces/include/
> -o ../../obj/DoubleSupport.o
/home/shelden/xalan/c/src/xalanc/PlatformSupport/DoubleSupport.cpp
> /home/shelden/xalan/c/src/xalanc/PlatformSupport/DoubleSupport.cpp:55:
error: `
>     DBL_QNAN' was not declared in this scope
> gmake[1]: *** [../../obj/DoubleSupport.o] Error 1
> gmake[1]: Leaving directory `/home/shelden/xalan/c/src/xalanc'
> gmake: *** [all] Error 2
> gamma::/home/shelden/xalan/c%
>
> It looks like DBL_QNAN is in /usr/include/float.h, but #including
> it doesn't seem to help.  Same error.  Perhaps a namespace issue?

Are you sure GCC is using those header files?

> I also tried substituting various things that all get it to compile,
> 0.0, sqrt(-2.01), etc.  But all of them suceed at compile time,
> but at run time immediately produce an Illegal Instruction and
> a core dump.  As if we're not getting a "Quiet" NaN as seems to
> be the intention.

Even initializing to 0.0 causes a core dump?  That seems very bizarre.
Have you confirmed it's dumping during C++ static initialization, when
DoubleSupport::s_NaN is initialized?  If so, I'm already considering a
patch where we initialize that after the library is loaded.  If you want to
try to test that patch, I can provide it when it's ready.

Thanks!

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org