[prev in list] [next in list] [prev in thread] [next in thread]
List: xalan-c-users
Subject: RE: Dynamic loading of Xalan library on Solaris
From: thomas.cherel () ascentialsoftware ! com
Date: 2002-09-24 14:43:34
[Download RAW message or body]
I submitted the problem to some of our software engineering guys. I got the
two following answers, not to compute NaN but to avoid the error message:
- calling signal() to ignore SIGFPE (floating point exception) and setting
errno to 0 after sqrt() call.
- Worst case scenario: backup stderr handle, redirect stderr to /dev/null,
compute sqrt(-2.01), restore stderr.
Not sure if it can help, but just in case.
Thomas
-----Original Message-----
From: thomas.cherel@ascentialsoftware.com
[mailto:thomas.cherel@ascentialsoftware.com]
Sent: Monday, September 23, 2002 12:22 PM
To: xalan-c-users@xml.apache.org
Subject: RE: Dynamic loading of Xalan library on Solaris
I understand. Thanks for the feedback.
The application is working fine so it is not really critical. The error
message appears in a log file that the user can look at so we will have to
document this error properly as being harmless.
Thomas
-----Original Message-----
From: David N Bertoni/Cambridge/IBM [mailto:david_n_bertoni@us.ibm.com
<mailto:david_n_bertoni@us.ibm.com> ]
Sent: Monday, September 23, 2002 12:12 PM
To: xalan-c-users@xml.apache.org
Subject: RE: Dynamic loading of Xalan library on Solaris
Well, from a standalone application, the run-time is probably initialized
correctly, or the "error" is masked as it should be. It's the fact that
you're loading the library dynamically that's different, and why you're
seeing the error message.
By the way, I cannot yet find a way to make this work on Solaris, without
using sqrt(), so you may have to live with this behavior for a while.
Dave
thomas.cherel@ascentials
oftware.com To:
xalan-c-users@xml.apache.org
cc: (bcc: David
N Bertoni/Cambridge/IBM)
09/23/2002 09:10 AM Subject: RE: Dynamic
loading of Xalan library on Solaris
Great, good news for me (not in our code) :-).
It is still puzzling to me as we tried to reproduce the problem out of the
scope of our application using a stand alone Xalan executable doing dynamic
loading, trying to be as similar as possible as what we do in the real
application, and we were never able to reproduce the problem.
Thomas
-----Original Message-----
From: David N Bertoni/Cambridge/IBM [mailto:david_n_bertoni@us.ibm.com
<mailto:david_n_bertoni@us.ibm.com> ]
Sent: Monday, September 23, 2002 11:52 AM
To: xalan-c-users@xml.apache.org
Subject: Re: Dynamic loading of Xalan library on Solaris
Well, that is a problem with the Xalan library, although it's really an
underlying bug in Sun's run-time.
Xalan uses the sqrt() function to determine the value of NaN when it starts
up by calling the function with a negative number. This is supposed to fail
silently and return the correct number according to the ANSI standard. We
have a similar problem on AIX which was fixed in the 1.4 release.
Unfortunately, nobody has ever reported the problem on Solaris, so I didn't
think it was a problem.
I'll try to figure out how to do this on Solaris and post back a patch to
the list. You'll have to re-build the library yourself to integrate the
patch.
This is a real shame, because it was a platform-independent method to
determine this value, but now there's another platform that's messing it up.
Dave
thomas.cherel@ascentials
oftware.com To:
xalan-c-users@xml.apache.org
cc: (bcc: David
N Bertoni/Cambridge/IBM)
09/23/2002 08:06 AM Subject: Dynamic
loading of Xalan library on Solaris
This is a little bit of a shot in the dark, but I just wanted to know if
anyone experienced similar problems.
We currently have a native application (let's call it application A) running
on Solaris 2.7/2.8. This application can be "Extended" by adding new
components developed using a C/C++ API and delivered as shared libraries
(.so). For each new component, one .so file is delivered (let's call it
component.so).
The sequence of event that is performed is the following:
- Application A is started.
- One a specific user action, component.so is explicitly dynamically loaded
by Application A (dl_open and others on the component.so).
What we did was to create a new component using XalanC. The component.so is
dynamically linked with the XalanC libraries and at runtime, XalanC
libraries are available in the LD_LIBRARY_PATH of Application A (the dynamic
loader will load those libraries by itself).
Everything is actually working fine, except that we get a weird error
message when component.so is dynamically loaded: "Square root of negative
number". It seems to be harmless since everything works fine, Xalan can be
invoked and it is working.
With any other component.so not linked with (and not using) Xalan libraries,
we do not have this problem. I am not yet 100% convinced that the problem is
really coming from Xalan libraries, but I wanted to submit the question to
the mailing list, just in case anyone might have an idea.
Thanks.
Thomas
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=485422614-24092002><FONT face=Arial color=#0000ff size=2>I
submitted the problem to some of our software engineering guys. I got
the two following answers, not to compute NaN but to avoid the error
message:</FONT></SPAN></DIV>
<DIV><SPAN class=485422614-24092002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=485422614-24092002><FONT face=Arial color=#0000ff size=2>-
</FONT></SPAN><FONT face=Arial color=#0000ff size=2><FONT face=Arial
color=#0000ff size=2><SPAN class=218365613-24092002>calling signal() to ignore
SIGFPE (floating point exception) and setting errno to 0 after sqrt()
call.</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><FONT face=Arial color=#0000ff
size=2><SPAN class=218365613-24092002></SPAN></FONT></FONT> </DIV>
<DIV><SPAN class=218365613-24092002><SPAN class=485422614-24092002><FONT
face=Arial color=#0000ff size=2>- </FONT><SPAN class=265133413-24092002><FONT
face=Arial><FONT color=#0000ff><FONT size=2>Worst case scenario: backup stderr
handle, redirect stderr to /dev/null, compute sqrt(-2.01), restore
stderr.</FONT></FONT></FONT></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=218365613-24092002><SPAN class=485422614-24092002><SPAN
class=265133413-24092002><FONT face=Arial><FONT color=#0000ff><FONT
size=2></FONT></FONT></FONT></SPAN></SPAN></SPAN> </DIV>
<DIV><SPAN class=218365613-24092002><SPAN class=485422614-24092002><SPAN
class=265133413-24092002><FONT face=Arial><FONT color=#0000ff><FONT size=2>Not
sure if it can help, but just in
case.</FONT></FONT></FONT></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=218365613-24092002><SPAN class=485422614-24092002><SPAN
class=265133413-24092002><FONT face=Arial><FONT color=#0000ff><FONT
size=2></FONT></FONT></FONT></SPAN></SPAN></SPAN> </DIV>
<DIV><SPAN class=218365613-24092002><SPAN class=485422614-24092002><SPAN
class=265133413-24092002><FONT face=Arial><FONT color=#0000ff><FONT
size=2>Thomas</FONT></FONT></FONT></SPAN></SPAN></SPAN></DIV><FONT face=Tahoma>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=485422614-24092002></SPAN></FONT> </DIV>
<DIV><FONT size=2><SPAN class=485422614-24092002> </SPAN>-----Original
Message-----<BR><B>From:</B> thomas.cherel@ascentialsoftware.com
[mailto:thomas.cherel@ascentialsoftware.com] <BR><B>Sent:</B> Monday, September
23, 2002 12:22 PM<BR><B>To:</B> xalan-c-users@xml.apache.org<BR><B>Subject:</B>
RE: Dynamic loading of Xalan library on Solaris<BR><BR></DIV></FONT></FONT>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px"><BR>
<P><FONT size=2>I understand. Thanks for the feedback.</FONT> <BR><FONT
size=2>The application is working fine so it is not really critical. The error
message appears in a log file that the user can look at so we will have to
document this error properly as being harmless.</FONT></P>
<P><FONT size=2>Thomas</FONT> </P>
<P><FONT size=2>-----Original Message-----</FONT> <BR><FONT size=2>From: David
N Bertoni/Cambridge/IBM [<A
href="mailto:david_n_bertoni@us.ibm.com">mailto:david_n_bertoni@us.ibm.com</A>]
</FONT><BR><FONT size=2>Sent: Monday, September 23, 2002 12:12 PM</FONT>
<BR><FONT size=2>To: xalan-c-users@xml.apache.org</FONT> <BR><FONT
size=2>Subject: RE: Dynamic loading of Xalan library on Solaris</FONT>
</P><BR><BR><BR><BR><BR><BR>
<P><FONT size=2>Well, from a standalone application, the run-time is probably
initialized correctly, or the "error" is masked as it should be. It's
the fact that you're loading the library dynamically that's different, and why
you're seeing the error message.</FONT></P>
<P><FONT size=2>By the way, I cannot yet find a way to make this work on
Solaris, without using sqrt(), so you may have to live with this behavior for
a while.</FONT></P>
<P><FONT size=2>Dave</FONT> </P><BR><BR>
<P><FONT
size=2>   \
; & \
nbsp; &nb \
sp;   \
; & \
nbsp; &nb \
sp;   \
; & \
nbsp; &nb \
sp; \
</FONT></P>
<P><FONT
size=2> \
thomas.cherel@ascentials \
&n \
bsp; &nbs \
p; \
&n \
bsp; &nbs \
p; \
</FONT></P>
<P><FONT
size=2> \
oftware.com \
To:
xalan-c-users@xml.apache.org &n \
bsp; &nbs \
p; \
</FONT></P>
<P><FONT
size=2>   \
; & \
nbsp; \
cc: (bcc: David N
Bertoni/Cambridge/IBM) &n \
bsp; &nbs \
p; \
</FONT></P>
<P><FONT
size=2> \
09/23/2002 09:10
AM
Subject: RE: Dynamic loading of Xalan library on
Solaris   \
; \
</FONT></P>
<P><FONT
size=2>   \
; & \
nbsp; &nb \
sp;   \
; & \
nbsp; &nb \
sp;   \
; & \
nbsp; &nb \
sp; \
</FONT></P>
<P><FONT
size=2>   \
; & \
nbsp; &nb \
sp;   \
; & \
nbsp; &nb \
sp;   \
; & \
nbsp; &nb \
sp; \
</FONT></P><BR><BR><BR><BR><BR>
<P><FONT size=2>Great, good news for me (not in our code) :-).</FONT> </P><BR>
<P><FONT size=2>It is still puzzling to me as we tried to reproduce the
problem out of the scope of our application using a stand alone Xalan
executable doing dynamic loading, trying to be as similar as possible as what
we do in the real application, and we were never able to reproduce the
problem.</FONT></P><BR>
<P><FONT size=2>Thomas</FONT> </P><BR>
<P><FONT size=2>-----Original Message-----</FONT> <BR><FONT size=2>From: David
N Bertoni/Cambridge/IBM [<A
href="mailto:david_n_bertoni@us.ibm.com">mailto:david_n_bertoni@us.ibm.com</A>]</FONT> \
<BR><FONT size=2>Sent: Monday, September 23, 2002 11:52 AM</FONT> <BR><FONT
size=2>To: xalan-c-users@xml.apache.org</FONT> <BR><FONT size=2>Subject: Re:
Dynamic loading of Xalan library on Solaris</FONT>
</P><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<P><FONT size=2>Well, that is a problem with the Xalan library, although it's
really an underlying bug in Sun's run-time.</FONT> </P><BR>
<P><FONT size=2>Xalan uses the sqrt() function to determine the value of NaN
when it starts up by calling the function with a negative number. This
is supposed to fail silently and return the correct number according to the
ANSI standard. We have a similar problem on AIX which was fixed in the 1.4
release. Unfortunately, nobody has ever reported the problem on Solaris, so I
didn't think it was a problem.</FONT></P><BR>
<P><FONT size=2>I'll try to figure out how to do this on Solaris and post back
a patch to the list. You'll have to re-build the library yourself to
integrate the patch.</FONT></P><BR>
<P><FONT size=2>This is a real shame, because it was a platform-independent
method to determine this value, but now there's another platform that's
messing it up.</FONT></P><BR>
<P><FONT size=2>Dave</FONT> </P><BR><BR><BR><BR><BR><BR><BR>
<P><FONT
size=2> \
thomas.cherel@ascentials</FONT> </P><BR>
<P><FONT
size=2> \
oftware.com \
To:</FONT> <BR><FONT size=2>xalan-c-users@xml.apache.org</FONT> </P><BR>
<P><FONT
size=2>   \
; & \
nbsp; \
cc: (bcc: David</FONT> <BR><FONT size=2>N
Bertoni/Cambridge/IBM)</FONT> </P><BR>
<P><FONT
size=2> \
09/23/2002 08:06
AM
Subject: Dynamic</FONT> <BR><FONT size=2>loading of Xalan library on
Solaris</FONT> </P><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<P><FONT size=2>This is a little bit of a shot in the dark, but I just wanted
to know if anyone experienced similar problems.</FONT> </P><BR><BR><BR><BR>
<P><FONT size=2>We currently have a native application (let's call it
application A) running on Solaris 2.7/2.8. This application can be "Extended"
by adding new components developed using a C/C++ API and delivered as shared
libraries (.so). For each new component, one .so file is delivered (let's call
it component.so).</FONT></P><BR><BR><BR><BR>
<P><FONT size=2>The sequence of event that is performed is the
following:</FONT> </P><BR>
<P><FONT size=2>- Application A is started.</FONT> <BR><FONT size=2>- One a
specific user action, component.so is explicitly dynamically loaded by
Application A (dl_open and others on the
component.so).</FONT></P><BR><BR><BR><BR>
<P><FONT size=2>What we did was to create a new component using XalanC. The
component.so is dynamically linked with the XalanC libraries and at runtime,
XalanC libraries are available in the LD_LIBRARY_PATH of Application A (the
dynamic loader will load those libraries by
itself).</FONT></P><BR><BR><BR><BR>
<P><FONT size=2>Everything is actually working fine, except that we get a
weird error message when component.so is dynamically loaded: "Square root of
negative number". It seems to be harmless since everything works fine, Xalan
can be invoked and it is working.</FONT></P><BR><BR><BR><BR>
<P><FONT size=2>With any other component.so not linked with (and not using)
Xalan libraries, we do not have this problem. I am not yet 100% convinced that
the problem is really coming from Xalan libraries, but I wanted to submit the
question to the mailing list, just in case anyone might have an
idea.</FONT></P><BR><BR><BR><BR>
<P><FONT size=2>Thanks.</FONT> </P><BR><BR><BR><BR>
<P><FONT size=2>Thomas</FONT>
</P><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR></BLOCKQUOTE></BODY></HTML>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic