deprecated has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Monks...

I'm installing the Everything Engine to test out some ideas I've got for the monastery. I have had to install a few modules for it, and one of them is XML::Encoding. When I attempted to install it with CPAN, it barfed. So I went to install it by hand, and some curious things happened.

I would run :

perl Makefile.PL make make test # and what would happen is this: 08:28:20 [alex : macachu : ~/.cpan/build/XML-Encoding-1.01] [40] $ make test PERL_DL_NONLAZY=1 /bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/pe +rl5/5.6.0/ppc-linux-thread -I/usr/local/lib/perl5/5.6.0 test.pl 1..7 ok 1 ok 2 ok 3 ok 4 ok 5 ok 6 ok 7 make: *** [test_dynamic] Segmentation fault (core dumped)
I thought this was kind of odd given that it seemed like all the tests were fine. So I went to have a look at the test script and saw this:
my $err = $@; unless ($err and $err =~ /^Len plus byte > 256/) { print "not "; } print "ok 7\n";
that is the very end of the script. so it would appear that `make` is segfaulting at exit of the script. I changed
"print "ok 7\n"; # to... print "ok 7\n"; exit 0;
and it, of course, exited, and `make` was happy.

What gives? for the curious, this is GNU Make 3.77 on linux/PowerPC.

Confused,
brother dep.

--
transcending "coolness" is what makes us cool.

Replies are listed 'Best First'.
Re: Weirdness with XML-Encoding-1.01
by mirod (Canon) on Feb 24, 2001 at 20:24 UTC

    Extremely odd. I have the same problem on a linux/PentiumII with GNU Make 3.79.1. and 5.6.0 It runs fine on Sun/Solaris using GNU Make 3.77 but with 5.005_03.

    Subsequent analysis reveals that perl test.pl segfaults too. The last test is clearly the one that triggers it (I have removed all other tests and I still get it but if I remove the test it disappears). I tried adding code to clear $@ (and even $!) both directly and through eval-ing something that does not die, to na avail.

    The only reason for that behaviour seems to be the last eval in the test, which is supposed to fail and set $@: if you comment it out and set the error to the right value then you avoid the segfault. So we have a block eval, with a die thrown in the middle of the eval. Everything works OK (including code after this piece of code) until the program exits without an exit statement, in which case it segfaults.

    I guess you really found a bug in 5.6.0, maybe checking under 5.6.1 would find out whether it's already been fixed or whether it deserves a bug report.

        You're right, it's definitely a problem with the XS code.

        Program received signal SIGSEGV, Segmentation fault. doContent (parser=0x824c7a0, startTagLevel=0, enc=0x401c2bc0, s=0x824e3d1 "</prefix>\n</encmap>\n", end=0x824e3e5 "", nextPtr=0x +0) at xmlparse.c:1709 1709 xmlparse.c: No such file or directory. (gdb)
        The fact that it's only segfaulting on exit, and not immediately makes me think its munging the stack, but I don't have the xmlparse source in front of me, so it's hard to tell.