develooper Front page | perl.perl5.porters | Postings from September 2013

[perl #119459] Compilation error at /usr/share/perl/5.14/ line 447

Thread Next
Father Chrysostomos via RT
September 17, 2013 05:04
[perl #119459] Compilation error at /usr/share/perl/5.14/ line 447
Message ID:
On Sun Aug 25 08:30:00 2013, wrote:
> -----------------------------------------------------------------
> [Please describe your issue here]
> There must be error in core of Perl. I do have 7500 lines in the
> script. However, even a slightest change, like missing colon or
>    ampersand
> or syntax error may lead to following:
> Compilation error at /usr/share/perl/5.14/ line 447.
> And that is not what should happen.
> Even just checking the syntax with perl -c gives above error
> message. It becomes impossible to know what is wrong in the script.
>    One
> has to go manualy and search for the syntax error as perl does not
>    tell
> what was the real error message.

You may be running into bug #99984, which was fixed in perl 5.16 in
commit ba6ff154b0d8.  Could you try your script with perl 5.16 (or 5.18)?

If you are stuck with 5.14, read on.

As Brian Fraser suggested in ticket #99984, you can work around the
problem by preloading swashes explicitly via

    BEGIN { "\x{100}" =~ /[\p{XIdStart}]/ }

to load the XIdStart swash, for example.

You can find out which swash was trying to load when it
croaked by patching it in-place like this:

--- /usr/local/lib/perl5/5.14.4/	2013-09-16
22:01:26.000000000 -0700
+++ /tmp/foo	2013-09-16 22:01:21.000000000 -0700
@@ -444,7 +444,7 @@ sub croak { require Carp; Carp::croak(@_
                 local $@;
                 local $!;
-                $list = do $file; die $@ if $@;
+                $list = do $file; die "$type: $@" if $@;
             $ListSorted = 1; ## we know that these lists are sorted

With that applied, this (the test case from #99984):

perl5.14.4 -Mutf8 -Ilib -lwe 'use strict; eval q "our $::é; $é"; print $@'

gives me this:

XIdStart: Compilation error at /usr/local/lib/perl5/5.14.4/
line 447.

Preloading XIdStart unhides the error:

$ perl5.14.4 -Mutf8 -Ilib -lwe 'BEGIN { "\x{100}" =~ /[\p{XIdStart}]/ };
use strict; eval q "our $::é; $é"; print $@'
Variable "$é" is not imported at (eval 1) line 2.
No package name allowed for variable $::é in "our" at (eval 1) line 1,
near "our $::é"
Can't use global $::é in "my" at (eval 1) line 1, near "our $::é"
Global symbol "$?" requires explicit package name at (eval 1) line 2.

Now, this is all assuming that the two bugs are the same.  Could you try
such an approach with your 7500-line script and see if that helps? 


Father Chrysostomos

via perlbug:  queue: perl5 status: open

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About