Camelia, the Perl 6 bug

IRC log for #moarvm, 2013-10-13

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

All times shown according to UTC.

Time Nick Message
01:09 JimmyZ --output=src/stage1/QAST.moarvm src/stage1/gen/QAST.nqp
01:09 JimmyZ Routine declaration requires a signature at line 4103, near "(MAST::Nod"
01:09 JimmyZ Looks like Missing another MVMROOT
01:22 benabik joined #moarvm
01:25 FROGGS_ joined #moarvm
01:34 BenGoldberg joined #moarvm
01:34 dalek MoarVM: 1a08cce | jimmy++ | src/core/interp.c:
01:34 dalek MoarVM: re-order codes to avoids a MVMROOT, and some cleanups
01:34 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/1a08cce9c8
01:57 dalek MoarVM: c7fef60 | jimmy++ | src/6model/reprs/P6opaque.c:
01:57 dalek MoarVM: re-order part of code to avoid MVMROOTs
01:57 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/c7fef608ee
02:06 colomon joined #moarvm
02:07 dalek MoarVM: ce75f6d | jimmy++ | src/core/interp.c:
02:07 dalek MoarVM: Add a Missing MVMROOT
02:07 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/ce75f6d765
02:13 JimmyZ nvm, I was still in moarboot
02:16 JimmyZ switch to master still same error
02:22 JimmyZ .tell I got another backstrace: https://gist.github.com/zhuomingliang/6957379
02:22 yoleaux JimmyZ: I'll pass your message to I.
02:23 JimmyZ .tell jnth I got another backstrace: https://gist.github.com/zhuomingliang/6957379
02:23 yoleaux JimmyZ: I'll pass your message to jnth.
02:23 JimmyZ .tell jnthn I got another backstrace: https://gist.github.com/zhuomingliang/6957379
02:23 yoleaux JimmyZ: I'll pass your message to jnthn.
03:16 colomon joined #moarvm
04:20 BenGoldberg nqp-m: say(nqp::index("this", "h", 1,2,3,4,5,6));
04:20 camelia nqp-moarvm: OUTPUT«Bytecode validation error at offset 22, instruction 4:␤register operand index 50 out of range 0..9␤»
04:29 [Coke] why does nqp-moar have "index_s" that takes 3 args? java called it "indexfrom".
06:16 moritz hi all. What are the steps for implementing an op in moarvm?
06:16 moritz I want to do bool_I
06:23 moritz I looked at add_I as an example, and found that it is mapped to the MAST op add_I; but where is *that* defined?
06:46 JimmyZ moritz: src/core/oplist
06:47 JimmyZ moritz: add op to oplist, then run tools/update_ops.p6, then add it to src/core/interp.c
07:09 BenGoldberg joined #moarvm
07:16 moritz JimmyZ: and where are the ops actually defined?
07:16 moritz where's the implementation?
07:23 JimmyZ src/core/oplist
07:23 JimmyZ the implementation is in src/core/interp.c
07:27 moritz thanks
07:35 moritz is it normal to get "use of uninitialized value of type Any in string context  in any !cursor_init" from update_ops.p6?
07:45 moritz \o/ success
07:46 moritz (it compiles)
07:47 moritz JimmyZ: is it usual to separate the manual and the generated changes into two commits?
07:56 Ben_Goldberg joined #moarvm
07:56 JimmyZ moritz: nope
08:15 FROGGS morning
08:17 FROGGS moritz: yes, I get the warnings too since a while
08:27 moritz note to self: always pull *before* running update_ops.p6
08:27 moritz unless you are eager to resolve conflicts in generated files
08:28 FROGGS "always pull" is a good rule, err, always :o)
08:31 moritz well, when working on rakudo, I seldomly get any conflicts when my working copy is a few days old
08:31 moritz and when I do, they are usually trivial to resolve
08:31 FROGGS true, because there are too many different places to hack on :o)
08:32 FROGGS but for moarvm there are files you touch almost every time
08:32 FROGGS one is interp.c
08:32 FROGGS hmmm, isbig_I wants to be implemented too, I think I pick this one
08:33 dalek MoarVM: 02a7a3f | moritz++ | / (9 files):
08:33 dalek MoarVM: implement nqp::bool_I opcode
08:33 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/02a7a3f2e6
08:33 moritz my first moarvm commit that actually implemented a new feature (and not just in Configure)
08:35 FROGGS humm, isbig_I seems to be there already, maybe it just needs mapping
08:41 moritz isbig_I is what I used as my model, becuse it also receives a bigint arg and returns a bool (or rather int)
08:45 FROGGS moritz: both do not seem to be mapped
08:48 FROGGS this would happen in nqp/src/vm/moar/QAST/QASTOperationsMAST.nqp around line 1500
08:49 FROGGS moritz: btw, we should copy this t/nqp/60-bigint.t to nqp too
08:51 odc joined #moarvm
08:59 FROGGS ahh
09:00 FROGGS now I know why my nqp does not build anymore
09:00 FROGGS moritz: when you add an op in the middle of the list, you need to create a new stage0 for nqp using the nqp-cc
09:10 FROGGS I take the chance to update sprintf
09:18 diakopter moritz: yes needs mapped innqp
09:19 moritz uhm, which one?
09:19 moritz bool_I worked in the test I added
09:19 moritz so I can't imagine it needs extra mapping
09:21 moritz maybe isbig_I does
09:28 moritz FROGGS: so how do I create a new stage0?
09:28 wsri joined #moarvm
09:28 FROGGS moritz: I did it already
09:29 nwc10 is it documented how?
09:29 FROGGS dont think so
09:29 FROGGS you got to MoarVM/nqp-cc
09:29 FROGGS configure it, make, and the copy *.moarvm to your nqp's src/vm/moar/stage0
09:30 FROGGS you always need to do it when the ops got reordered
09:32 moritz maybe update_ops.p6 should tell me that
09:33 diakopter yes don't reorder the ops
09:33 diakopter girhub cries a little at thr extra bw
09:33 * moritz didn't reorder the ops
09:34 moritz the script did
09:34 FROGGS :o)
09:34 moritz so the script needs to be more intelligent, right?
09:38 FROGGS well, at least dropping a note wouldn't hurt
09:50 FROGGS moritz: this is what I get in MoarVM/nqp-cc when running `make selftest`: t/nqp/60-bigint.t ..................... No registered operation handler for 'bool_I'
09:50 FROGGS did you run that test using the nqp-parrot binary by any chance?
09:54 moritz FROGGS: I did a 'make test' in nqp-cc. I simply assumed it does the right thing
09:54 moritz and, why wouldn't it?
09:54 FROGGS I'm not sure
09:55 FROGGS moritz: make test does indeed use nqp-parrot
09:55 FROGGS or better: it uses an nqp from PATH
09:56 moritz *facepalm*
09:56 FROGGS well, there are tests (t/qast/) that where meant tu run this way
09:59 FROGGS moritz: you can't come late and expect to get everything in the first run :o)
10:00 moritz FROGGS: but I can come in late and expect the test target to do something useful :-)
10:02 FROGGS moritz: I guess jnthn can tell you why it should do exactly what it does ;o)
10:03 * moritz adds a mapping
10:04 moritz ok, does the mapping go into the nqp repo? or into moarvm/nqp-cc/ ? or both?
10:05 FROGGS nqp is enough, though, I did that for bool_I and isbig_I already
10:05 moritz ok, great
10:05 moritz tahnks
10:05 FROGGS not ok 46 - bool_I(42)
10:06 FROGGS not ok 47 - bool_I(0
10:06 FROGGS (in nqp, using the runner built using MoarVM)
10:07 FROGGS nqp -e 'say(nqp::bool_I(42))'
10:07 FROGGS This representation (P6int) cannot unbox to other types
10:07 FROGGS ahh, it is not a bigint
10:07 FROGGS so, the test itself is wrong, roght?
10:07 FROGGS right?
10:08 diakopter yeah
10:09 diakopter well
10:09 diakopter I'm not certain
10:10 diakopter need jnthn's assessment
10:10 diakopter bigint is kindof a gray area
10:10 diakopter as to where it's supposed to be in the type system
10:10 FROGGS hold on, the test creates a bigint using sub box() declared in that file
10:11 FROGGS nqp: my $knowhow := nqp::knowhow(); my $bi_type := $knowhow.new_type(:name('TestBigInt'), :repr('P6bigint')); $bi_type.HOW.compose($bi_type); sub box($x) { nqp::box_i($x, $bi_type) }; say(nqp::bool_I(box(42))
10:11 camelia nqp: OUTPUT«Confused at line 2, near "say(nqp::b"␤current instr.: 'panic' pc 14748 (src/stage2/gen/NQPHLL.pir:5229) (src/stage2/gen/NQPHLL.nqp:279)␤»
10:12 FROGGS nqp: my $knowhow := nqp::knowhow(); my $bi_type := $knowhow.new_type(:name('TestBigInt'), :repr('P6bigint')); $bi_type.HOW.compose($bi_type); sub box($x) { nqp::box_i($x, $bi_type) }; say(nqp::bool_I(box(42)))
10:12 camelia nqp: OUTPUT«1␤»
10:12 FROGGS nqp: my $knowhow := nqp::knowhow(); my $bi_type := $knowhow.new_type(:name('TestBigInt'), :repr('P6bigint')); $bi_type.HOW.compose($bi_type); sub box($x) { nqp::box_i($x, $bi_type) }; say(nqp::bool_I(box(0)))
10:12 camelia nqp: OUTPUT«0␤»
10:12 FROGGS nqp-m: my $knowhow := nqp::knowhow(); my $bi_type := $knowhow.new_type(:name('TestBigInt'), :repr('P6bigint')); $bi_type.HOW.compose($bi_type); sub box($x) { nqp::box_i($x, $bi_type) }; say(nqp::bool_I(box(0)))
10:12 camelia nqp-moarvm: OUTPUT«Bytecode validation error at offset 22, instruction 4:␤register operand index 50 out of range 0..9␤»
10:13 diakopter moritz: yes it needs mapped in nqp-cc also, in case it's ever included int he bootstrap
10:15 diakopter hm, apparently prove -j80 wasn't a good idea
10:15 FROGGS in case we still use the nqp-cc by then
10:15 FROGGS *g*
10:16 diakopter wut.
10:16 diakopter how does t\qregex/01-qregex.t take 5 fewer seconds today than yesterday
10:16 diakopter er, less. :D
10:17 FROGGS diakopter: maybe jnthns patch? he said that the testsuite on his machine took about 4s less or so
10:17 moritz no, fewer
10:17 moritz seconds are countable
10:17 diakopter less
10:17 diakopter it's not countability
10:17 diakopter it's discreteness
10:18 FROGGS looks like Perl6::Ops is the next bigger thing
10:18 FROGGS lunch &
10:18 diakopter next bigger thing?
10:19 FROGGS yes
10:21 diakopter bigger how
10:23 diakopter upon further thought, maybe it is countability o_O
10:24 * diakopter decides to profile man-or-boy again
10:24 diakopter erm, if the cross-compiler worked o_O
10:24 moritz http://blog.oxforddictionarie​s.com/2012/08/less-or-fewer/ makes me believe that "5 less seconds" is acutally correct
10:25 diakopter (where "correct" is just "what elitists thinks sounds more erudite"
10:25 diakopter )
10:25 diakopter :)
10:25 moritz but OTOH I don't understand their "5 items or fewer" example
10:25 diakopter [elitists like me]
10:25 grondilu joined #moarvm
10:26 diakopter well it made me think of collective noun like sugar
10:27 diakopter "less sugar" is right. "less cups of sugar" sounds wrong, even though cups aren't discrete
10:28 diakopter er. sugar isn't a collective noun. I need to just stfu right now.
10:29 moritz diakopter: or elitists like me, who learned the language through hard work, and are annoyed when what they learned turned out to be not "correct" :-)
10:30 moritz cups sure are discreet
10:30 moritz :-)
10:30 diakopter *facepalm* ""what elitists thinks"
10:30 diakopter apparently it's 3:30 a.m. in my home timezone
10:31 woolfy joined #moarvm
10:32 cognominal joined #moarvm
11:18 dalek MoarVM: c76c4db | (Tobias Leich)++ | src/math/bigintops.c:
11:18 dalek MoarVM: fix thinko, thruthness means non-zero
11:18 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/c76c4db739
11:36 jnthn diakopter: I think I know how to make things a bit better wrt MVMCode/frame lifetimes
11:36 jnthn Will take a look later on
11:40 FROGGS jnthn: will hllize and hllizefor be noops?
11:40 jnthn Why did we end up with a another bootstrap update?
11:40 FROGGS moritz: added bool_I to the middle of the list
11:40 jnthn (stage0)
11:41 FROGGS err, s/://
11:41 jnthn But why not add it at the end?
11:41 jnthn And let it wait for the re-ordering before we commit to the ordering of what we have forever...
11:41 FROGGS he didn't know, and didn't thought about moving it to the end
11:41 FROGGS *and I*
11:41 jnthn ah, ok
11:42 JimmyZ +1, I don't like always update stage0 because it inc nqp repo size magically
11:42 jnthn It's not a big deal, it's just that each time we do this, we make the nqp repo a little bigger...
11:42 FROGGS yeah :/
11:42 jnthn JimmyZ: "marginally"? :D
11:43 jnthn more history = bigger repo is pretty lame magic :P
11:45 JimmyZ well, the stage0 files will be inc-ed x.x MB
11:46 jnthn JimmyZ: Maybe, but packfiles compress stuff too
11:48 JimmyZ i.e: it always a pain to me to do full git clone parrot. because it always break at 53% or some point. And then I need to re-git-clone. well I don't have this problem with rakudo because it's repo is much small
11:49 jnthn JimmyZ: If you don't need the full history you could maybe consider a shallow close
11:49 jnthn *clone
11:50 JimmyZ hmm, Can I git push a shallow clone with adding my commits to orgin?
11:52 jnthn JimmyZ: I guess if it's not to shallow...
11:52 JimmyZ I can't follow you :(
11:55 jnthn JimmyZ: I mean, I guess it may be a problem in some cases if you're pushing a branch and don't have the base or something...but guess you'd not hit this
11:56 JimmyZ Oh. I was fearing about something like this
12:31 nwc10 real    0m1.995s
12:31 nwc10 user    0m9.288s
12:31 nwc10 sys     0m2.617s
12:32 nwc10 that's configure and 24-way build from clean (admittendly with ccache)
12:38 jnthn nwc10: build of....?
12:38 JimmyZ jnthn: btw, timotimo and I has the same issue, I'm on linux x64
12:38 nwc10 MoarVM
12:38 nwc10 *not* wrong channel, at least, not this time :-)
12:38 jnthn nwc10: wtf, you can build MoarVM on 2s? :P
12:38 jnthn *in
12:38 nwc10 seems so
12:38 jnthn Gee, I want a 24-way...
12:39 nwc10 Seems so. It was the output of this:
12:39 nwc10 for file in `find . -name \*.git`; do (cd $file/.. && git clean -dxf); done
12:39 nwc10 no, not hat
12:39 nwc10 *after* that, I did this:
12:39 nwc10 time sh -c 'perl Configure.pl --optimize --prefix=/home/nicholas/Sandpit/moar && make -j24 all'
12:41 JimmyZ real    0m27.326s
12:41 JimmyZ user    1m48.473s
12:41 JimmyZ sys     0m39.265s
12:41 JimmyZ with your cmd :(
12:43 FROGGS real0m9.256s
12:43 FROGGS user0m30.956s
12:43 FROGGS sys0m1.432s
12:45 nwc10 If I zap the cache for ccache, the cold run is:
12:45 nwc10 real    0m4.033s
12:45 nwc10 user    0m40.966s
12:45 nwc10 sys     0m7.575s
12:45 nwc10 this is not *my* machine. (It's the one I referred to as "my" machine)
12:45 nwc10 anyway, this wasn't meant to be a brag about hardware.
12:46 nwc10 it was meant to be that jnthn has met the goal of "short build time" rather more effectively than anyone would have guessed
12:46 jnthn ;)
12:47 FROGGS sad that nqp does not build in parallel :/
12:47 jnthn nwc10: I'm curious, can you build NQP for MoarVM (that build won't parallelize well, because bootstrap)
12:47 jnthn FROGGS: It basically can't.
12:47 jnthn FROGGS: Because most steps depend on the one that came before
12:47 FROGGS I know
12:48 FROGGS simple solution is simple: speed up moarvm :o)
12:48 jnthn Well, we did yesterday
12:48 jnthn nwc10: And then when it's built, run make test but add -j24 or so to that line ;)
12:48 nwc10 actually, I think that the other thing that the short build time indrectly demonstrates is how much we tolerate inefficient slow crap
12:49 jnthn nwc10: I can make test NQP here with -j 6 in 9 seconds :)
12:51 FROGGS real0m10.823s
12:51 FROGGS user0m37.444s
12:51 FROGGS -j4 that is
12:51 FROGGS time prove -j4 -r --exec "./nqp" t/qregex t/nqp t/p5regex t/qast t/serialization
12:51 FROGGS reordered the steps though
12:52 FROGGS this might even be better: time prove -j4 -r --exec "./nqp" t/qregex t/p5regex t/qast t/serialization t/nqp
12:52 FROGGS real 10.1s
12:52 FROGGS bbl
12:53 jnthn hmm, setmethcache is still vulnerable even after the re-ordering
12:53 nwc10 make -j24 for nqp for that MoarVM:
12:53 nwc10 real    1m58.803s
12:53 nwc10 user    2m10.150s
12:53 nwc10 sys     0m1.270s
12:56 jnthn oh no, setmethcache got fixed later; JimmyZ++
12:56 jnthn nwc10: Yeah, it's the prove invocation that could be fun :)
12:57 colomon joined #moarvm
12:57 nwc10 I was trying what FROGGS showed
12:58 jnthn The "time prove ..." bit?
12:58 nwc10 -j4 is fast enough, because t/qregex/01-qregex.t is slow
12:58 nwc10 yes
12:58 nwc10 about 8 seconds
12:59 jnthn Not Bad :)
12:59 nwc10 (total time, but really it's "how long does t/qregex/01-qregex.t take")
12:59 nwc10 no. I didn't pay for this hardware. :-)
12:59 jnthn yes, well, 01-qregex.t basically does 700+ evals...
13:00 jnthn So compared to the other tests (which are compile then run) it's a heck of a lot of work
13:22 colomon joined #moarvm
13:25 dalek MoarVM: f04eb35 | jnthn++ | / (8 files):
13:25 dalek MoarVM: Stub hllize/hllizefor.
13:25 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/f04eb35d1e
15:26 dalek MoarVM: 9ec5767 | jnthn++ | src/ (2 files):
15:26 dalek MoarVM: Correct possible out-of-date pointer bugs.
15:26 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/9ec5767507
15:44 lee_ diakopter: btw nqp-moar builds for me on OS X now, but capture.t fails with https://gist.github.com/leedo/4d22a0ea76e6bb4dd24e
15:44 lee_ everything else passes :)
16:03 dalek MoarVM: 3b4b362 | jnthn++ | src/core/coerce.c:
16:03 dalek MoarVM: Hardening; avoid re-count.
16:03 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/3b4b362f02
16:03 diakopter lee_: o_O
16:26 benabik joined #moarvm
16:27 dalek MoarVM: f82639a | jnthn++ | src/6model/reprs/P6opaque.c:
16:27 dalek MoarVM: A couple more pointer-freshness fixes in P6opaque.
16:27 dalek MoarVM:
16:27 dalek MoarVM: Probably not hitting these just yet, but will at some point.
16:27 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/f82639a909
16:55 cognominal joined #moarvm
16:57 ssutch joined #moarvm
17:13 FROGGS current rakudo bt: https://gist.github.com/FR​OGGS/561bca9ac7cf945ebc76
17:16 FROGGS dunno what it means though...
17:16 FROGGS do we hit some memory limit? or the nursery-size?
17:17 jnthn oh, you get that too
17:17 jnthn I jsut get some corruption in the output...
17:19 jnthn I wonder if those two are connected...
17:20 jnthn oh, good, I get it on Windows with the debug malloc oto
17:23 jnthn I already went through the file and didn't find any places we ensure_space the wrong amount, though...
17:40 jnthn r: say 0x8C40 - 0x6C30
17:40 camelia rakudo e22ac2: OUTPUT«8208␤»
17:45 FROGGS ahh, so we check how many is available before allocating it?
17:46 jnthn yeah
17:47 jnthn we are overflowing frame_seg somehow
17:47 FROGGS ahh, hmmm
17:47 jnthn The buffer is 8192
17:47 jnthn And it claims we wrote way over the end of it
17:49 jnthn But it's kinda hard to see how/where
17:49 FROGGS and what file are you inspecting?
17:50 jnthn src/mast/compiler.c
17:52 jnthn While compiling Rakudo's Actions.nqp
17:52 jnthn maybe ASAN will find it easier...
17:53 jnthn HEAP[moar.exe]: Heap block at 000000001246F560 modified at 0000000012471570 past requested size of 2000
17:53 jnthn Is what it tells me
17:53 FROGGS not very helpful
17:54 BenGoldberg joined #moarvm
18:07 FROGGS jnthn: you checked the FRAME_HEADER_SIZE?
18:07 jnthn yeah
18:08 FROGGS yeah, seems right
18:10 jnthn I dunno if these are orthogonal issues or not, but even when I bump the initial memory allocation for the frame_seg to avoid the realloc, I still get corrupt bytecdoe out
18:30 nwc10 For me, for NQP, All tests successful. building MoarVM with gcc's ASAN
18:30 nwc10 which is both nice and not-so-nice
18:31 FROGGS I am trying valgrind now
18:31 nwc10 as in, "we have normality, I repeat we have normality. Anything you still can't cope with is therefore your own problem."
18:31 FROGGS I hope it finishes today :o)
18:31 nwc10 ie it's not pointing out anything obvious that needs fixing which would improve stuff
18:34 cognominal joined #moarvm
18:36 jnthn nwc10: Any chance you could now try the moar-support branch of Rakudo under ASAN?
18:36 nwc10 quite a reasonable chance
18:36 jnthn Something silly is going on when compiling Actions.nqp, and while VS's debug malloc catches it, unlike ASAN it doesn't tell you where things got messed up. And it's a lot less obvious (to me) than would be desirable...
18:39 FROGGS valgrind is still running :/
18:40 nwc10 FROGGS: it does this :-/
18:40 nwc10 jnthn: started. No idea how far it will get, or how long it will take to get there
18:40 nwc10 this isn't on "my" machine, this is on (almost) my machine
18:40 nwc10 which is >5 years old and only has 2 cores
18:40 FROGGS *g*
18:41 nwc10 but I am root and I can build
18:41 nwc10 wait a mo - I think I can build gcc on "my" machine
18:41 nwc10 no, not enough space
18:41 nwc10 would have to ask root nicely
18:42 nwc10 2 cores and less RAM than my laptop (but as it's a desktop likely everything on it is faster)
18:42 FROGGS ohh, jnthn blogged and I missed it
18:43 nwc10 http://paste.scsys.co.uk/271683
18:43 nwc10 doth go boom
18:44 jnthn ha, that's th eone
18:44 jnthn Any chance you can symbolize it?
18:44 nwc10 yes, already working on that
18:44 nwc10 just checking that I can run it stand alone
18:44 nwc10 then will stick it under gdb
18:44 jnthn Thanks
18:44 jnthn That looks like exactly the issue
18:45 jnthn It's probably gonna be something really silly :(
18:45 nwc10 s l o w
18:46 nwc10 PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
18:46 nwc10 9023 nick      20   0 17.0t 921m 7568 R 100.3 46.1   2:03.47 moar
18:46 * nwc10 has not seen a 't' before
18:49 nwc10 jnthn: http://paste.scsys.co.uk/271684
18:50 nwc10 I am not familiar *at all* with the source, but combining that with the previous, looks like a write by write_int32() 2 bytes over then end of an allocated 8192 byte buffer
18:51 nwc10 is there a way to get tmux to capture all the technicolor glory and paste it somewhere in colour?
18:51 FROGGS jnthn: valgrind: https://gist.github.com/FR​OGGS/ce17ba8f5f06ed009c7f
18:51 jnthn hmmm...that's while writing handlers
18:52 nwc10 snap!
18:52 jnthn #define FRAME_HANDLER_SIZE      4 * 4 + 2 * 2
18:52 jnthn That looks right...
18:54 grondilu shouldn't you ut parens around this?
18:54 grondilu #define FRAME_HANDLER_SIZE      (4 * 4 + 2 * 2)
18:54 nwc10 src/mast/compiler.c:        FRAME_HANDLER_SIZE * fs->num_handlers);
18:54 jnthn oh f**k
18:54 nwc10 I'm going for "yes"
18:54 nwc10 but I would not have thought of that
18:55 FROGGS haha
18:55 FROGGS that is a nice one
18:55 * grondilu remember this as a common thing to know about macros in C
18:55 nwc10 um, jnthn, that macro is defined in 2 places
18:55 grondilu always put parens
18:55 jnthn It is?
18:55 nwc10 $ git grep FRAME_HANDLER_SIZE
18:55 nwc10 src/core/bytecode.c:#define FRAME_HANDLER_SIZE      4 * 4 + 2 * 2
18:55 nwc10 ...
18:56 nwc10 src/mast/compiler.c:#define FRAME_HANDLER_SIZE      4 * 4 + 2 * 2
18:56 jnthn Thing that reads vs thing that writes
18:56 nwc10 oh yes
18:56 * FROGGS rebuilds
18:57 jnthn On the one hand, could try to share them. On the other, write only cares for current version whereas read may need to care for historical versions.
18:57 FROGGS src/6model/serialization.c:14:#define HEADER_SIZE                 4 * 16
18:58 nwc10 so, maybe, define it somewhere as a FRAME_HANDLER_SIZE_V1
18:58 nwc10 and FRAME_HANDLER_SIZE is defined as FRAME_HANDLER_SIZE_V1 (this week)
18:58 nwc10 I was wondering how to handle this
18:58 nwc10 slightly hacky way might end up with the reader being a C file that can be #included more than once to compile in V1, V2
18:58 nwc10 until V2 is bootstrapped
18:59 nwc10 repeat for V3
18:59 nwc10 or maybe that sucks too much
18:59 FROGGS src/strings/utf8.c:186:#define UTF8_MAXINC 32 * 1024 * 1024
19:01 FROGGS jnthn: Perl6::Actionbuilt!
19:01 FROGGS err, Perl6::Action built!
19:02 FROGGS src/Perl6/Grammar.nqp
19:02 FROGGS Bytecode validation error at offset 5562, instruction 1011:
19:02 FROGGS operand type 64 does not match register type 56
19:02 FROGGS that is my next stolperstein
19:02 nwc10 That builds for me with
19:02 nwc10 FRAME_HEADER_SIZE and FRAME_HANDLER_SIZE wrapped in ()
19:03 grondilu src/mast/compiler:  #define FRAME_HEADER_SIZE       7 * 4 + 3 * 2
19:03 grondilu ^ should put parens here as well
19:03 nwc10 http://paste.scsys.co.uk/271685
19:03 cognominal joined #moarvm
19:03 FROGGS grondilu: yes, four files all in all
19:04 * nwc10 tries `make -k` while going for food
19:05 grondilu r: say 7 * 4 + 3 * 2
19:05 camelia rakudo e22ac2: OUTPUT«34␤»
19:05 nwc10 oh, it failed before I stood up
19:06 * grondilu wonders if one can write #define FRAME_HEADER_SIZE  34 // 7 * 4 + 3 * 2
19:06 grondilu .oO( I don't remember if one can put comments in a preprocessor line)
19:07 FROGGS grondilu: there are... /* ... */ comments
19:08 dalek MoarVM: 4b95b95 | jnthn++ | src/ (2 files):
19:08 dalek MoarVM: Add needed parens around #define sizes.
19:08 dalek MoarVM:
19:08 dalek MoarVM: nwc10++, grondilu++ for discovering.
19:08 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/4b95b952d8
19:08 grondilu yeah but I was wondering if there is not a slight waste of resource when putting the whole arithmetic expression instead of its value
19:08 jnthn The constant folder will get it :)
19:09 jnthn That fixes the segfault, but I still get wrong bytecode out
19:10 jnthn When bulding Grammar.nqp and it loads the compiled actions:
19:10 jnthn Bytecode validation error at offset 5562, instruction 1011:
19:10 jnthn operand type 64 does not match register type 56
19:10 dalek MoarVM: 7f49f3f | (Tobias Leich)++ | src/ (2 files):
19:10 dalek MoarVM: Add needed parens around #define sizes. (#2)
19:10 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/7f49f3faca
19:37 nwc10 at HEAD, ASAN now expodes like this: http://paste.scsys.co.uk/271686
19:39 FROGGS so, we read from nowhere?
19:39 nwc10 not quite sure
19:41 FROGGS I am running valgrind now...
19:44 FROGGS valgrind++ https://gist.github.com/FR​OGGS/78ff60b293aa4e996c9b
19:45 FROGGS it seems to be the exit op
19:52 jnthn nwc10: What process explodes like that?
19:52 jnthn nwc10: erm, what invocation,s orry?
19:53 jnthn Building Actions.nqp still?
19:53 nwc10 /home/nick/Sandpit/moar/bin/moar --libpath=/home/nick/Sandp​it/moar/languages/nqp/lib /home/nick/Sandpit/moar/la​nguages/nqp/lib/nqp.moarvm --target=mbc --output=blib/Perl6/Grammar.moarvm --encoding=utf8 src/Perl6/Grammar.nqp
19:54 jnthn nwc10: Does it give an error?
19:54 nwc10 Bytecode validation error at offset 5562, instruction 1011:operand type 64 does not match register type 56frame_name_36
19:54 jnthn ok, same here then
19:54 nwc10 and then ASAN aborts
19:55 nwc10 well, but your terminal probably didn't mangle the newlines on pasting
19:55 nwc10 I tried to run it (a second build without ASAN) under valgrind, but valgrind itself seems to SEGV
19:58 jnthn Grrr...--dump shows that there is indeed a bizare code-gen fail...
19:59 FROGGS nwc10: my valgrind out looks like output of asan fwiw
20:04 nwc10 jnthn: OK, so you can likely solve that without external help?
20:04 nwc10 [Am I allowed to go to bed? :-)]
20:05 nwc10 but also, it implies that MoarVM is not yet hardened against "garbage in"
20:06 jnthn nwc10: Well, thing is, the validator correctly points out it's wrong
20:06 jnthn nwc10: It then crashes *after* the validator has thrown an exception refusing to execute the malformed code.
20:06 nwc10 oh.
20:06 nwc10 if I understand it correctly, "that would be bad"
20:07 jnthn Well, it'd be worse if it tried to actually run the invalid code. :)
20:07 jnthn FROGGS: It fails at exit, iiuc?
20:07 FROGGS jnthn: looks like
20:08 jnthn nwc10: Anyways, sleep is allowed ;-)
20:08 FROGGS both my valgrind and nwc's asan point to an invalid read of size 8 at interp.c line 3180
20:08 FROGGS which is exit(GET_REG(cur_op, 2).i64);
20:08 FROGGS so, the .i64 would fit
20:08 jnthn Yeah...But that's really odd
20:09 FROGGS yeah, I don't see anythong obvious in the declaration of the op, nor do I see a related call to exit
20:11 jnthn Well, the exit makes some sense
20:11 jnthn I think it's the one in HLL::Compiler
20:13 diakopter jnthn: you have asan
20:13 FROGGS which one of the six?
20:14 jnthn diakopter: You gave me access to a box with it
20:14 jnthn diakopter: I was gonna try that after dinner, but before I could get there others had already done it :)
20:14 nwc10 "the box", or "dinner"?
20:14 diakopter yeah I was reminding you :D
20:15 diakopter "there"
20:15 nwc10 jnthn: I susggest that you get there, as that way you can (re) validate things after I've turned in
20:17 diakopter 2>&1 |asan_symbolize
20:17 nwc10 monochrome :-(
20:17 nwc10 I want symbols and colour.
20:18 nwc10 pony is optional
20:24 FROGGS jnthn: you are right, if I comment out the first three exits from HLL::Compiler, it dies differently
20:26 FROGGS I'd think printing to stderr followed by nqp::exit(1) would look identical
20:28 FROGGS nqp: my $err := nqp::getstderr(); nqp::printfh($err, 'a'); nqp::exit(1);
20:28 camelia nqp: OUTPUT«a»
20:28 FROGGS nqp-m: my $err := nqp::getstderr(); nqp::printfh($err, 'a'); nqp::exit(1); # it needs a rebuild ó.ò
20:28 camelia nqp-moarvm: OUTPUT«Bytecode validation error at offset 22, instruction 4:␤register operand index 50 out of range 0..9␤»
20:31 FROGGS weird, it does not
20:31 FROGGS nqp -e 'my $err := nqp::getstderr(); nqp::printfh($err, "a\n"); nqp::exit(1);'
20:31 FROGGS a
20:31 FROGGS no error
20:32 FROGGS while uv_loop_delete explodes when I strip that nqp::exit(1)
20:43 FROGGS gnight
20:46 diakopter o/
20:46 diakopter what are we diagnosing now
20:49 FROGGS diakopter: https://gist.github.com/FR​OGGS/78ff60b293aa4e996c9b
20:51 jnthn diakopter: As for me, why Actions.nqp compiles to something wrong
20:53 diakopter Perl6? alrfeady?
20:53 jnthn yeah
20:54 FROGGS there were no more bugs to explore in nqp
20:54 jnthn It ends up trying to getcode into a str reg
20:54 jnthn Validator chokes on it, naturally
20:54 jnthn --dump confirms it
20:54 jnthn --target=mast also
20:54 diakopter hunh.
20:55 diakopter only thing I can think of that could cause that
20:55 diakopter is releasing a register in the qast compiler into the wrong list
20:55 jnthn But it's meant to be an exclusive register
20:56 diakopter line no?
20:56 diakopter well yeah
20:56 diakopter it's an exclusive one sure
20:56 diakopter but it wasn't before it was returned to the list
20:56 diakopter previously
20:57 diakopter where's the line no of the getcode emission
20:57 diakopter probably typo by me in some prior line
20:57 jnthn It's one of the ones generated for closure handling in QAST comp
20:57 jnthn See clone_inner
20:57 jnthn But it's stuff I added :)
20:59 * diakopter looking
21:04 diakopter line 937
21:04 diakopter could return a string register when it wants an obj
21:05 jnthn If it did, the stuff in the proto would take care of it
21:55 jnthn diakopter: It's very odd. I commented out all of actions.nqp and have been gradually uncommenting it. Reached a point where any one more method uncommented triggers the error.
21:57 jnthn And once again it looks like:
21:57 jnthn 00964   getcode      loc_7_str, Frame_447
21:57 jnthn 00965   takeclosure  loc_7_str, loc_7_str
22:00 jnthn oh my...
22:00 jnthn 00948   getcode      loc_255_obj, Frame_439
22:00 jnthn 00949   takeclosure  loc_255_obj, loc_255_obj
22:00 jnthn 00950   getcode      loc_0_obj, Frame_440
22:00 jnthn 00951   takeclosure  loc_0_obj, loc_0_obj
22:00 jnthn ...
22:03 jnthn eek!
22:03 jnthn write_int16(ws->bytecode_seg, ws->bytecode_pos, (unsigned char)l->index);
22:03 jnthn char?!
22:08 dalek MoarVM: 5c293a8 | jnthn++ | src/mast/compiler.c:
22:08 dalek MoarVM: Don't cast local/lexical indexes to 8-bit!
22:08 dalek MoarVM:
22:08 dalek MoarVM: They're meant to be 16. Also detect the out-of-range local case.
22:08 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/5c293a8e3b
22:16 timotimo i'm still getting the "Routine declaration requires a signature" error even though i set an absolute path as the prefix like i did in /tmp the one time it worked
22:17 timotimo though ... the nqp checkout is *under* the moarvm folder .. can that be it?
22:17 jnthn Feels unlikely to be; feels more like a weird heisenbug...
22:19 jnthn We now compile the Perl 6 actions and grammar
22:19 timotimo dependent on the strlen of the path? >_>
22:20 jnthn timotimo: Well, something memory-layout-ish / GCish
22:20 jnthn To progress further with Rakudo on MoarVM we need to finish the extops wiring :)
22:27 grondilu hang on:  nqp.moarvm can compile the Perl6 grammar and actions, now?
22:27 timotimo getting it to compile isn't terribly much more than compiling all of nqp ...
22:28 grondilu the difficult part will be the CORE.settings?
22:28 timotimo i imagine the metamodel is a bit complicated, too
22:29 grondilu ok
22:38 diakopter jnthn: how muxch mem
22:38 jnthn diakopter: didn't measure
22:39 * jnthn does so
22:39 diakopter time?
22:40 jnthn Grammar.nqp tops out at 260MB
22:40 jnthn Which is the highest anything reaches
22:40 jnthn Actions is less than that.
22:40 jnthn The stuff that builds so far takes around 47s here
22:41 diakopter my goal: 5s
22:41 jnthn :)
22:42 jnthn Yeah, we've lots of room to improve yet :)
22:42 diakopter .. and then 1s
22:42 jnthn Let's focus on making it work first, though ;)
22:42 diakopter *cry*
22:43 diakopter gerd said he'd work on extops today
22:44 jnthn Well, I'll be tied up tomorrow but can help with 'em a bit also on Tuesday maybe...
22:44 jnthn I reckon by this time in a week we can have everything that comes before CORE.setting compiling.
22:48 diakopter .ask not_gerd ,
22:48 yoleaux diakopter: I'll pass your message to not_gerd.
22:50 jnthn Anyway, this is fairly nice progress...
22:50 jnthn 'night o/
22:51 lue I get a segfault trying to compile NQP (using Clang for this): https://gist.github.com/lue/6968277
22:51 diakopter oop
22:56 benabik joined #moarvm
22:58 diakopter okay let's see about getting my phone to build this thing

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