# New Ticket Created by   
# Please include the string:  [perl #123957]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=123957 >


OS: Ubuntu Linux 14.04 LTS
     Guest VM in 2.0GiB RAM
Host: Windows 8 on Intel i5-4200M

rakudo build 67a75c1e1d9ed99326b7e426eea3cd969dba35ea, Sat Feb 28 
16:16:52 (MoarVM only, no JVM/parrot)

I'm running rakudo directly from its git repository, not a system binary 
(and this may be an issue.)

The code below invokes the OOM killer on Ubuntu 14.04 consistently.
The class is src/code/Complex.pm stripped down to the essential creator 
method.
The test code attempts to invoke infix<+>(Real, Polar) which is *not* 
defined. I'm doing test-first development, and expected to see an error 
to the effect of "Could not invoke infix<+> on (Real, Polar) - Maybe you 
forgot to define infix<+>(Real \a, Polar \b)" rather than the OOM 
condition.

I've enclosed the last few lines from 'strace -olog.txt ./perl6 foo.t' 
as an aid to debugging. Its last act before dying is opening 
blib/Perl6/Pod.moarvm, and at that point it spins out of control.

--cut here--
my class Polar is Cool does Numeric {
      has num $.re;
      has num $.j;

      multi method new(Real \re, Real \j) {
          nqp::create(self).BUILD(re.Num,j.Num);
      }
      submethod BUILD(Num \re, Num \j) {
          $!re = re;
          $!j = j;
          self;
      }
}

constant j = Polar.new(0e0, 1e0);

use v6;

print 'ok '; say 1 + j; # Deliberately invoking undefined operator.
--cut here--


--cut here--
stat("blib/Perl6/Ops.moarvm", {st_mode=S_IFREG|0664, st_size=67489, 
...}) = 0
brk(0xfc0000)                           = 0xfc0000
lstat("/home/jgoff/Documents/rakudo/install/languages/nqp/lib/ModuleLoader.moarvm",
 
{st_mode=S_IFREG|0664, st_size=12282, ...}) = 0
mmap(NULL, 2226, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f1d1d77b000
mprotect(0x7f1d1d77b000, 2226, PROT_READ|PROT_EXEC) = 0
stat("./Perl6/Pod.moarvm", 0x7fff661d6610) = -1 ENOENT (No such file or 
directory)
stat("blib/Perl6/Pod.moarvm", {st_mode=S_IFREG|0664, st_size=81849, 
...}) = 0
mmap(NULL, 192512, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0x7f1d1d74c000
brk(0xfe1000)                           = 0xfe1000
BRK(0x1002000)                          = 0x1002000
brk(0x1023000)                          = 0x1023000
brk(0x1044000)                          = 0x1044000
--cut here--

Reply via email to