develooper Front page | perl.perl5.porters | Postings from March 2003

Re: Inline::C seems to hang during make test in 5.8.1

From:
David Dyck
Date:
March 2, 2003 00:22
Subject:
Re: Inline::C seems to hang during make test in 5.8.1
Message ID:
Pine.LNX.4.51.0303012342040.3192@dd.tc.fluke.com
On Thu, 27 Feb 2003 at 17:33 -0000, Nicholas Clark <nick@ccl4.org> wrote:

> From: Nicholas Clark <nick@ccl4.org>
> To: perl5-porters@perl.org
> Cc: David Dyck <david.dyck@fluke.com>, inline@perl.org
> Date: Thu, 27 Feb 2003 17:33:03 +0000
> Subject: Re: Inline::C seems to hang during make test
>
> Summary for p5p: David Dyck has found that Inline::C refuses to make test
> on currently bleadperl. It seems to lock up into an infinite CPU loop.
> Repeating "make test" causes it all to work. I can recreate the loop:
> On Thu, Feb 27, 2003 at 04:35:03PM +0000, Nicholas Clark wrote:
> > On Thu, Feb 27, 2003 at 04:06:51PM +0000, Nicholas Clark wrote:
> >
> > > I don't quite what that means, but I'm guessing that something is sending
> > > the regexp ending into a (near) infinite loop.


Nicholas,
(I finally discovered the Inline config
option BUILD_NOISY -- and the results tend to agree with your regexp
findings - as the program last reports
    "Starting Build Parse Stage"

I have tried variations of Inline::C t/01syntax.t and I
get better results if I merge the all the C code in one
section, either string, runtime bind, or  DATA sections.
Inline seems to be having trouble with multiple parse
stages!   Perhaps this will help create some code that
doesn't depend on Inline::C at all, but could stand
alone against perl 5.8.1 core and still fail. (Any ideas?)

Here's a smaller script that assume that Inline::C has
been installed and passes its test with perl 5.8.0, but
fails with todays 5.8.1.

use strict;

BEGIN {
    $| = 1;
    print "rm -rf _Inline_test\n";
    use File::Find ();
    sub wanted {
	if (lstat($_)) {
	    if    (-d _) { rmdir($_) or die " rmdir $_ : $!" }
	    elsif (-f _) {unlink($_) or die "unlink $_ : $!" }
	}
    }
    File::Find::finddepth({wanted => \&wanted, no_chdir => 1}, '_Inline_test');
    mkdir('_Inline_test', 0777) or die "mkdir _Inline_test:$!";
    print "fresh _Inline_test\n";
}

use File::Spec;
# assumes Inline and Inline::C already installed
use Inline Config => DIRECTORY => '_Inline_test', BUILD_NOISY => 1;

my $testnum;
sub ok($) {
    ++$testnum;
    print "not " unless shift;
    print "ok $testnum\n"
}

# test 1 - Check string syntax
ok(add(3, 7) == 10);
# test 2 - Check string syntax again
ok(subtract(3, 7) == -4);

BEGIN { warn " use Inline C => <<'END_OF_C_CODE';\n"; }
use Inline C => <<'END_OF_C_CODE';

int add(int x, int y) {
    return x + y;
}
END_OF_C_CODE

BEGIN { warn " use Inline C => <<'END_OF_C_CODE';\n"; }
use Inline C => <<'END_OF_C_CODE';

int subtract(int x, int y) {
    return x - y;
}
END_OF_C_CODE



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About