Re: ctxlexpad needs an MVMContect

2017-08-03 Thread WFB
Well spotted. I totally muss that.
However, that was not the only mistakes I did.
Another problem is to use #  commentaries in grammars. Which causes also
the exception.

Thanks for the help!

On 4 August 2017 at 08:22, yary  wrote:

> Is this line intentional?
>
> token trid {  }
>
>
> it looks like you've defined trid as itself.
>
> And here-
>
> TestCases.parse($line);
> TestSuiteParameters($line);
>
>
> You're calling the parse method for TestCases, but not for
> TestSuiteParameters- for that you're calling a constructor (I think)
>


ctxlexpad needs an MVMContect

2017-08-03 Thread WFB
Hi all,

I am writing a script to compare to text file. More precisely, certain data
is compared not line by line.
To find this information I use grammars.
At the beginning it worked great. But then, my script hangs. Started with
the debugger perl6-debug-m  I got this exception:
Unhandled exception: ctxlexpad needs an MVMContext
   at SETTING::src/core/PseudoStash.pm:48
(C:\rakudo/share/perl6/runtime/CORE.setting.moarvm:)
 from SETTING::src/core/PseudoStash.pm:156
(C:\rakudo/share/perl6/runtime/CORE.setting.moarvm:AT-KEY)
 from SETTING::src/core/hash_slice.pm:6
(C:\rakudo/share/perl6/runtime/CORE.setting.moarvm:postcircumfix:<{ }>)
 from site#sources\3E687CA5BFB386524F923BAC2F986CC3C66BD24F
(Debugger::UI::CommandLine):736  (C:\rakudo\share\perl6\site
\precomp\531476C94944C40F030060AEB60539343668769B.1500922671.09494\3E\3E687CA5BFB386524F923BAC2F986CC3C66BD24F:)
 from site#sources\3E687CA5BFB386524F923BAC2F986CC3C66BD24F
(Debugger::UI::CommandLine):730  (C:\rakudo\share\perl6\site
\precomp\531476C94944C40F030060AEB60539343668769B.1500922671.09494\3E\3E687CA5BFB386524F923BAC2F986CC3C66BD24F:unhandled
)
 from site#sources\3E687CA5BFB386524F923BAC2F986CC3C66BD24F
(Debugger::UI::CommandLine):721  (C:\rakudo\share\perl6\site
\precomp\531476C94944C40F030060AEB60539343668769B.1500922671.09494\3E\3E687CA5BFB386524F923BAC2F986CC3C66BD24F:)
 from gen/moar/Metamodel.nqp:4031
(C:\rakudo\share\nqp\lib/Perl6/Metamodel.moarvm:enter)
 from SETTING::src/core/Routine.pm:85
(C:\rakudo/share/perl6/runtime/CORE.setting.moarvm:CALL-ME)
 from gen/moar/BOOTSTRAP.nqp:3001
(C:\rakudo/share/nqp/lib/Perl6/BOOTSTRAP.moarvm:)
 from gen\moar\stage2\NQPHLL.nqp:1740
(C:\rakudo\share\nqp\lib/NQPHLL.moarvm:command_eval)
 from src/Perl6/Compiler.nqp:42
(C:\rakudo\share\nqp\lib/Perl6/Compiler.moarvm:command_eval)
 from gen\moar\stage2\NQPHLL.nqp:1677
(C:\rakudo\share\nqp\lib/NQPHLL.moarvm:command_line)
 from gen/moar/perl6-debug.nqp:509
(C:\rakudo\share\perl6\runtime\perl6-debug.moarvm:MAIN)
 from gen/moar/perl6-debug.nqp:439
(C:\rakudo\share\perl6\runtime\perl6-debug.moarvm:)
 from :1  (C:\rakudo\share\perl6\runtime\perl6-debug.moarvm:)
 from :1
(C:\rakudo\share\perl6\runtime\perl6-debug.moarvm:)

I tried to find the reason for that. I think it has something to do with
the grammar, but I do not know what could be the problem:

use v6;

grammar Base {
token nodash { <-[-]>* }# everything from begining to the first -.
token dash { '-' }  # the - itself.
token id { '{' <[A..Z 0..9 -]>+ '}' }   # a string starting with {
containing A-Z, 0-9 and - and ending with }.
}

grammar TestCases  {
# test case looks like this:
# 09:13:52: DEBUG (FetchTestRunDataSQL:895) -
{CC3CF1E4-ED49-4885-A327-1B506FFC18A6}
{01D2E4A7-5B6D-4968-82FA-0089838940AD} VMware: Stop All Running VM Images
token TOP {   \s+  \s+   }
token nodash { <-[-]>* }# everything from begining to the first -.
token dash { '-' }  # the - itself.
token id { '{' <[A..Z 0..9 -]>+ '}' }   # a string starting with {
containing A-Z, 0-9 and - and ending with }.
token tcid {  } # the first id. In this case the test case
id.
token tsid {  } # the second id. In this case the test
suite id.
token noparam { <-[$ @]>+ } # everything except $ or @.
}

grammar TestSuiteParameters   {
# Testmemberid TestRunID SearchPattern Replacement
#09:13:53: DEBUG (FetchTestRunDataSQL:173) -
{21E6F3A8-B8FD-42E0-9464-D91BDBD8A3EA}
{C9416326-27F6-41C7-847A-5669694389F0}$SNAPSHOTNAME$$VMSNAPSHOTNAME$
token TOP {   \s+  \s+  \s+ 
\s+  }
token nodash { <-[-]>* }# everything from begining to the first -.
token dash { '-' }  # the - itself.
token id { '{' <[A..Z 0..9 -]>+ '}' }   # a string starting with {
containing A-Z, 0-9 and - and ending with }.
token tmid {  }
token trid {  }
token searchpattern { <[$]> \w <[$]> }
token replacement { .* }
}

my $line = '09:13:52: DEBUG (FetchTestRunDataSQL:895) -
{CC3CF1E4-ED49-4885-A327-1B506FFC18A6}
{01D2E4A7-5B6D-4968-82FA-0089838940AD} VMware: Stop All Running VM Images';

TestCases.parse($line);
TestSuiteParameters($line);

I am working on Windows 10 with perl6:
This is Rakudo version 2017.07 built on MoarVM version 2017.07
implementing Perl 6.c.

Could someone tell me, whether I am the problem here or did I find a bug?

Thanks in advanced,
Wolf


Memory leak or just normal usage in Rakudo?

2017-08-03 Thread Gabor Szabo
Hi,

I think I've mentioned earlier that we see some memory leaks in Bailador.
I've started to investigate it by creating a small function that would
use "ps" to get the memory usage of the current process.

The first step was to do some sanity check and so I wrote a test script:

https://github.com/szabgab/p6-memory/blob/master/t/memory-usage.t

As I am far from being an expert in the field, I wonder if checking
the VSZ as reported by ps is even a good indication of the memory
consumption of a process?

Then I've to note that the results were different in almost every run
which makes me further wonder why?

The numbers are also drastically different between my OSX and running
on Travis-CI, though Rakudo is also different.

Does any of this make sense? Does it indicate any memory leak in
Rakudo already or is this just normal memory usage?

How could I improve my measuring and what else should I measure?

regards
Gabor