Welcome to the main channel on the development of MoarVM, a virtual machine for NQP and Rakudo (moarvm.org). This channel is being logged for historical purposes.
Set by lizmat on 24 May 2021.
00:08 reportable6 left 00:09 reportable6 joined 01:07 benchable6 joined 03:30 evalable6 left, linkable6 left 03:31 evalable6 joined 04:02 Techcable left 05:02 evalable6 left 06:08 reportable6 left 06:31 linkable6 joined 07:05 evalable6 joined 07:11 reportable6 joined 08:48 lizmat_ joined, TempIRCLogger__ joined 08:49 Geth left, RakuIRCLogger__ joined 08:50 TempIRCLogger left 08:51 lizmat left, RakuIRCLogger left 08:53 RakuIRCLogger__ left, RakuIRCLogger joined 09:00 lizmat_ left, lizmat joined 09:01 Geth joined, RakuIRCLogger left 09:05 Geth left, Geth joined 10:44 Kaiepi left, Kaiepi joined
dogbert17 my $t = ("errors.md.tmpl" xx 1_000).join(" foo "); race for ^2_000 { my $page = $t; $page ~~ s:g[ "foo" ] = "a"; } 11:06
m: my $t = ("errors.md.tmpl" xx 1_000).join(" foo "); race for ^2_000 { my $page = $t; $page ~~ s:g[ "foo" ] = "a"; }
camelia A worker in a parallel iteration (hyper or race) initiated here:
in block <unit> at <tmp> line 1

