You are viewing a plain text version of this content. The canonical link for it is here.
Posted to p-dev@xerces.apache.org by Steve Mathias <sm...@unm.edu> on 2003/10/11 01:09:57 UTC

Similar make test error

Hello,

I am getting similar errors on 'make test' to what was reported earlier
by Kai.  For me, every single test fails with the message:

Can't load '/usr/local/src/perl/XML-Xerces-2.3.0-1/blib/arch/auto/XML/Xerces/Xerces.so' for module XML::Xerces: /usr/local/src/perl/XML-Xerces-2.3.0-1/blib/arch/auto/XML/Xerces/Xerces.so: undefined symbol: isAnySlash__Q211xercesc_2_316XMLPlatformUtilsUs at /usr/local/lib/perl5/5.6.1/i686-linux/DynaLoader.pm line 206.
 at /usr/local/src/perl/XML-Xerces-2.3.0-1/blib/lib/XML/Xerces.pm line 7

I'm using xerces-c version 2_3_0 which I built myself with gcc version
2.96 (I've tried a couple of the samples and they run fine) and xerces-p
version 2.3.0-1.

My system details are as follows:

# uname -a
Linux poblano.health.unm.edu 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown
# perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.2-2, archname=i686-linux

Steve
-- 
(    Stephen L. Mathias, Ph.D.                     (                    (
 )   Office of Biocomputing                         )  s m a t h i a s   )
(    University of New Mexico School of Medicine   (   @ p o b l a n o  (
 )   MSC08 4560                                     )  . h e a l t h .   )
(    1 University of New Mexico                    (   u n m . e d u    (
 )   Albuquerque, NM 87131-0001                     )                    )

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


Schema Support Issues

Posted by Steve Mathias <sm...@unm.edu>.
Hi Jason,

>>>>> "Jason" == Jason E Stewart <ja...@openinformatics.com> writes:

Jason> Hmmm.. In all honesty schema support is the not a very well
Jason> tested feature of Xerces.pm. If you don't need schemas, this will
Jason> not affect you. If you do, then please test them better than I
Jason> have - and let me know if anything breaks.

Unfortunately, I do need schema support: I'm developing a web service
that returns XML and I want to validate that XML against a schema before
sending it out.  This is what led me to investigating and installing
xerces-p to begin with.

It seems that schema support does work, although there are definitley
some weirdnesses involved ;-) I think these are mostly due to issues
related to SWIG and/or XS framework, neither of which I am very familiar
with.  The attached script (xerces.pl) works for me and gives the same
results as the SAX2Count sample program from xerces-c (see below for a
minor exception to this) with both valid and invalid documents.

The biggest problem I had was in figuring out a way to handle parsing
invalid documents gracefully.  This is crucial for me, since I plan to
be calling the parser from a web service server that I obviously do not
want to die.  When given an invalid document, the parser does something
bizarre until it runs out of memory.  I can get around the out of memory
problem by setting the
http://apache.org/xml/features/validation-error-as-fatal feature to
true.  The parser still seg faults, but things are recoverable from the
perspective of the script.  The problem then was that when I tried to
reuse the perl parser object, it thought the parser was still parsing.
To get around this, I'm re-initializing a new parser whenever a parsing
error is encountered.  

This seems to work with my documents and schema, but I'm not very
comfortable with it because I tried to write a test script for Xerces.pm
based on all of the above and no matter what I do, I can't seem to get
around the out of memory error.  This was using personal-schema.xml and
personal.xsd in the XML-Xerces-2.3.0-1/samples directory.  I don't have
any other schema to test with handy, so I don't know if it's an accident
that mine works or that yours doesn't.  Or maybe something is up with
your schema and/or referencing it from the document.  I'm no XML schema
expert.

Regarding the minor exception referred to above, it seems that when
parsing multiple documents the counts in the content handler are not
reset between documents.  The problem can be demonstrated as follows:

