[perl #130475] IO::Socket::INET Invalid ports don't fail

2017-01-01 Thread Zoffix Znet via RT
On Sat, 31 Dec 2016 19:25:57 -0800, dougljenk...@gmail.com wrote:
> When specifying a connection to a port larger than the maximum TCP/UDP port
> number (65,535) IO::Socket::INET does not fail. Instead it seems to be
> listening on some port, but does not specify which port it is listening too.


Fixed in 
https://github.com/rakudo/rakudo/commit/c1e0d8fbef03bfeed19818ac6a0484e572cbf77f

Marking TESTNEEDED.


[perl #130474] IO::Socket::INET - Fails to parse host:port for IPv6 addresses

2017-01-01 Thread Zoffix Znet via RT
On Sat, 31 Dec 2016 19:21:51 -0800, dougljenk...@gmail.com wrote:
> The IO::Socket::INET has code to split the port from the host name when
> passed like this:
> 127.0.0.1:3000
> 
> But when using IPv6 addresses
> [::1]:3000
> 
> The code fails because the function to split IPv6 addresses returns a Match
> object instead of a Str.


Fixed in 
https://github.com/rakudo/rakudo/commit/c1e0d8fbef03bfeed19818ac6a0484e572cbf77f

Marking TESTNEEDED.


[perl #130473] IO::Socket::INET Accepts invalid family values.

2017-01-01 Thread Zoffix Znet via RT
On Sat, 31 Dec 2016 19:20:05 -0800, dougljenk...@gmail.com wrote:
> The constructor for IO::Socket::INET has a parameter ':family' to determine
> if the host/localhost
> value is defined using IPv4 (2) or IPv6 (3).
> 
> However the constructor will accept any value and default to IPv4 (2) if
> the value is not IPv3 (3).
> 
> Per discussion on IRC this behavior is LTA and should instead fail on
> invalid values:
> https://irclog.perlgeek.de/perl6/2016-12-28
> 
> E.g.
> my $listener = IO:Socket::INET.new(
> :family(11),
> :localhost
> :localport(3000)
> )
> Should fail


Fixed in 
https://github.com/rakudo/rakudo/commit/c1e0d8fbef03bfeed19818ac6a0484e572cbf77f

Marking TESTNEEDED.


[perl #130480] Problem with character ranges

2017-01-01 Thread Zoffix Znet via RT
On Sun, 01 Jan 2017 10:11:57 -0800, jjmer...@gmail.com wrote:
> This statement
> 
> my @stuff = "\x0"... "\xfff"
> 
> hangs the REPL for a while. In fact, memory as reported by top goes up to 1
> GB and increases slowly but firmly. This happens whatever the start of the
> range and for a few characters.
> 
> Ob versions:
> This is Rakudo version 2016.09-68-g447d592 built on MoarVM version
> 2016.09-1-gdebb859

Thank you for the report, however this is not a bug.

There are two things at play that cause the hang:

1) As samcv mentions above, the way you're assigning to the array makes it 
reify all the elements. You can use either `my @stuff := "\x0"..."\xfff"` or 
`my $stuff = ("\x0"..."\xfff")` or `my @stuff = lazy "\x0" ..."\xfff"` to avoid 
this issue.

2) So even though it's reifying everything, the next obvious question is why is 
it doing it forever? That it due to sequences by default using `.succ` method 
here, and there exist ranges infinitely repeated ranges because the char of a 
`.succ` of one char becomes normalized and its .succ is actually prior to that 
first char.

If you run this code, you can see that after \x[33F], the next char is \x[300] 
and it loops in that range. That's the normalization biting you.

my @stuff = lazy "\x0" ... "\xfff"; .ord.base(16).say for @stuff

If you need a list of chars between \x0 and \xfff; you can generate the numeric 
sequence and then use a map to convert to to chars:

   my @stuff = map *.chr, lazy 0 ... 0xfff; .say for @stuff

Cheers,
ZZ


[perl #130470] [JVM] Many test failures due to X::Method::NotFound instead of X::Assignment::RO

2017-01-01 Thread Christian Bartolomaeus via RT
The tests are passing again. I'm closing this ticket.


[perl #130470] [JVM] Many test failures due to X::Method::NotFound instead of X::Assignment::RO

2017-01-01 Thread Christian Bartolomaeus via RT
On Sat, 31 Dec 2016 11:04:34 -0800, elizabeth wrote:
> > There are many test failures for rakudo-j because
> > X::Method::NotFound is returned instead of X::Assignment::RO.
> 
> What is the method that isn’t found?  Maybe we need to add it for the
> JVM ?

I suspect the changes from https://github.com/rakudo/rakudo/pull/967
(and the mentioned nqp commit https://github.com/perl6/nqp/commit/49d6beb34a)
to be the cause for the failures.

Here is one example of the newly failing code:

$ ./perl6-j -e 'my $m = .Mix; $m = 42.1'
Method 'STORE' not found for invocant of class 'Int'
  in method ASSIGN-KEY at gen/jvm/CORE.setting line 2352
  in sub postcircumfix:<{ }> at gen/jvm/CORE.setting line 8761
  in block  at -e line 1

$ ./perl6-j --ll-exception -e 'my $m = .Mix; $m = 42.1'
Method 'STORE' not found for invocant of class 'Int'
  in ASSIGN-KEY (gen/jvm/CORE.setting:2352)
  in ASSIGN-KEY (gen/jvm/CORE.setting:2350)
  in postcircumfix:<{ }> (gen/jvm/CORE.setting:8761)
  in postcircumfix:<{ }> (gen/jvm/CORE.setting:8755)
  in  (-e:1)
  in  (-e:1)
  in eval (gen/jvm/stage2/NQPHLL.nqp:1165)
  in  (gen/jvm/stage2/NQPHLL.nqp:1255)
  in command_eval (gen/jvm/stage2/NQPHLL.nqp:1252)
  in command_eval (src/Perl6/Compiler.nqp:27)
  in command_line (gen/jvm/stage2/NQPHLL.nqp:1236)
  in MAIN (gen/jvm/main.nqp:47)
  in  (gen/jvm/main.nqp:38)
  in  (gen/jvm/main.nqp)


[perl #126149] [LTA] use Test; is(Mu, Mu); done-testing;

2017-01-01 Thread Zoffix Znet via RT
On Wed, 23 Sep 2015 15:44:59 -0700, tokuhirom wrote:
> This code throws exception.
> `use Test; is(Mu, Mu); done-testing;`
> 
> Output:
> Cannot call infix:<===>(Mu, Mu); none of these signatures match:
> ($?)
> ($a, $b)
> (Int:D \a, Int:D \b)
> (int $a, int $b)
> (Num:D \a, Num:D \b)
> (Num $ where { ... }, Num $ where { ... })
> (num $a, num $b --> Bool)
> (Str:D \a, Str:D \b --> Bool)
> (str $a, str $b --> Bool)
> (Rational:D \a, Rational:D \b --> Bool)
> (Complex:D \a, Complex:D \b --> Bool)
>   in sub is at lib/Test.pm:119
>   in block  at :1
> 
> But I guess it shouldn't throw exception(or show more descriptive
> message).
> 
> This is perl6 version 2015.09-55-gc189c7e built on MoarVM version
> 2015.09-4-g002edea

Thank you for the report. This is now fixed.

Fix: https://github.com/rakudo/rakudo/commit/268dc92e2a
Tests: https://github.com/rakudo/rakudo/commit/268dc92e2a