Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2017-02-22

| Channels | #moarvm index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:04 BenGoldberg m: INIT return;
00:04 camelia rakudo-moar 80e0bc: OUTPUT: «Attempt to return outside of any Routine␤  in block <unit> at <tmp> line 1␤␤»
00:04 BenGoldberg m: sub { INIT return };
00:04 camelia rakudo-moar 80e0bc: OUTPUT: «(signal SEGV)»
00:12 IOninja hehe
00:12 IOninja there's a ticket for it
00:12 IOninja https://rt.perl.org/Ticket/Displ​ay.html?id=130825#ticket-history
00:12 BenGoldberg That's where I saw it.
00:12 IOninja Ah. OK :)
00:13 IOninja Don't make much sense, that code, but it at least shouldn't segv
00:13 * BenGoldberg was reading the log for #moarvm.
00:39 geekosaur some ways p5's handling of that makes more sense to me (the INIT is a sub, so return would return from that)
00:39 geekosaur ...that stands a decent chance of being why the OP tripped over it
00:43 geekosaur come to think of it, that could stand being mentioned in language/traps
00:44 geekosaur old p5ers *will* be prone to doing that
00:58 * IOninja didn't even know Perl 5 had INIT :o
00:58 IOninja $ perl -wlE 'END say "three"; INIT say "two"; BEGIN say "one";'
00:58 IOninja Illegal declaration of subroutine END at -e line 1.
00:59 IOninja now I remember why I dislike Perl 5 >_<
00:59 IOninja works with braces in. Cool. Only heard of BEGIN and END
01:12 pyrimidine joined #moarvm
01:20 geekosaur BEGIN, UNITCHECK, CHECK, INIT, END
01:21 geekosaur and yes, they are precisely subs; the "sub" keyword is optional, but the braces are required
01:23 IOninja :o
03:04 camelia joined #moarvm
03:16 agentzh joined #moarvm
04:20 BenGoldberg I've always thought of them as blocks, not subs, even if they can take an optional 'sub' keyword -- after all, it's not as if @_ has anything interesting in it (I don't think.)
04:29 pyrimidine joined #moarvm
05:25 pyrimidine joined #moarvm
05:58 geekosaur but they predate perl 5, and the notion of blocks :)
05:59 geekosaur of course he just fell out of channel...
06:26 agentzh joined #moarvm
06:27 pyrimidine joined #moarvm
06:43 Geth ¦ MoarVM/even-moar-jit: abe040407e | (Bart Wiegmans)++ | 2 files
06:43 Geth ¦ MoarVM/even-moar-jit: Start with compiling ARGLIST code
06:43 Geth ¦ MoarVM/even-moar-jit:
06:43 Geth ¦ MoarVM/even-moar-jit: Will require topological sort to sort out correct ordering of value
06:43 Geth ¦ MoarVM/even-moar-jit: transfers in order to place them in the right registers, as well as
06:43 Geth ¦ MoarVM/even-moar-jit: cycle breaking. Also update plan, reordering items.
06:43 Geth ¦ MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/abe040407e
06:47 brrt joined #moarvm
06:47 brrt good *
06:48 brrt in theory, the above comit is progress
08:18 agentzh joined #moarvm
08:22 pyrimidine joined #moarvm
08:28 pyrimidi_ joined #moarvm
08:40 zakharyas joined #moarvm
08:55 pyrimidine joined #moarvm
09:43 jnthn morning o/
09:45 samcv morning jnthn
09:47 stmuk joined #moarvm
09:49 * dogbert11 waves from $work
10:06 jnthn Got a fix for that INIT return thing
10:07 brrt joined #moarvm
10:08 jnthn m: use Test; throws-like Q[sub { INIT return }], X::ControlFlow::Return
10:08 camelia rakudo-moar 80e0bc: OUTPUT: «(signal SEGV)    1..2␤»
10:13 brrt joined #moarvm
10:18 Geth ¦ MoarVM: a95639c380 | (Jonathan Worthington)++ | src/core/frame.c
10:18 Geth ¦ MoarVM: Set effective_handlers in context-only frames.
10:18 Geth ¦ MoarVM:
10:18 Geth ¦ MoarVM: Otherwise, if we somehow search in them for an exception handler, we
10:18 Geth ¦ MoarVM: will end up dereferencing a NULL pointer. This is cheaper than adding
10:18 Geth ¦ MoarVM: a NULL check into every exception throw.
10:18 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/a95639c380
10:18 dogbert11 cool, that was quick
10:18 jnthn Yeah, dug around a bit to figure out the best place to fix it :)
10:18 dogbert11 what's next?
10:18 jnthn It spectests fine
10:19 jnthn Just fixing up the CHECK block error not giving a line number also
10:19 jnthn m: sub { CHECK return }
10:19 camelia rakudo-moar 80e0bc: OUTPUT: «===SORRY!===␤Attempt to return outside of any Routine␤»
10:20 dogbert11 difficult?
10:22 jnthn No, we already have the infrastructure to make it good
10:22 jnthn Just had to apply it
10:22 jnthn Done now, just specteting :)
10:25 agentzh joined #moarvm
10:25 pyrimidine joined #moarvm
10:29 stmuk_ joined #moarvm
10:33 jnthn There we go, another RT down. :)
10:33 jnthn What next... :)
10:35 dogbert11 do you want a siggestion?
10:36 dogbert11 perhaps https://rt.perl.org/Public/​Bug/Display.html?id=126014
10:36 dogbert11 m: "x" xx 9999999999
10:36 camelia rakudo-moar b2eb11: OUTPUT: «MoarVM panic: Memory allocation failed; could not allocate 79999999992 bytes␤»
10:39 dogbert11 if the above looks interesting then some extra info can be found here: https://gist.github.com/dogbert17​/e623faa8db708cd6ea59d91c5539dad9
10:41 brrt joined #moarvm
10:41 jnthn m: my \lazy = "x" xx 9999999999
10:41 camelia rakudo-moar b2eb11: OUTPUT: «MoarVM panic: Memory allocation failed; could not allocate 79999999992 bytes␤»
10:42 jnthn m: my \lazy = "x" xx 9999999999; say lazy[0]
10:42 camelia rakudo-moar b2eb11: OUTPUT: «MoarVM panic: Memory allocation failed; could not allocate 79999999992 bytes␤»
10:42 jnthn Hmm
10:42 Geth ¦ MoarVM: 8c2a75f8af | (Samantha McVey)++ | src/strings/ops.c
10:42 Geth ¦ MoarVM: Streamline switches, try to suppress Coverity warnings in
10:42 Geth ¦ MoarVM:
10:42 Geth ¦ MoarVM: In MVM_string_compute_hash_code
10:42 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/8c2a75f8af
10:42 Geth ¦ MoarVM: 0feac4132a | (Jonathan Worthington)++ | src/strings/ops.c
10:42 Geth ¦ MoarVM: Merge pull request #539 from samcv/hash
10:42 Geth ¦ MoarVM:
10:42 Geth ¦ MoarVM: Streamline some switches and try to suppress Coverity warnings
10:42 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/0feac4132a
10:43 jnthn m: say ("x" xx 99).WHAT
10:43 camelia rakudo-moar b2eb11: OUTPUT: «(List)␤»
10:43 jnthn m: say (rand xx 99).WHAT
10:43 camelia rakudo-moar b2eb11: OUTPUT: «(List)␤»
10:45 jnthn m: 42 xx (2 ** 62)
10:45 camelia rakudo-moar b2eb11: OUTPUT: «(signal SEGV)»
10:45 jnthn Aha
10:54 brrt joined #moarvm
10:55 dogbert11 another SEGV
10:57 brrt1 joined #moarvm
11:18 stmuk joined #moarvm
11:22 stmuk_ joined #moarvm
11:28 pyrimidine joined #moarvm
11:30 stmuk joined #moarvm
11:33 Geth ¦ MoarVM: b41c4e397a | (Jonathan Worthington)++ | src/6model/reprs/VMArray.c
11:33 Geth ¦ MoarVM: Detect and throw on over-size array.
11:33 Geth ¦ MoarVM:
11:33 Geth ¦ MoarVM: Otherwise, the multiplication with the element size can overflow; this
11:33 Geth ¦ MoarVM: leads to an allocation of zero (or a small number) of bytes, which we
11:33 Geth ¦ MoarVM: then SEGV on trying to zero because they are under-length.
11:33 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/b41c4e397a
11:33 jnthn dogbert11: That should hopefully sort otu both the 32-bit and 64-bit cases of SEGV :)
11:33 agentzh joined #moarvm
11:35 stmuk_ joined #moarvm
11:42 jnthn Updated the ticket also
11:47 brrt joined #moarvm
11:55 zakharyas joined #moarvm
11:57 Geth joined #moarvm
11:58 jnthn lunch &
12:01 dogbert11 nice :) have a nice lunch
12:22 dogbert11 m: 7 ~ "\x[308]" x 150_000 # is this the same SEGV?
12:22 camelia rakudo-moar b2eb11: OUTPUT: «(signal SEGV)WARNINGS for <tmp>:␤Useless use of "~" in expression "7 ~ \"\\x[308]\" x" in sink context (line 1)␤»
12:29 * jnthn back
12:29 jnthn dogbert11: No
12:29 dogbert11 its https://rt.perl.org/Public/​Bug/Display.html?id=129227
12:29 pyrimidine joined #moarvm
12:30 dogbert11 even though it SEGV's ASAN doesn't pick it up, have to run gdb to see what's going on
12:30 jnthn I suspect "too many combiners" or so
12:31 dogbert11 #0  0xb5fdb969 in MVM_fixed_size_alloc (tc=tc@entry=0xb5803c80, al=0xb4600fd0, bytes=bytes@entry=12) at src/core/fixedsizealloc.c:141
12:31 dogbert11 #1  0xb6202481 in twiddle_trie_node (tc=tc@entry=0xb5803c80, current=current@entry=0x0, cur_code=cur_code@entry=0xa7748890, codes_remaining=codes_remaining@entry=75213, synthetic=synthetic@entry=-8)
12:31 dogbert11 at src/strings/nfg.c:46
12:31 dogbert11 there are like thousands of twiddle_trie_node frames in gdb
12:32 jnthn Yeah, we should probably just stick an upper limit on combiners
12:32 jnthn There's really no practical use for more than even a pretty tiny number like 32
12:32 dogbert11 aha
12:40 dogbert11 if you crack this I have nothing more from the RT SEGV list, haven't found anything else that SEGV's and is reproducible
12:41 jnthn OK...are those that were tagged [SEGV] but no longer do untagged?
12:41 dogbert11 no, sadly I'm not able to make those changes
12:43 dogbert11 I was going to look at another one RT #130379, but I'm unable to find the branch the author is referring to (probably my git fu is not up to scratch)
12:43 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=130379
12:43 [Coke] dogbert11: what's your RT login ID?
12:44 dogbert11 hm, am at $work but I think it was either dogbert17 or my email address
12:46 [Coke] dogbert11: you appear to already be a bugadmin.
12:47 dogbert11 but when I log in I only see my own cases
12:48 [Coke] on the home page? you can change what you see there.
12:49 [Coke] Menu: logged in as <>; settings ; RT at a glance
12:50 [Coke] also settings; quick search: be sure that "perl6" is checked.
12:53 dogbert11 will check again when I get home
12:54 dogbert11 if it works I could e.g. close RT #128705
12:54 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=128705
13:00 agentzh joined #moarvm
13:00 dogbert11 so if I'm to be trusted (NOT) we're beginning to run out of SEGV's
13:01 jnthn heh :)
13:01 jnthn Nice problem to have :P
13:02 brrt well, i'll be sure to bring you a few new ones
13:03 jnthn Oh no, not JIT ones /o\ :P
13:04 dogbert11 tbh, I have ignored the ones dealing with race and hyper ...
13:05 dogbert11 seem to remember that those two are broken
13:06 brrt matter of fact, with jit-bisect my (subjective) mean time between debug and resolution is much shorter
13:12 jnthn Yeah, race/hyper are the next big thing for me to work on
13:23 jnthn $ ./perl6-m -e 'my $x = 7 ~ "\x[308]" x 150_000'
13:23 jnthn Too many codepoints (150001) in grapheme in block <unit> at -e line 1
13:23 jnthn There we go :)
13:24 IOninja \o/
13:24 jnthn I set the limit at 1024
13:24 jnthn Which still feels ridiculously high :)
13:24 jnthn But you'd pretty much have to be up to no good to hit it :)
13:25 IOninja Oh, never thought of just setting the limit when I looked at that bug :)
13:25 [Coke] should we make that a language restriction or is it a rakudo limit?
13:25 jnthn Good question.
13:25 jnthn I was kinda pondering that when thinking about testing it
13:26 jnthn I don't know that we want to dies-ok it
13:26 jnthn lives-ok { try 7 ~ "\x[308]" x 150_000 } looks a tad odd
13:26 jnthn But means all we're saying is "it either works or throws a real, catchable exception rather than bringing down the VM"
13:27 jnthn Which is a decent way to hedge :)
13:31 TimToady joined #moarvm
13:31 pyrimidine joined #moarvm
13:35 Geth ¦ MoarVM: 3d859008a6 | (Jonathan Worthington)++ | 2 files
13:35 Geth ¦ MoarVM: Put in a limit for codepoints in a grapeheme.
13:35 Geth ¦ MoarVM:
13:35 Geth ¦ MoarVM: Way higher than is going to occur in anything close to normal use, and
13:35 Geth ¦ MoarVM: prevents a stack overflow when forming the trie.
13:35 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/3d859008a6
13:52 dogbert11 jnthn++ a SEGV massacre
13:52 jnthn :-)
13:52 jnthn OK, time for language lesson :)
13:52 jnthn Back in an hour and a bit ;)
13:52 jnthn *:)
14:01 IOninja What sort of language are you lessoning? (giving or receiving?)
14:02 nwc10 I'm going to guess that it's one where the word for beer is "pivo" or something pretty close to that.
14:03 nwc10 but (1) I don't know for sure and (2) it's a logged archived channel so I don't want to pre-empt what jnthn wants the world to know
14:04 moritz learning the vernacular sounds like a good idea, in general :-)
14:04 IOninja a Russian leson?
14:05 nwc10 "other slavic languages are available" (and acutally, I don't know)
14:18 dogbert11 moritz: did you find anything interesting with the newer cppcheck?
14:22 pyrimidine joined #moarvm
14:22 moritz dogbert11: not really
14:23 dogbert11 timotimo has made a 'coverity scan' run, might be something in there
14:26 timotimo right. you'll have to ask for access on their site to get at the list of issues
14:27 pyrimidi_ joined #moarvm
14:35 dogbert11 timotimo, I did that, what happens next
14:36 timotimo i check my mail :)
14:37 dogbert11 :)
14:37 timotimo oh i don't get it per mail it seems like?
14:38 timotimo i approved you as a "defect viewer (read-only)"
14:38 dogbert11 cool
14:44 timotimo i hae no idea why the "view defects" thing only shows one single defect at a time :\
14:53 dogbert11 how many of these are real and not false positives?
14:57 dogbert11 defect 54936, is that legit?
15:03 dogbert11 timotimo: does jnthn have access to coverity?
15:05 timotimo could be legit
15:05 pyrimidine joined #moarvm
15:15 * jnthn back
15:15 jnthn IOninja: Czech, and it's me doing the learning :)
15:16 jnthn dogbert11: No, I don't have access to coverity, sadly
15:16 IOninja :)
15:17 timotimo oh, you can easily get it, though!
15:17 jnthn timotimo: Ooh, how?
15:18 timotimo go to scan.coverity.com, hit "sign in" at the top-right and use github to sign in/up
15:18 timotimo https://scan.coverity.com/projects​/paultcochrane-moarvm?tab=overview - somewhere around here it ought to give you a button to request access
15:20 jnthn aha
15:20 jnthn OK, it's now pending approval :)
15:20 timotimo you're now "maintainer/owner"
15:20 timotimo that also means you can upload builds
15:21 jnthn oh, you also could give me perms, nice :)
15:22 timotimo ptc made me "maintainer/owner", too
15:23 dogbert11 let the defect hunt begin
15:23 timotimo they have a check that you're not allowed to free a function pointer
15:23 timotimo seems like they don't get many jit writers :)
15:24 jnthn ;)
15:24 jnthn Wow, lots of nice stuff in there :)
15:26 jnthn The fixed size alloc resource leak ones seem to be a bit off at first glance
15:26 jnthn I suspect it doesn't understand CAS
15:27 timotimo yes, cas throws it off
15:31 timotimo oh, i did get mail for the requests, but they somehow escaped my attention
15:32 brrt well, we're not supposed to free() the function pointers; we're supposed to un-malloc them
15:32 brrt if we do call a free on one of them, that's going to be very wrong
15:32 timotimo what :)
15:32 brrt ehm, un-mmap
15:32 timotimo oh?
15:32 brrt yea
15:32 brrt yeah
15:33 brrt you need a page to be able to set executable-flag on it
15:33 Geth ¦ MoarVM: 9a8ebea053 | (Jonathan Worthington)++ | src/profiler/instrument.c
15:33 Geth ¦ MoarVM: Fix a missing NULL check.
15:33 Geth ¦ MoarVM:
15:33 Geth ¦ MoarVM: Fixes CID 135426.
15:33 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/9a8ebea053
15:33 timotimo that's fair
15:33 brrt so you always get memory per page via mmap or the equivalent
15:33 timotimo right
15:33 jnthn Well, there's one down :)
15:37 dogbert11 maybe that's the only real problem in the list :)
15:39 jnthn Some others certainly warrant attention too :)
15:41 timotimo the coverity scan tool also allows you to mark things as false-positives, or "intended"
15:42 dogbert11 like e.g. deliberatly missing break statements
15:42 timotimo right
15:42 timotimo we might want to /* fallthrough */ there
15:42 timotimo maybe there's a common convention for that
15:43 dogbert11 I think samcv did something like that earlier today
15:43 timotimo yeah inside the unicode.c file i believe
15:43 timotimo when i fix coverity stuff i usually put the CID into the git commit message
15:43 geekosaur tried to. but I only know the old AT&T lint convention not the coverity one; I suggested looking for the manual
16:01 * jnthn managed to get a variant of https://rt.perl.org/Ticket/Display.html?id=130796 to SEGV
16:03 dogbert11 what did that variant look like?
16:03 jnthn m: loop { my $c = 0; my \a = lazy gather { loop { take rand } }; my \b = lazy gather { loop { take rand } }; for ^10 -> $i { await start { a[$i] }, start { b[$i] } } }
16:03 camelia rakudo-moar 742573: OUTPUT: «(signal SEGV)»
16:04 jnthn Though it won't now I've done a darn debug/no-optimize build of course :P
16:06 dogbert11 :(
16:06 jnthn Will with just --debug
16:07 pyrimidine joined #moarvm
16:08 dogbert11 jnthn: https://gist.github.com/dogbert17​/9b61cf9bf7d178ca2e1ca60a52672c76
16:09 jnthn Yeah, it's somehow ending up leaking an iterationbuffer or something between threads
16:12 dogbert11 heh, now it crashed at a completely different place
16:13 dogbert11 #0 0xb573dbdd in MVM_hll_map /home/dogbert/repos/rakudo/n​qp/MoarVM/src/core/hll.c:178
16:15 dogbert11 this gdb output might perhaps be of interest: https://gist.github.com/dogbert17​/a856034c0401daf6e74d3e5b52e1f204
16:22 jnthn Hm, looks like the gather/take golfs away too
16:22 jnthn my \a = lazy loop { 1 }; my \b = lazy loop { 1 }; for ^100000 -> $i { await start { a.AT-POS($i) }, start { b.AT-POS($i) } }
16:22 jnthn Providing that doesn't use gather/take under the hood
16:30 dogbert11 trying valgrind on the golf
16:33 jnthn Haven't found any good leads yet on what exactly is going on
16:34 dogbert11 and valgrind is dead slow ...zzz
16:34 jnthn Ah, but MVM_CROSS_THREAD_WRITE_LOG is far clearer on this golf :)
16:34 dogbert11 aha
16:34 jnthn Simplified by now to: my \a = lazy loop { 1 }; my \b = lazy loop { 1 }; for ^100000 -> $i { await start { a.AT-POS($i) }, start { b.AT-POS($i) } }
16:35 jnthn Thread 5 pushed to an object (IterationBuffer) allocated by thread 8
16:35 jnthn at <unknown>:1  (./CORE.setting.moarvm:push)
16:35 jnthn from SETTING::src/core/Iterator.pm:31  (./CORE.setting.moarvm:push-exactly)
16:38 dogbert11 if you fix it, does that make it 4 SEGV fixes in one day
16:43 jnthn Yeah, but...not having much look narrowing it down so far
16:50 jnthn Also, the cross-thread write log output was actually not a lead
16:50 timotimo :(
17:00 dogbert11 and the gdb gist didn't give any clues either?
17:00 jnthn Well, it explains where we crash
17:00 jnthn And at some level why
17:01 jnthn It doesn't explain, sadly, why we end up trying to push onto the same array twice
17:03 dogbert11 perhaps the answer hides in the coverity output
17:04 * dogbert11 relocates
17:11 jnthn Still no luck. And getting a little tired, so will see if a break brings any fresh ideas. :)
17:31 ggoebel joined #moarvm
17:43 agentzh joined #moarvm
17:51 agentzh joined #moarvm
18:06 pyrimidine joined #moarvm
18:14 pyrimidine joined #moarvm
19:08 japhb joined #moarvm

| Channels | #moarvm index | Today | | Search | Google Search | Plain-Text | summary