# SAX2Count -v=always -f seqdb_9921.xml
seqdb_9921.xml: 230 ms (44 elems, 2 attrs, 902 spaces, 3070 chars)
# cat > foo.list
seqdb_9921.xml
seqdb_9921.xml
^D
# SAX2Count -v=always -f -l foo.list   
==Parsing== seqdb_9921.xml
seqdb_9921.xml: 42 ms (44 elems, 2 attrs, 902 spaces, 3070 chars)
==Parsing== seqdb_9921.xml
seqdb_9921.xml: 37 ms (88 elems, 4 attrs, 1804 spaces, 6140 chars)

I don't know whether or not this is a "feature" of SAX2Count, although I
doubt it since it is not the behaviour displayed by either SAXCount or
DOMCount.  It is certainly not what I expected.  Maybe that's something
for the xerces-c crew?

Anyway, hope some of this is useful.

Cheers,
Steve


Re: Similar make test error

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
Steve Mathias <sm...@unm.edu> writes:

> ...so, not surprisingly, there's still no symbol definition:
> 
> # nm -C /usr/local/xerces-c-src_2_3_0/lib/libxerces-c.so.23.0 | grep -i isanyslash

very strange... The only thing that I can think of is that it is a
gcc-2.96 issue...

> That solves the problem.  The module loads and the vast majority of the
> tests pass.

Good. I'll release a new version with this fix ASAP. Thanks.

> I still have a couple of failing tests, though.  Here's the 'make test'
> summary:
> 
> Failed Test       Stat Wstat Total Fail  Failed  List of Failed
> -------------------------------------------------------------------------------
> t/AttributeList.t  255 65280     8    6  75.00%  6-8
> t/Schema.t           0    11     3    0   0.00%  ??
> 12 subtests skipped.
> Failed 2/35 test scripts, 94.29% okay. 3/35353 subtests failed,
> 99.99% okay.

Good, looks like you've got a working version.

> Here's the verbose output from the failing tests:

Thanks for this, its quite helpful.

> # perl t/AttributeList.t 
> Using /usr/local/src/perl/XML-Xerces-2.3.0-1/blib
> 1..8
> ok 1 - module loaded
> ok 2
> ok 3
> ok 4
> <eagle scout>
> <eagle scout>
> ok 5
> No matching function for overloaded 'AttributeList_getValue' at /usr/local/src/perl/XML-Xerces-2.3.0-1/blib/lib/XML/Xerces.pm line 221.
> # Looks like you planned 8 tests but only ran 5.
> # Looks like your test died just after 5.

Huh. This seems bad. I'm baffled as to how this code is failing on
your install but not on mine. The error message is a SWIG runtime
error telling you that it was trying to decide which of two
identically named methods called getValue() it should invoke one that
takes and integer arg, and the other a string arg - since all perl
values can be stringified it should always work. I'm really confused.

> # perl t/Schema.t        
> 1..3
> ok 1 - module loaded
> ok 2
> ok 3
> Segmentation fault

Hmmm.. In all honesty schema support is the not a very well tested
feature of Xerces.pm. If you don't need schemas, this will not affect
you. If you do, then please test them better than I have - and let me
know if anything breaks.

> I'll do a little testing/coding of my own with it next week and I'll let
> you know how that goes.

Please do!

Cheers,
jas.

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


Re: Similar make test error

Posted by Steve Mathias <sm...@unm.edu>.
>>>>> "Jason" == Jason E Stewart <ja...@openinformatics.com> writes:

Jason> Steve Mathias <sm...@unm.edu> writes:
>> Yes, all the xerces-c sample programs run fine.

Jason> Great, thanks.

Jason> If so then please grep the library symbols using the commands I
Jason> sent to Kai, and lets see what's happenging there.
>>  Here's what I get:
>> 
>> # nm -C /usr/local/xerces-c-src_2_3_0/lib/libxerces-c.so | grep -i
>> isanyslash

