Skip to content

Instantly share code, notes, and snippets.

@vrurg
Created May 4, 2020 21:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?

Prerequsites

  • Project: https://github.com/vrurg/raku-Vikna/tree/for-comma-debug
  • Rakudo stack is built with ./Configure.pl --gen-moar --gen-nqp --backends=moar – nothing specific
  • Just in case, as the project needs chained dispatchers, there is a branch v-dispatcher for it in either the main rakudo repo or in my fork at https://github.com/vrurg/rakudo/tree/v-dispatchers
  • A breakpoint is set in lib/Vikna/EventHandling.rakumod. Basically any line within !run-ev-loop method is ok. Last time it was line 58.
  • The script I'm using for testing is t/desktop/010-screen-resize.t
  • The debugging can be configured with option start suspended set to any on or off, makes no difference. I usually start suspended, so my scenario is based on this.

What happens:

  1. Fresh start, no previous runs/debug sessions.
  2. Click the bug. Get debug window with moar command line.
  3. Click 'Resume Program'. Get the first subtest done (it's ran asynchronously to the main thread, so this is fine). The debugger focuses the breakpointed line.
  4. Click 'Resume Program' again. The debugger highlights the line next to the breakpoint (??). MoarVM outputs "marking thread 6 unblocked, but its status is already NONE.".
  5. Last click on 'Resume' is really the last. Comma freezes. 'moar' process eats 100% CPU but kindly reacts on SIGINT by exiting. At this point Comma can only be shut down with SIGKILL.

Sometimes I get a freeze instantly after the first 'Resume'.

Overall, it feels like Comma doesn't tolerate abrupt terminations of moar in certain situations. It's nothing but a speculation, but it looked as if it is freezing mostly when there is no reply to a request sent over to the debug process.

@vrurg
Copy link
Author

vrurg commented May 4, 2020

Screen Shot 2020-05-04 at 5 31 28 PM

@vrurg
Copy link
Author

vrurg commented May 4, 2020

And a little unrelated note: it'd be great if formatter would consider as one-liners not only method foo {} but also anything like method foo { pi } and especially onlystar protos.

@jnthn
Copy link

jnthn commented May 4, 2020

@vrurg In "Keep When Reformatting", do you have "Routine declaration in one line" and "Regex declaration in one line" ticked?

@vrurg
Copy link
Author

vrurg commented May 4, 2020

@jnthn Forgot to mention it. Yes, it is on. BTW, even in the example itself inserting * between method empty {} curly braces causes formatter to split it into three lines when the option is changed from off to on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment