Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a lot of PseudoHashes in a loop sometimes hangs #1835

Open
MasterDuke17 opened this issue May 17, 2018 · 6 comments

Comments

Projects
None yet
5 participants
@MasterDuke17
Copy link
Contributor

commented May 17, 2018

my $a; $a = PseudoStash.new for ^9999; say $a (almost?) always hangs and pegs the cpu. However, with MVM_SPESH_DISABLE=1, MVM_SPESH_OSR_DISABLE=1, and MVM_SPESH_INLINE_DISABLE=1 it's fine, but not with MVM_JIT_DISABLE=1.

[00:44] <AlexDaniel> bisect: my $a; $a = PseudoStash.new for ^9999; say $a
[00:45] <+bisectable6> AlexDaniel, Bisecting by exit signal (old=2015.12 new=b8318b8). Old exit signal: 0 (None)
[00:46] <+bisectable6> AlexDaniel, bisect log: https://gist.github.com/e3cb6a0d63e4d77af2068587d75f5ff1
[00:46] <+bisectable6> AlexDaniel, (2017-08-11) https://github.com/rakudo/rakudo/commit/76af17a8b1dc79f8923109bbd284afed2e2fe011

Bisected: (2017-08-11) 76af17a

@MasterDuke17

This comment has been minimized.

Copy link
Contributor Author

commented May 17, 2018

Interestingly, my $a; for ^10_000 { $a = PseudoStash.new for ^1_000 }; say $a; works just fine.

@timo

This comment has been minimized.

Copy link
Member

commented May 25, 2018

it's infinitely recursing when printing out the pseudostash, because it finds itself in there after the loop body has been inlined, i.e. $a looks kind of like PseudoStash.new( a => PseudoStash.new( a => PseudoStash.new( a => … ) ) )

and gistseen isn't filtering it out for some reason.

@lizmat

This comment has been minimized.

Copy link
Contributor

commented Jul 26, 2018

I can't reproduce this anymore. Perhaps this got fixed with the last round of @jnthn's refactoring?

@AlexDaniel

This comment has been minimized.

Copy link
Member

commented Jul 26, 2018

@lizmat so what do you get exactly?

Output from committable:

¦«2016.01.1,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07.1,2016.08.1,
  2016.09,2016.10,2016.11,2016.12,2017.01,2017.02,2017.03,2017.04.3,
  2017.05,2017.06,2017.07»:
PseudoStash.new(("\$_" => 9998))

¦«2017.08,2017.09,2017.10,2017.11,2017.12,2018.01,2018.02.1,2018.03,
  2018.04.1,2018.05,2018.06»:
«timed out after 10 seconds» «exit signal = SIGHUP (1)»
¦«HEAD(08b449e)»:
unknown lexical type encountered when bulding context hash
  in block <unit> at /tmp/wchCWz55D5 line 1

«exit code = 1»

Does not look fixed to me.

@jnthn

This comment has been minimized.

Copy link
Member

commented Jul 26, 2018

Yes, the case that is fixed is the sensible one where you acquire a PseudoStash and then actually do a lookup. The case where you acquire it and then use it some arbitrary time later is the outstanding one (and I've by now concluded there's no way to do that except forcing a full stack deopt of the thread where it takes place).

@jnthn

This comment has been minimized.

Copy link
Member

commented Jul 26, 2018

forcing a full stack deopt of the thread where it takes place

Oh, and to add to that - possibly forbidding any frame that's implicated from doing OSR, but I'm hoping I might be able to avoid that restriction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.