Jason> Whoa!! Check your symbolic links. Here's what mine are:

Jason> lrwxrwxrwx 1 jasons jasons 60 2003-06-06 03:56 libxerces-c.so ->
Jason> /home/jasons/build/xerces-c-src_2_3_0//lib/libxerces-c.so.23
Jason> lrwxrwxrwx 1 jasons jasons 62 2003-06-06 03:56 libxerces-c.so.23
Jason> -> /home/jasons/build/xerces-c-src_2_3_0//lib/libxerces-c.so.23.0
Jason> -rwxr-xr-x 1 jasons jasons 18161188 2003-06-06 03:56
Jason> libxerces-c.so.23.0

The links are there...

# ls -lF /usr/local/xerces-c-src_2_3_0/lib/libxerces-c.so*
lrwxrwxrwx    1 root     root           51 Oct 10 15:48 /usr/local/xerces-c-src_2_3_0/lib/libxerces-c.so -> /usr/local/xerces-c-src_2_3_0/lib/libxerces-c.so.23*
lrwxrwxrwx    1 root     root           53 Oct 10 15:48 /usr/local/xerces-c-src_2_3_0/lib/libxerces-c.so.23 -> /usr/local/xerces-c-src_2_3_0/lib/libxerces-c.so.23.0*
-rwxr-xr-x    1 root     root      4616162 Oct 10 15:48 /usr/local/xerces-c-src_2_3_0/lib/libxerces-c.so.23.0*

Jason> The real library is libxerces-c.so.23.0, try running 'nm -C' on
Jason> it instead. If that *still* shows no result, then I'm royally
Jason> confused, because there's no conditional code around the
Jason> isAnySlash() method.

...so, not surprisingly, there's still no symbol definition:

# nm -C /usr/local/xerces-c-src_2_3_0/lib/libxerces-c.so.23.0 | grep -i isanyslash


>> How can I fix this?

Jason> One of the ways is for me to simply tell SWIG to *not* provide
Jason> this method - after all it's completely useless to Perl - it's
Jason> only used by the underlying C++ layer. My standard policy is to
Jason> only expose C++ API methods if they're useful to Perl
Jason> programmers. I can release 2.3.0-2 that will fix this, but I'm
Jason> concerned that there is a deeper problem going on.

Jason> Do this:

Jason> in Xerces.pm, comment out the isAnySlash definition (line 477):

Jason> *isAnySlash = *XML::Xercesc::XMLPlatformUtils_isAnySlash;

Jason> in Xerces.C,

Jason> - comment out the _wrap_XMLPlatformUtils_isAnySlash code (from
Jason> line 2997 to line 3031) - comment out the
Jason> _wrap_XMLPlatformUtils_isAnySlash definition (line 53393)

Jason> You can also delete them if you want. I've done this and it
Jason> compiles and runs for me. Let me know if this fixes your
Jason> problem. If so, I'll release a new version.

That solves the problem.  The module loads and the vast majority of the
tests pass.

I still have a couple of failing tests, though.  Here's the 'make test'
summary:

Failed Test       Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/AttributeList.t  255 65280     8    6  75.00%  6-8
t/Schema.t           0    11     3    0   0.00%  ??
12 subtests skipped.
Failed 2/35 test scripts, 94.29% okay. 3/35353 subtests failed, 99.99% okay.

Here's the verbose output from the failing tests:

# perl t/AttributeList.t 
Using /usr/local/src/perl/XML-Xerces-2.3.0-1/blib
1..8
ok 1 - module loaded
ok 2
ok 3
ok 4
<eagle scout>
<eagle scout>
ok 5
No matching function for overloaded 'AttributeList_getValue' at /usr/local/src/perl/XML-Xerces-2.3.0-1/blib/lib/XML/Xerces.pm line 221.
# Looks like you planned 8 tests but only ran 5.
# Looks like your test died just after 5.