Died at:
Substring length (-326) cannot be negative
in block at <tmp> line 1
MasterDuke yeah, tons of those, with some different 'Died at:' messages 11:07
dogbert17 I've even had a couple of SEGV's
but mostly errors of the kind seen above 11:08
MoarVM panic: Internal error: zeroed target thread ID in work pass 11:11
MasterDuke, nine: gist.github.com/dogbert17/b318650e...2d88bf3b7b 11:12
MasterDuke dogbert17: do you get the same thing with spesh disabled? 11:29
dogbert17 Doesn't look like it. I now mostly get 'Type check failed in binding to parameter '<anon>'; expected List but got Match (Match.new(:orig("err...)' 11:36
MasterDuke i get those about 9 times out of 10 11:37
11:39 frost left 12:07 reportable6 left 12:08 reportable6 joined 12:19 Techcable joined
lizmat dogbert17: OOC, does that also happen with .subst("foo", "a") ? 12:38
dogbert17 m: my $t = ("errors.md.tmpl" xx 1_000).join(" foo "); race for ^2_000 { my $page = $t; $page.subst("foo", "a"); } 12:46
camelia ( no output )
dogbert17 lizmat: like ^^^?
lizmat yeah 12:47
well, I guess that bypasses the regex engine totally
perhaps .subst(/foo/, "a") ? 12:48
dogbert17 m: my $t = ("errors.md.tmpl" xx 1_000).join(" foo "); race for ^2_000 { my $page = $t; $page.subst(/foo/, "a"); }
camelia ( no output )
lizmat interesting
dogbert17: perhaps something in APPLY-MATCHES is not thread safe? 12:51
meh, nothing jumps out there 12:53
timo have we tried a `my $/` yet?
dogbert17 mimalloc: error: double free detected of block 0x200243d0a00 with size 1280 13:08
Segmentation fault (core dumped)
timo: interesting in looking at a gist? 13:10
*interested 13:11
timo sorry, neck deep in workwork
dogbert17 uh oh 13:12
anyway, here it is :) gist.github.com/dogbert17/802e396b...54bf9a6b58 13:13
so, two threads seems to be running a GC at the same time, is that ok? 13:14
lizmat: can you make anything of this? gist.github.com/dogbert17/700a7474...f438ad6fae 13:16
timo two threads in GC at the same time is normal and the desired outcome 13:18
MasterDuke i don't seem to get any fail with a `my $/` in the body of the `for` 13:20
timo well, that certainly feels familiar
MasterDuke though it does get killed by the oom killer unless i also add `$*VM.request-garbage-collection if $_ %% 1_000;` 13:22
timo whoops
how big does it become before the oom killer does its thing? 13:23
13:24 [Coke] left
MasterDuke >24gb 13:24
lizmat m: List.^find_method("eager")("foo" ~~ /foo/) # dogbert17: that's basically what happens, but shouldn't happen 13:25
camelia Type check failed in binding to parameter '<anon>'; expected List but got Match (Match.new(:orig("foo...)
in block <unit> at <tmp> line 1
timo wowzer.
lizmat because Match.eager should dispatch to Any::eager
so I expect some memory corruption or some dispatch unthreadsafeness issue? 13:26
timo sounds a little like something is switching out the match object (or its attributes) while something else is trying to work with it 13:30
i.e. improper sharing of $/ between threads 13:31
MasterDuke still happens with `--optimize=off` (rakudo option) 13:33
13:56 Kaiepi left 13:57 Kaiepi joined
dogbert17 here's some tsan output from when the code crashes, gist.github.com/dogbert17/ee63cc54...ac464e0b34 14:21
14:57 [Coke] joined 15:07 frost joined 15:36 frost left
dogbert17 MasterDuke: have you seen this? mimalloc: assertion failed: at "3rdparty/mimalloc/src/alloc.c":231, mi_page_usable_size_of 16:06
assertion: "ok"
[Coke] compiler narrator: it was not, in fact, OK. 16:07
dogbert17 here's the line: 231 mi_assert_internal(ok); mi_assert_internal(delta <= bsize); 16:08
MasterDuke yep. there have been a bunch of different fails (e.g., double free, segv, that assert). i think it's just all because of some memory corruption
japhb [Coke]: *snrk*
MasterDuke user running the program: i've made a huge mistake 16:09
[Coke] it's one segfault, michael. how much can it cost, 10 dollars? </meme> 16:20
MasterDuke for `s:g[ "foo" ] = "a"`, why is the $replacement here github.com/rakudo/rakudo/blob/mast....pm6#L1800 a Callable (it's a Code.new)? 16:25
timo missed opportunity for optimization probably 17:21
17:21 [Coke] left 17:29 [Coke] joined 18:08 reportable6 left 19:08 reportable6 joined
MasterDuke does this try+assignment github.com/rakudo/rakudo/blob/mast....pm6#L1813 have to happen on every iteration? or could it be done just for the final one? 20:01
looks like it has to be every time, get a bunch of spectest fails otherwise 20:26
ok, but does it need to be in a try? 20:31
it passes a spectest without, but the original commit that introduced it github.com/rakudo/rakudo/commit/14...f682afa916 says 'Setting $/ is protected by "try" because it might be readonly.' 20:37
when would $/ be readonly?
timo `-> $/ { }` for example 20:52
hm. but then we could do it just a single time up front and remember whether it's readonly or not? 20:56
22:27 ShaneC joined
MasterDuke man, do i really want to get sucked into trying to optimize regex stuff...? 22:29
japhb MasterDuke: Glory or Bust! ;-) 22:30
MasterDuke hopefully that's not a short-circuiting 'or' 22:36
anyway, afk now, might try to pick this (the crashes and/or the optimization) back up tomorrow evening 22:37
timo: yeah, that's a possibility. !APPLY-MATCHES is already pretty big, it's not like an extra line or two is going to push it over the inlining limit, and it might be worth it for a faster fast path 22:39
22:48 codesections5 joined 22:50 kjp left, ilogger2 left, codesections left, codesections5 is now known as codesections 22:51 kjp joined 23:03 ilogger2 joined 23:10 [Coke] left 23:13 [Coke] joined
timo perhaps it's even easier than to try assigning if the type of the var is one of a bunch of known ones, like Scalar or LexicalRef or whatever, but maybe not Proxy or similar 23:18
well, Scalar has the descriptor that tells you about read-only-ness 23:19
23:50 Techcable left