Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Errors building XML::LibXML

by atreyu (Sexton)
on Feb 25, 2014 at 14:04 UTC ( #1076139=perlquestion: print w/ replies, xml ) Need Help??
atreyu has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I'm having trouble building the XML::LibXML perl module (latest version on CPAN, 2.0110). I can do "make", but "make test" fails. Here's the relevant output:

+ /usr/bin/make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/01basic.t ............................ 1/3 # # # Compiled against libxml2 version: 20706 # Running libxml2 version: 20706 # t/01basic.t ............................ ok t/02parse.t ............................ Failed 343/531 subtests t/03doc.t .............................. Failed 91/193 subtests t/04node.t ............................. ok t/05text.t ............................. ok t/06elements.t ......................... ok t/07dtd.t .............................. Failed 21/38 subtests t/08findnodes.t ........................ Failed 45/45 subtests t/09xpath.t ............................ Failed 10/54 subtests t/10ns.t ............................... ok t/11memory.t ........................... skipped: developers only (set + MEMORY_TEST=1 to run these tests) t/12html.t ............................. Failed 42/43 subtests t/13dtd.t .............................. Failed 16/18 subtests t/14sax.t .............................. Failed 12/31 subtests t/15nodelist.t ......................... ok t/16docnodes.t ......................... ok t/17callbacks.t ........................ Failed 7/25 subtests t/18docfree.t .......................... ok t/19die_on_invalid_utf8_rt_58848.t ..... Failed 1/1 subtests t/19encoding.t ......................... ok t/20extras.t ........................... Failed 9/12 subtests t/21catalog.t .......................... Failed 1/1 subtests t/23rawfunctions.t ..................... ok t/24c14n.t ............................. ok t/25relaxng.t .......................... Failed 13/13 subtests t/26schema.t ........................... Failed 5/6 subtests t/27new_callbacks_simple.t ............. ok t/28new_callbacks_multiple.t ........... ok t/29id.t ............................... ok t/30keep_blanks.t ...................... ok t/30xpathcontext.t ..................... ok t/31xpc_functions.t .................... ok t/32xpc_variables.t .................... ok t/35huge_mode.t ........................ ok t/40reader.t ........................... Failed 99/100 subtests t/40reader_mem_error.t ................. ok t/41xinclude.t ......................... Failed 6/7 subtests t/42common.t ........................... ok t/43options.t .......................... ok t/44extent.t ........................... ok t/45regex.t ............................ ok t/46err_column.t ....................... ok t/47load_xml_callbacks.t ............... ok t/48_memleak_rt_83744.t ................ skipped: Test::LeakTrace is r +equired for memory leak tests. t/48_removeChild_crashes_rt_80395.t .... ok t/48_replaceNode_DTD_nodes_rT_80521.t .. ok t/48_RH5_double_free_rt83779.t ......... skipped: Test::LeakTrace is r +equired. t/48_rt55000.t ......................... ok t/48_SAX_Builder_rt_91433.t ............ ok t/48importing_nodes_IDs_rt_69520.t ..... ok t/49_load_html.t ....................... ok t/49callbacks_returning_undef.t ........ Failed 1/1 subtests t/49global_extent.t .................... ok t/50devel.t ............................ ok t/51_parse_html_string_rt87089.t ....... ok t/60error_prev_chain.t ................. No subtests run t/60struct_error.t ..................... ok t/61error.t ............................ ok t/62overload.t ......................... ok t/71overloads.t ........................ ok t/72destruction.t ...................... ok t/80registryleak.t ..................... ok t/90stack.t ............................ ok t/90threads.t .......................... skipped: optional (set THREAD +_TEST=1 to run these tests) t/91unique_key.t ....................... ok t/pod.t ................................ ok t/style-trailing-space.t ............... skipped: Test::TrailingSpace +required for trailing space test. Test Summary Report ------------------- t/02parse.t (Wstat: 11 Tests: 188 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 531 tests but ran 188. t/03doc.t (Wstat: 11 Tests: 102 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 193 tests but ran 102. t/07dtd.t (Wstat: 11 Tests: 17 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 38 tests but ran 17. t/08findnodes.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 45 tests but ran 0. t/09xpath.t (Wstat: 11 Tests: 44 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 54 tests but ran 44. t/12html.t (Wstat: 11 Tests: 1 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 43 tests but ran 1. t/13dtd.t (Wstat: 11 Tests: 2 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 18 tests but ran 2. t/14sax.t (Wstat: 11 Tests: 19 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 31 tests but ran 19. t/17callbacks.t (Wstat: 11 Tests: 18 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 25 tests but ran 18. t/19die_on_invalid_utf8_rt_58848.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 1 tests but ran 0. t/20extras.t (Wstat: 11 Tests: 3 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 12 tests but ran 3. t/21catalog.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 1 tests but ran 0. t/25relaxng.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 13 tests but ran 0. t/26schema.t (Wstat: 11 Tests: 1 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 6 tests but ran 1. t/40reader.t (Wstat: 11 Tests: 1 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 100 tests but ran 1. t/41xinclude.t (Wstat: 11 Tests: 1 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 7 tests but ran 1. t/49callbacks_returning_undef.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 1 tests but ran 0. t/60error_prev_chain.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: No plan found in TAP output Files=67, Tests=1779, 4 wallclock secs ( 0.31 usr 0.07 sys + 3.75 c +usr 0.33 csys = 4.46 CPU) Result: FAIL Failed 18/67 test programs. 0/1779 subtests failed. make: *** [test_dynamic] Error 255 error: Bad exit status from /var/tmp/rpm-tmp.Llj5oQ (%build)
I'm packaging this as an RPM so I really want/need the tests to pass.

I didn't see any errors during the configure portion. I did see this warning:

Warning: prerequisite ExtUtils::MakeMaker 6.56 not found. We have 6.5502

but I built the module on another box with the same version of ExtUtils::MakeMaker and that box (Fedora 16/i386) passed all the tests.

My build machine:

CentOS 6.5 / 2.6.32-431.1.2.0.1.el6.x86_64

I'm guessing/hoping that I'm just missing some sort of Test module, but it is not clear to me what that is. Thx in advance for any insight.

EDIT

See this update to this thread.

EDIT 2

I have just bumped up against this problem again and realize it was never resolved by anyone here. Any new eyes or new ideas?

The following is from my last post to this thread (now buried, but relevant):

I am getting a Segmentation fault at the end of the test. So I ran it through the perl debugger (as tye had initially suggested) and I get this:

Signal SEGV at XML-LibXML-2.0110/blib/lib/XML/LibXML.pm line 923 XML:: +LibXML::parse_file('XML::LibXML=HASH(0x1a60c38)', 'example/dromeds.xm +l') called at t/02parse.t line 221 Aborted [download]
Line 923 of file XML-LibXML-2.0110/blib/lib/XML/LibXML.pm contains:
eval { $result = $self->_parse_file(@_); };
thanks.

Comment on Errors building XML::LibXML
Select or Download Code
Re: Errors building XML::LibXML (source code)
by tye (Cardinal) on Feb 25, 2014 at 14:17 UTC

    You are aware that you have free access to all of the source code involved, right?

    Pick one of the failing tests (like the first one) and run it outside of the "harness" that hides all of the details:

    perl -Mblib t/02parse.­t 2>&1 | less

    Then, if needed, look at the source code in t/02parse.t and figure out why the particular failing test cases are failing. Then, if needed, look at the source code of the module that gets executed for the test and figure out what is causing the failure. Then, if needed, post questions about what you find to try to solicit help diagnosing.

    You can even combine the first 3 steps into one session by using the Perl debugger:

    perl -d -Mblib t/02parse.t

    Me looking at t/02parse.t trying to guess what might possibly cause 343 or its 531 subtests to fail sounds likely to be a particularly inefficient way to try to diagnose your problem.

    - tye        

      "You are aware that you have free access to all of the source code involved, right?"
      indeed, but alas, I am not a Perl Monk. I am more of a Perl Acolyte wannabe. I did try to run that very test manually, but could not make sense of the output. Here's a sample:
      perl -Mblib t/02parse.t 1..531 ok 1 - The object isa XML::LibXML::Document ok 2 - The object isa XML::LibXML::Document ok 3 - The object isa XML::LibXML::Document ok 4 - The object isa XML::LibXML::Document ok 5 - The object isa XML::LibXML::Document ok 6 - The object isa XML::LibXML::Document ok 7 - The object isa XML::LibXML::Document ok 8 - The object isa XML::LibXML::Document ok 9 - The object isa XML::LibXML::Document ok 10 - The object isa XML::LibXML::Document ok 11 - The object isa XML::LibXML::Document ok 12 - The object isa XML::LibXML::Document ok 13 - The object isa XML::LibXML::Document ok 14 - The object isa XML::LibXML::Document ok 15 - The object isa XML::LibXML::Document ok 16 - The object isa XML::LibXML::Document ok 17 - The object isa XML::LibXML::Document ok 18 - The object isa XML::LibXML::Document ok 19 - The object isa XML::LibXML::Document ok 20 - The object isa XML::LibXML::Document ok 21 - The object isa XML::LibXML::Document ok 22 - The object isa XML::LibXML::Document ok 23 - The object isa XML::LibXML::Document ok 24 - The object isa XML::LibXML::Document ok 25 - The object isa XML::LibXML::Document ok 26 - The object isa XML::LibXML::Document ok 27 - The object isa XML::LibXML::Document ok 28 - The object isa XML::LibXML::Document ok 29 - parses undef string with an error ok 30 - Error thrown passing '' ok 31 - Error thrown passing '<?xml version="1.0"?>\n' ok 32 - Error thrown passing '<!--ouch-->' ok 33 - Error thrown passing '<!DOCTYPE ...o "bar">]>' ok 34 - Error thrown passing '<ouch>' ok 35 - Error thrown passing '<ouch/>foo' ok 36 - Error thrown passing 'foo<ouch/>' ok 37 - Error thrown passing '<ouch foo=bar/>' ok 38 - Error thrown passing '<ouch foo="bar/>' ok 39 - Error thrown passing '<ouch>&</ouch>' ok 40 - Error thrown passing '<ouch>&\#0x20;</ouch>' ok 41 - Error thrown passing '<foobär/>' ok 42 - Error thrown passing '<ouch>&foo;</ouch>' ok 43 - Error thrown passing '<ouch>&gt</ouch>' ok 44 - Error thrown passing '<?xml vers...;="ouch"/>' ok 45 - Error thrown passing '<?xml vers...ar &foo;/>' ok 46 - Error thrown passing '<ouch><!---></ouch>' ok 47 - Error thrown passing '<ouch><!-----></ouch>' ok 48 - The object isa XML::LibXML::Document

      I looked at the 02parse.t code, but could not spot anything.

      Being that it seems related to XML parsing, I updated XML::SAX and XML::SAX::Base, in the hopes that it would help. It did not. Ironically, it did fix my original Perl code issue, which was why I was trying to package XML::LibXML in the first place. I'd still like to figure out this problem, though.

        You need to skip to the first line that says "not ok".

        - tye        

Re: Errors building XML::LibXML
by karlgoethebier (Curate) on Feb 25, 2014 at 14:30 UTC

    Why don't you try to install the module with yum?

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

      hi, I have installed that version already (1.70). I want to install the latest version for the purpose of troubleshooting some Perl code.

        I thought as much. But mixing cpan with rpm may be suboptimal. Regards, Karl

        «The Crux of the Biscuit is the Apostrophe»

Re: Errors building XML::LibXML
by tobyink (Abbot) on Feb 25, 2014 at 15:32 UTC

    That number of Bad plan errors usually suggests a too old version of Test::More. However, the XML::LibXML test suite doesn't seem to use any of the newer Test::More features, so that seems unlikely.

    Running prove -b t/41xinclude.t in the build dir may give you some better clues.

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

      No, "bad plan" (for a verified test script) usually just means that the test script died (probably with an informative error message in the process, but prove likes to hide such things from you).

      The error message was likely "segmentation violation", as that is what signal 11 is (at least on one system I checked).

      - tye        

      Thanks for the suggestion...but it appears that tye has it right on this. In desperation, I tried updating to the latest Test::More (that is, Test::Simple, 1.001002) but I still got the same errors running "make test" on XML::LibXML.
Re: Errors building XML::LibXML
by Anonymous Monk on Feb 25, 2014 at 16:57 UTC
    If the library was updated at the same time on a Linux-ish system, have you run ldconfig (as root ...) since doing so? This certainly sounds like a mostly-bogus error in which the Perl code is simply not able to access the library properly.
      that's not a bad idea. so i did this:
      # ldconfig -p > /tmp/aa # rm -f /etc/ld.so.cache # ldconfig # ldconfig -p > /tmp/bb # diff /tmp/aa /tmp/bb > libxml2.so (libc6,x86-64) => /usr/lib64/libxml2.so
      that got me excited...but to no avail. same errors as before.
        Go find something else that uses LibXML e.g. a test suite of some kind to determine if the library itself is running properly. And in any case, you're going to have to break-out of the padded cell of prove and run subtests individually to get to error-messages that are right now being suppressed. (As previously discussed on this thread.)
Re: Errors building XML::LibXML
by Anonymous Monk on Feb 26, 2014 at 02:47 UTC
    # Compiled against libxml2 version: 20706 # Running libxml2 version: 20706
    20706 looks suspiciously like 2.7.6, and while that is higher than the absolute minimum required ( libxml2 2.6.16 ), its still over 4 years old

    I would install a newer libxml2 and try again

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1076139]
Approved by hdb
Front-paged by toolic
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-09-22 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (182 votes), past polls