# perl t/Schema.t        
1..3
ok 1 - module loaded
ok 2
ok 3
Segmentation fault

I'll do a little testing/coding of my own with it next week and I'll let
you know how that goes.

Steve
-- 
(    Stephen L. Mathias, Ph.D.                     (                    (
 )   Office of Biocomputing                         )  s m a t h i a s   )
(    University of New Mexico School of Medicine   (   @ p o b l a n o  (
 )   MSC08 4560                                     )  . h e a l t h .   )
(    1 University of New Mexico                    (   u n m . e d u    (
 )   Albuquerque, NM 87131-0001                     )                    )

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


Re: Similar make test error

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
Steve Mathias <sm...@unm.edu> writes:

> Yes, all the xerces-c sample programs run fine.

Great, thanks.

> Jason> If so then please grep the library symbols using the commands I
> Jason> sent to Kai, and lets see what's happenging there.
> 
> Here's what I get:
> 
> # nm -C /usr/local/xerces-c-src_2_3_0/lib/libxerces-c.so | grep -i isanyslash 

Whoa!! Check your symbolic links. Here's what mine are:

lrwxrwxrwx    1 jasons   jasons         60 2003-06-06 03:56 libxerces-c.so -> /home/jasons/build/xerces-c-src_2_3_0//lib/libxerces-c.so.23
lrwxrwxrwx    1 jasons   jasons         62 2003-06-06 03:56 libxerces-c.so.23 -> /home/jasons/build/xerces-c-src_2_3_0//lib/libxerces-c.so.23.0
-rwxr-xr-x    1 jasons   jasons   18161188 2003-06-06 03:56 libxerces-c.so.23.0

The real library is libxerces-c.so.23.0, try running 'nm -C' on it
instead. If that *still* shows no result, then I'm royally confused,
because there's no conditional code around the isAnySlash() method.

> How can I fix this? 

One of the ways is for me to simply tell SWIG to *not* provide this
method - after all it's completely useless to Perl - it's only used by
the underlying C++ layer. My standard policy is to only expose C++ API
methods if they're useful to Perl programmers. I can release 2.3.0-2
that will fix this, but I'm concerned that there is a deeper problem
going on.

Do this:

in Xerces.pm, comment out the isAnySlash definition (line 477):

   *isAnySlash = *XML::Xercesc::XMLPlatformUtils_isAnySlash;

in Xerces.C,

  - comment out the _wrap_XMLPlatformUtils_isAnySlash code (from
    line 2997 to line 3031) 
  - comment out the _wrap_XMLPlatformUtils_isAnySlash definition (line
    53393)

You can also delete them if you want. I've done this and it compiles
and runs for me. Let me know if this fixes your problem. If so, I'll
release a new version.

> Jason> PS. It's funny that your from UNM. Up until three months ago I
> Jason> lived at San Pedro and Zuni in sunny ABQ - but then I moved to
> Jason> India!
> 
> Yeah, I knew you had moved, but didn't realize how far!

Yes, I was never really able to make a connection at UNM - I was
hoping to be helpful to folks out there with MGED/MAGE and Genex, but
it never materialized. Then I got an opportunity to do bioinformatics
development out here in Bangalore, so I took the kids on an adventure!

Cheers,
jas.

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


Re: Similar make test error

Posted by Steve Mathias <sm...@unm.edu>.
>>>>> "Jason" == Jason E Stewart <ja...@openinformatics.com> writes:

