Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2013-11-26

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

All times shown according to UTC.

Time Nick Message
00:10 benabik joined #moarvm
00:14 timotimo i don't know how to do the roots thing, so i'll just leave it out for now and someone else can fix it :)
00:17 lizmat_ joined #moarvm
00:20 * timotimo requested a pull
00:21 diakopter timotimo: :)
00:21 diakopter need to root the first one around the next two statements
00:22 timotimo you mean i need to temp_root first_part and then pop it before returning the result?
00:22 diakopter timotimo: substring allocates
00:22 diakopter yes
00:23 diakopter bbl
00:23 timotimo pop without _n takes only tc, right?
00:24 timotimo Error while compiling op newexception: MoarVM op 'newexception' is unknown as a core or extension op
00:24 timotimo probably not as simple to implement
00:24 timotimo so i'll go to bed instead :)
00:26 timotimo huh, it actually looks really simple in java
00:33 timotimo well. maybe tomorrow.
01:13 jnap joined #moarvm
01:15 Ben_Goldberg joined #moarvm
01:21 BenGoldberg joined #moarvm
01:43 jnap joined #moarvm
01:44 dalek joined #moarvm
01:45 BenGoldberg joined #moarvm
04:13 jnap joined #moarvm
04:27 benabik joined #moarvm
06:15 jnap joined #moarvm
07:24 benabik joined #moarvm
07:55 FROGGS joined #moarvm
08:17 jnap joined #moarvm
08:47 ssutch joined #moarvm
09:38 benabik joined #moarvm
10:18 jnap joined #moarvm
10:51 tgt joined #moarvm
11:02 nwc10 jnthn: current rakudo-moar SEGVs for me on Linux
11:03 nwc10 been running valgrind for a while; no answer yet
11:03 nwc10 my NQP is cursor-mem-opts, or whateever it's called.
11:03 FROGGS nwc10: that even might be the problem I have/had using an optimized moar
11:03 FROGGS nwc10: you can use master now again, since I merged that branch in
11:20 FROGGS timotimo: if line 410 allocates, your MVMString *replacement might be borken
11:21 timotimo even in the newest commit?
11:21 FROGGS e180e3b
11:22 timotimo yeah
11:22 timotimo i don't understand :)
11:23 FROGGS you need to protect the objects that  a) might get moved due to some allocation   that  b) will get used later on
11:24 timotimo oh, so before i do first_part, i need to push replacement as a temporary root?
11:24 FROGGS so, you need to protect first_part, because 413 might allocate and you use it in 416
11:24 FROGGS correct
11:25 timotimo okay. and i don't need to protect original, because i only use it once at the start
11:25 FROGGS either you protect replacement there, or in the code that calls MVM_string_replace
11:25 timotimo is the rest_part temp push correct there?
11:26 FROGGS right, and there is no allocation before the only usage of original
11:26 FROGGS yes
11:29 FROGGS (I am glad that I finally understand it)
11:32 timotimo that new commit should do it finally
11:34 timotimo nope.
11:36 timotimo JimmyZ: thank you for your comments :)
11:40 FROGGS timotimo: err, you are pushing twice and popping 3
11:41 timotimo GOD DAMNIT
11:41 timotimo i'm going to squish all those commits now :)
11:43 FROGGS +1
11:43 FROGGS :o)
11:45 nwc10 Normal: Stage parse      : 396.823
11:45 nwc10 Valgrind: Stage parse      : 6522.205
11:45 timotimo hah
11:45 timotimo yeah :|
11:46 nwc10 expect next output to be the cause of the SEGV.
11:50 nwc10 OK, how does this get mangled:
11:50 nwc10 ==27229== Invalid read of size 2
11:50 nwc10 ==27229==    at 0x4F00883: MVM_interp_run (interp.c:2093)
11:50 nwc10 ==27229==    by 0x4F8928F: MVM_vm_run_file (moar.c:150)
11:50 nwc10 ==27229==    by 0x400C9D: main (main.c:137)
11:50 nwc10 ==27229==  Address 0x4 is not stack'd, malloc'd or (recently) free'd
11:51 nwc10 now running with gdb, as I'm guessing that's a structure access on a NULL pointer
11:52 arnsholt Yeah, that sounds plausible
11:53 timotimo that's not exactly helpful. it's just the same as gdb would tell us
11:53 timotimo we're doing an atpos_o on a null object
11:53 timotimo IS_CONCRETE(obj) blows up because it's a null pointer
11:55 nwc10 timotimo: except that it does tell us that there was no undefined behaviour prior to the thing that gdb says
11:55 timotimo oh!
11:55 timotimo good
11:55 timotimo when i'm in gdb at such a point, how do i find out where in the source code i am? can i easily get at the last line annotation?
11:57 nwc10 I think `where` might be the answer you're looking for
11:58 nwc10 and yes, "IS_CONCRETE(obj) blows up because it's a null pointer"
11:58 * nwc10 is now out to lunch
12:05 arnsholt timotimo: As long as you've got stuff compiled with -g, backtrace gives you the backtrace to where you're at
12:06 timotimo but not an nqp-level backtrace :)
12:06 arnsholt Oh, that kind of backtrace
12:06 arnsholt Not AFAIK. jnthn would know, but probably not
12:07 timotimo jnthn is teaching right now, right?
12:07 timotimo maybe he'll get some insight in the evening
12:35 FROGGS timotimo: you use original twice now... was it like that before too?
12:36 timotimo yeah
12:36 timotimo i have to cut it up into two pieces
12:36 timotimo one goes before the replacement, one goes after
12:37 FROGGS I'm sorry, but I think you need to temp_push it then
12:37 timotimo JimmyZ: told me i don't :)
12:37 timotimo oh, wait. that was for something else
12:38 FROGGS that was for rest_part
12:38 timotimo there's the commit that fixes it
12:44 dalek MoarVM: b2da0b7 | (Timo Paulssen)++ | / (8 files):
12:44 dalek MoarVM: naively implement nqp::replace
12:44 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/b2da0b7cfc
12:44 dalek MoarVM: 1522b37 | (Timo Paulssen)++ | src/strings/ops.c:
12:44 dalek MoarVM: protect the original string between substring invocations
12:44 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/1522b37753
12:44 dalek MoarVM: 0f2ec72 | (Tobias Leich)++ | / (8 files):
12:44 dalek MoarVM: Merge pull request #64 from timo/replace_op
12:44 dalek MoarVM:
12:44 dalek MoarVM: naively implement nqp::replace
12:44 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/0f2ec72d03
13:09 FROGGS jnthn: it now builds m-BOOTSTRAP here using an optimized moar
13:09 diakopter timotimo: heh, if you're going to re-use rest_part like that, why need "result"? :)
13:10 cognominal__ joined #moarvm
13:10 diakopter nwc10: right.. moar will crash right now on null pointers because no one's done the retrofitting for the special null-object
13:12 jnap joined #moarvm
13:12 diakopter (but yes, IS_CONCRETE and friends will unfortunately need null-object checks added as well)
13:31 timotimo because i code without thinking
13:34 lizmat_ .oO( I don't paint, I hit! )
13:41 cognominal joined #moarvm
14:06 FROGGS do we actually know where the null pointer comes from?
14:50 jnap joined #moarvm
15:00 FROGGS gdb++ # "warning: Source file is more recent than executable."
15:03 benabik joined #moarvm
15:23 jnthn FROGGS: No, but that's easy enough to do: just add a null check at that point that throws an exception and see where we are :)
15:23 jnthn (but don't commit it)
15:25 FROGGS jnthn: ahh
15:25 FROGGS okay
15:26 FROGGS I added a breakpoint, but yes, a common nqp-ish die() would be better :o)
15:26 * FROGGS adds that to all IS_CONTRET and commits
15:26 FROGGS MUHAHAHAHAA
15:28 FROGGS gah!
15:28 FROGGS now I am even not typing C correctly on a keyboard where that key actually works >.<
15:34 FROGGS umm
15:34 FROGGS jnthn: I was meant to add a MVM_panic, right?
15:34 FROGGS looks like I need to pass --ll-exception?
15:36 FROGGS jnthn: can't I just call dump_backtrace(tc) ?
15:39 jnthn MVM_throw_adhoc(tc, "oops");
15:40 diakopter MVM_exception_throw_adhoc
15:42 jnthn that one :)
15:45 FROGGS src/Perl6/World.nqp:980  (blib/Perl6/World.moarvm:prefix:<+^>:13)
15:45 jnthn wat...
15:46 FROGGS WAT
15:49 FROGGS no
15:49 FROGGS I think I messed with the backtrace... wait a sec
15:51 jnthn Gonna head back to the hotel now, so you can have plenty of secs
15:51 jnthn bbi20 or so
15:52 diakopter jnthn: I'm sure FROGGS appreciates you giving him more secs
15:52 FROGGS 20s? uhhh
15:52 FROGGS it must explode every second
15:53 FROGGS >.<
15:53 FROGGS now it did not explode :(
16:03 FROGGS MVM_exception_throw_adhoc seems to be noop-ish
16:05 FROGGS ohh, I wonder...
16:16 benabik joined #moarvm
16:22 FROGGS that is the bt I got earlier using backtracestrings(): https://gist.github.com/FROGGS/221a6f1254a114459581
16:22 FROGGS MVM_exception_throw_adhoc just does nothing :/
16:42 jnthn diakopter: argh :P
17:09 jnthn bah, it does nothing 'cus something is catching the exception if it gets thrown...
17:14 ssutch joined #moarvm
17:47 FROGGS[mobile] jnthn: then my backtracestrings are right-ish
17:50 dalek joined #moarvm
18:27 FROGGS joined #moarvm
18:28 jnap joined #moarvm
18:31 FROGGS ahh, I meant dump_backtrace() btw
18:39 FROGGS jnthn: btw, it must be something in P6::W line 975-980, when I add a newline before that block, and one after it, it complains about line 981 instead 980
18:39 FROGGS and it would complain about 982 if it was something after that
18:40 FROGGS I can't really parse the bt though
18:40 FROGGS from src/Perl6/World.nqp:981  (blib/Perl6/World.moarvm:prefix:<+^>:13)
18:41 FROGGS is it possible that it compiles a ode object about prefix:<+^> ?
18:42 * FROGGS comments them out in Int.pm and similar
18:43 * jnthn looks
18:45 jnthn FROGGS: Oh, it's the stub code, which take sthe name of whatever it's stubbing
18:46 FROGGS jnthn: what stub code?
18:46 jnthn The dynamic comp stubb
18:47 jnthn But I dunno where the empty/null array comes from
18:47 jnthn Or is tht the top line of the backtrace?
18:47 FROGGS now it omplains about infix:<~> after commenting out:
18:47 FROGGS /home/froggs/dev/rakudo/src/core/Int.pm:268:multi prefix:<+^>(Int:D \a) {
18:47 FROGGS /home/froggs/dev/rakudo/src/core/Int.pm:271:multi prefix:<+^>(int $a) {
18:47 FROGGS hehe is the bt: https://gist.github.com/FROGGS/221a6f1254a114459581
18:48 jnthn oh...
18:48 jnthn my $past := nqp::getattr($_, $code_type, '$!compstuff')[0];
18:48 jnthn It's that [0]
18:49 FROGGS so we just need to check if getattr gives us something? or do we need to fix the part that needs to put something into compstuff?
18:51 eternaleye joined #moarvm
18:51 jnthn Yeah. Got a patch locally
18:51 jnthn No, it's fine compstuff is gone by then I think...
18:58 jnthn FROGGS: Pushed it. Now we're into the mast phase.
18:58 jnthn I get something about replace, but I saw that got worked on earlier...
18:59 FROGGS I think timotimo wanted to grab that task, but I think he has not started yet
18:59 jnthn I'll maybe look more after some dinner BUT I also promised somebody to finish their slides...
18:59 jnthn ah, ok
18:59 FROGGS <dalek> MoarVM: b2da0b7 | (Timo Paulssen)++ | / (8 files):
18:59 FROGGS <dalek> MoarVM: naively implement nqp::replace
18:59 jnthn Anyways, nice that we now make it to one of the final compilation stages.
18:59 FROGGS hold on, that is there
19:00 jnthn Oh, I didn't pull anything yet
19:00 FROGGS yes, very nice :o)
19:08 * FROGGS maps replace now
19:16 FROGGS right, the next one is newexception
19:23 * FROGGS tests
19:31 dalek MoarVM: 77490b3 | (Tobias Leich)++ | / (6 files):
19:31 dalek MoarVM: implemented op newexception
19:31 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/77490b3be2
19:32 FROGGS now:
19:32 FROGGS Stage optimize   :  39.860
19:32 FROGGS Error while compiling op p6routinereturn: No registered operation handler for 'p6routinereturn'
19:37 nwc10 Stage optimize   :  87.342Error while compiling op newexception: MoarVM op 'newexception' is unknown as a core or extension op
19:38 nwc10 om nom nom. terminal eats newlines
19:38 FROGGS nwc10: pull moarvm :o)
19:58 nwc10 Error while compiling op p6routinereturn: No registered operation handler for 'p6routinereturn'
19:59 FROGGS right
20:03 cxreg joined #moarvm
20:03 cxreg (taking to the right channel) node.js had a usage bug against libuv, not sure if it's interesting or relevant here
20:03 cxreg http://www.joyent.com/blog/walmart-node-js-memory-leak
20:04 cxreg https://github.com/joyent/node/commit/16934d9210546bf19d4af8d98652aa5d636ce693
20:04 cxreg i don't grok the API enough to know, but it looks subtle so i thought you'd like to see it
20:05 * FROGGS reads
20:06 FROGGS cxreg++
20:06 FROGGS that sounds highly relevant
20:06 cxreg cool
20:06 FROGGS now I can bang my head aginst the handles again :o)
20:06 cxreg :)
20:12 FROGGS ahh, no... I misread, I thought it actually is about filehandles :o(
20:15 cxreg it's not?  i thought so too
20:16 FROGGS it is about callback handles
20:21 FROGGS p6routinereturn seems doable
20:23 * jnthn has forgotten what it even does :)
20:26 FROGGS I would almost guess that this has something to do return from subs through a pointy
20:26 FROGGS with returning*
20:35 * FROGGS stubbed p6routinereturn
20:42 FROGGS p6recont_ro is missing after that
20:43 jnthn Port it or stub it... :)
20:45 FROGGS I'll port p6routinereturn first I think
20:45 jnthn k
21:00 FROGGS I think I'll just stub it :o(
21:00 jnap joined #moarvm
21:02 jnthn ETOOSCARY?
21:02 woolfy left #moarvm
21:02 FROGGS a bit
21:04 woolfy joined #moarvm
21:37 FROGGS p6finddispatcher would be next
21:38 jnthn Even stubbing all of these helps
21:38 FROGGS really?
21:38 jnthn Yeah.
21:38 FROGGS k
21:38 jnthn #cus if it's me that needs to write them, I can fill out the stubs without too much trouble
21:39 jnthn But creating them is tedious :)
21:39 FROGGS sounds good :o)
21:39 jnthn If there's any binder ones left, though, don't turn them into ops
21:39 jnthn They become methods in the Binder class in BOOTSTRAP
21:40 FROGGS k
21:53 BenGoldberg joined #moarvm
22:52 FROGGS maybe I do xor tomorrow when my brane is awake again
22:56 jnthn Sounds like a good xor bad idea...
23:02 FROGGS hehe
23:23 ssutch joined #moarvm
23:40 * FROGGS compiles xor
23:40 FROGGS it is already tomorrow, isnt it?
23:40 timotimo yeah :)
23:51 FROGGS p6stateinit would need stubbing then
23:51 timotimo can you tell to which line we get?
23:55 FROGGS no, can't tell

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