Jason> Steve Mathias <sm...@unm.edu> writes:
>> I am getting similar errors on 'make test' to what was reported
>> earlier by Kai.  For me, every single test fails with the message:
>> 
>> Can't load
>> '/usr/local/src/perl/XML-Xerces-2.3.0-1/blib/arch/auto/XML/Xerces/Xerces.so'
>> for module XML::Xerces:
>> /usr/local/src/perl/XML-Xerces-2.3.0-1/blib/arch/auto/XML/Xerces/Xerces.so:
>> undefined symbol: isAnySlash__Q211xercesc_2_316XMLPlatformUtilsUs at
>> /usr/local/lib/perl5/5.6.1/i686-linux/DynaLoader.pm line 206.  at
>> /usr/local/src/perl/XML-Xerces-2.3.0-1/blib/lib/XML/Xerces.pm line 7
>> 
>> I'm using xerces-c version 2_3_0 which I built myself with gcc
>> version 2.96 (I've tried a couple of the samples and they run fine)
>> and xerces-p version 2.3.0-1.

Jason> I don't have gcc-2.96 to test this on, but I don't think the gcc
Jason> version is the issue here.

Jason> I'm assuming that you've tried to run DOMCount or some other
Jason> Xerces-C application just to ensure the libxerces.so is working
Jason> fine?

Yes, all the xerces-c sample programs run fine.

Jason> If so then please grep the library symbols using the commands I
Jason> sent to Kai, and lets see what's happenging there.

Here's what I get:

# nm -C /usr/local/xerces-c-src_2_3_0/lib/libxerces-c.so | grep -i isanyslash 

# nm -C
# /usr/local/src/perl/XML-Xerces-2.3.0-1/blib/arch/auto/XML/Xerces/Xerces.so
# | grep -i isanyslash
0005de34 T _wrap_XMLPlatformUtils_isAnySlash
         U xercesc_2_3::XMLPlatformUtils::isAnySlash(unsigned short)

So, I guess the error message is correct in reporting that the symbol is
undefined.  I'm in a little over my head with all this compiler/linking
stuff though.  How can I fix this? 

Jason> Cheers, jas.

Jason> PS. It's funny that your from UNM. Up until three months ago I
Jason> lived at San Pedro and Zuni in sunny ABQ - but then I moved to
Jason> India!

Yeah, I knew you had moved, but didn't realize how far!

Steve
-- 
(    Stephen L. Mathias, Ph.D.                     (                    (
 )   Office of Biocomputing                         )  s m a t h i a s   )
(    University of New Mexico School of Medicine   (   @ p o b l a n o  (
 )   MSC08 4560                                     )  . h e a l t h .   )
(    1 University of New Mexico                    (   u n m . e d u    (
 )   Albuquerque, NM 87131-0001                     )                    )

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


Re: Similar make test error

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
Steve Mathias <sm...@unm.edu> writes:

> I am getting similar errors on 'make test' to what was reported earlier
> by Kai.  For me, every single test fails with the message:
> 
> Can't load '/usr/local/src/perl/XML-Xerces-2.3.0-1/blib/arch/auto/XML/Xerces/Xerces.so' for module XML::Xerces: /usr/local/src/perl/XML-Xerces-2.3.0-1/blib/arch/auto/XML/Xerces/Xerces.so: undefined symbol: isAnySlash__Q211xercesc_2_316XMLPlatformUtilsUs at /usr/local/lib/perl5/5.6.1/i686-linux/DynaLoader.pm line 206.
>  at /usr/local/src/perl/XML-Xerces-2.3.0-1/blib/lib/XML/Xerces.pm line 7
> 
> I'm using xerces-c version 2_3_0 which I built myself with gcc version
> 2.96 (I've tried a couple of the samples and they run fine) and xerces-p
> version 2.3.0-1.

I don't have gcc-2.96 to test this on, but I don't think the gcc
version is the issue here.

I'm assuming that you've tried to run DOMCount or some other Xerces-C
application just to ensure the libxerces.so is working fine?

If so then please grep the library symbols using the commands I sent
to Kai, and lets see what's happenging there.

Cheers,
jas.

PS. It's funny that your from UNM. Up until three months ago I lived
at San Pedro and Zuni in sunny ABQ - but then I moved to India!

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