Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2017-04-02

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

All times shown according to UTC.

Time Nick Message
00:01 geekosaur joined #moarvm
01:07 Geth ¦ MoarVM/moar-gdb-prettyprinter: 0f5af03880 | (Timo Paulssen)++ | tools/moar-gdb.py
01:07 Geth ¦ MoarVM/moar-gdb-prettyprinter: WIP on moar-gdb MVMObject pretty-printer
01:07 Geth ¦ MoarVM/moar-gdb-prettyprinter: review: https://github.com/MoarVM/MoarVM/commit/0f5af03880
01:07 Geth ¦ MoarVM/moar-gdb-prettyprinter: fc5a7bbefc | (Timo Paulssen)++ | tools/moar-gdb.py
01:07 Geth ¦ MoarVM/moar-gdb-prettyprinter: ugly WIP
01:07 Geth ¦ MoarVM/moar-gdb-prettyprinter: review: https://github.com/MoarVM/MoarVM/commit/fc5a7bbefc
01:07 Geth ¦ MoarVM/moar-gdb-prettyprinter: c565d019ae | (Timo Paulssen)++ | tools/moar-gdb.py
01:07 Geth ¦ MoarVM/moar-gdb-prettyprinter: WIP on object prettyprinter. does MVMArray now!
01:07 Geth ¦ MoarVM/moar-gdb-prettyprinter: review: https://github.com/MoarVM/MoarVM/commit/c565d019ae
01:07 timotimo ^- this is half a thing now
01:11 Geth ¦ MoarVM/moar-gdb-prettyprinter: 4bd42ed675 | (Timo Paulssen)++ | tools/moar-gdb.py
01:11 Geth ¦ MoarVM/moar-gdb-prettyprinter: throw out last pieces of fallback mechanism
01:11 Geth ¦ MoarVM/moar-gdb-prettyprinter: review: https://github.com/MoarVM/MoarVM/commit/4bd42ed675
01:48 ilbot3 joined #moarvm
01:48 Topic for #moarvm is now https://github.com/moarvm/moarvm | IRC logs at  http://irclog.perlgeek.de/moarvm/today
02:53 committable6 joined #moarvm
02:57 committable6 joined #moarvm
04:04 AlexDaniel joined #moarvm
04:08 madgoat joined #moarvm
04:10 madgoat left #moarvm
04:33 dogbert17_ joined #moarvm
04:54 ZofBot joined #moarvm
05:26 samcv oooo nice
05:47 geekosaur joined #moarvm
08:10 geekosaur joined #moarvm
08:17 spebern joined #moarvm
08:18 spebern joined #moarvm
08:34 Zoffix joined #moarvm
09:44 domidumont joined #moarvm
09:49 domidumont joined #moarvm
10:41 Ven joined #moarvm
12:25 praisethemoon joined #moarvm
12:25 praisethemoon joined #moarvm
12:29 Ven joined #moarvm
13:02 Ven_ joined #moarvm
13:12 Ven_ joined #moarvm
13:37 AlexDaniel joined #moarvm
13:58 Ven joined #moarvm
14:22 Ven_ joined #moarvm
15:03 Ven joined #moarvm
15:10 Ven_ joined #moarvm
15:15 zakharyas joined #moarvm
15:19 Ven_ joined #moarvm
15:27 Ven_ joined #moarvm
15:35 Ven_ joined #moarvm
17:12 MasterDuke timotimo: have you looked at https://github.com/MoarVM/MoarVM/issues/571? see anything obvious there?
17:14 timotimo the valgrind output from further above is 99% spam from libcrypto using stack values as an entropy source
17:15 timotimo the stack traces are not worth a lot because they contain jit frames, which don't properly set up the stack for unrolling
17:15 timotimo with those issues combined i haven't the slightest clue :)
17:15 timotimo dinner time! \o/
17:17 jnthn Maybe MVM_JIT_DISABLE=1 might make it fail differently/more informatively
17:18 MasterDuke just added that
17:18 MasterDuke but it does look a little different
17:19 MasterDuke odd that's it's always the 8th iteration
17:21 MasterDuke any other options/flags to try?
17:53 timotimo you could twiddle the size of the nursery, or put force_gc into that loop
17:54 timotimo huh, quite interesting that it's crashing in an argument-related opcode
17:54 timotimo MasterDuke: could you see what happens when you disable spesh via MVM_SPESH_DISABLE?
17:54 MasterDuke and JIT_DISABLE?
17:56 timotimo you can't have jit without spesh
17:56 MasterDuke no crash the first time with MVM_SPESH_DISABLE=1
17:57 timotimo i feared as much
17:58 MasterDuke or the next two times (and it happens every time without)
17:59 timotimo i'll have a speshial look at this issue
17:59 MasterDuke JIT_DISABLE and adding a nqp::force_gc() in the loop made no difference
18:00 MasterDuke what's that spesh delay option?
18:00 timotimo right, if my hypothesis is correct, it's a spesh issue
18:00 timotimo broken is what it is :D
18:00 MasterDuke heh
18:00 timotimo it's sort of a "global warming"
18:00 timotimo that's the idea anyway
18:01 timotimo what i find interesting is that it crashes both with profile and profile=heap
18:01 timotimo profile itself will instrument the bytecode, but the heap profiler just sucks out a bunch of data every time gc runs
18:01 vendethiel joined #moarvm
18:02 MasterDuke just MVM_SPESH_NODELAY=1 made no difference, still crashed at the 8th iteration
18:03 timotimo wait, what commandline should i be running?
18:03 MasterDuke 'use HTTP::UserAgent; my $ua = HTTP::UserAgent.new; (^10).map: { say $_; $ua.get("https://perl6.org"); }'
18:03 timotimo OK
18:04 timotimo using --profile is mandatory?
18:04 MasterDuke i'm not sure it crashes every time with --profile=heap, but it does every time with just --profile
18:04 MasterDuke yeah
18:04 timotimo i'm getting a test failure ...
18:04 timotimo when trying to install HTTP::UA
18:04 timotimo # Expected: HTTP::UserAgent::X::HTTP::Response
18:04 timotimo # Got:      HTTP::UserAgent::X::HTTP::Internal
18:04 MasterDuke i just cloned it and pointed there
18:04 timotimo # Exception message: Internal Error: 'server returned no data'
18:05 timotimo for some reason that failing test didn't change anything about the installation result ?!?
18:07 timotimo interesting, i run it under valgrind and even though the url is https:// i don't get the massive amounts of spam from the crypto lib
18:09 MasterDuke maybe your ssl is compiled with valgrind-friendly options?
18:10 matiaslina joined #moarvm
18:10 MasterDuke annoyingly i can't use --profile=heap with more than 3 iterations because the OOM killer rears its ugly head
18:10 timotimo that's possible
18:10 timotimo ah, i see
18:11 timotimo yeah, heap snapshots are a bit expensive; we might want to look into compressing that actually. though another suggestion was to make it able to write out heap snapshot data after each GC run
18:11 timotimo which would also give you results even if your program crashes
18:12 timotimo anyway, i've compiled with --valgrind
18:12 timotimo which, among other things, puts in a redzone around the fixedsize allocator pieces
18:12 timotimo i saw an "add bin to freelist" or whatever function in one of the stacktraces
18:12 timotimo that could have something to do with this
18:13 MasterDuke yeah, i got/get that when i don't use MVM_JIT_DISABLE
18:14 timotimo 4 repetitions so far
18:15 timotimo 5
18:15 MasterDuke i don't usually get this many `in ?? ()` when i compile with --debug=3. think it may be something in the ssl bindings?
18:17 MasterDuke nope, i get the same thing from a plain http:// site
18:17 timotimo oh, cool
18:18 timotimo that.s probably a whole lot fewer instructions
18:18 MasterDuke all the behavior/output/errors are exactly the same
18:22 timotimo cool.
18:24 timotimo oh
18:24 timotimo but
18:24 timotimo perl6.org will immediately redirect you to the https site
18:24 MasterDuke i used http://irclog.perlgeek.de/
18:27 timotimo ah, good
18:29 timotimo i want a disassembler (bytecode dumper, whatever) to use from inside gdb ...
18:31 timotimo hm. i wonder how we end up calling into a frame that definitely has named arguments, but it doesn't set up a "named used" field at all, as the size for that is set to 0
18:32 timotimo it should explode a bit earlier than that because it's trying to access the third argument, but there are only two
18:34 MasterDuke can you tell what they are?
18:36 timotimo yeah
18:36 timotimo the frame is !cursor_init
18:37 timotimo (gdb) print tc->cur_frame->params.args[0]
18:37 timotimo $7 = {o = MVMObject * (IETF::RFC_Grammar::URI),
18:37 timotimo (gdb) print tc->cur_frame->params.args[1]
18:37 timotimo $8 = {o = MVMObject * (Scalar), s = , i8 = -40 '\330', u8 = 216 '\330', i16 = -7208, u16 = 58328, i32 = -158407720,
18:39 MasterDuke fwiw i just ran 100 iterations without --profile, completed just fine
18:40 timotimo and the scalar in the first arg contains a Str
18:40 MasterDuke 200
18:40 timotimo mhm
18:41 timotimo right, the profiler's instrumentation must be b0rking somethign somewhere
18:45 timotimo but the heap profiler *also* makes it bork
18:45 timotimo so what gives?
18:46 timotimo or, wait, you couldn't test it because of not enough ram?
18:46 MasterDuke much harder to make the heap profiler do it, maybe it's not related?
18:46 timotimo oh yeah, printed 2, and it's already reached past 4 gigs
18:46 timotimo holy crap, ouchies
18:46 timotimo eats up ram *fast*
18:46 timotimo like, hockey stick fast
18:47 MasterDuke the very first time i got a segv it was with the heap profiler, on the first iteration, but i haven't been able to get another one with the heap profiler
18:47 timotimo welllll, it *could* have been segfault due to memory exhaustion
18:48 timotimo though ... we should MVM_panic in those cases
18:49 MasterDuke is there a way to make perl6-gdb-m quit if the program finishes normally?
18:50 timotimo yeah, should be possible
18:50 timotimo like, set a breakpoint for the end, then "commands", "quit" or something
18:51 MasterDuke hm, i want to run it in a loop
18:51 MasterDuke whil perl6-gdb-m; do true; done;
18:52 timotimo yeah, it should be possible to give it commands to immediately run
18:53 MasterDuke it immediatly runs, but then pauses at the end. i want it to pause if there was a problem, but not pause otherwise
18:53 * timotimo puts more zram in
18:53 timotimo https://stackoverflow.com/questions/3740754/make-gdb-quit-automatically-on-successful-termination
18:55 MasterDuke cool, i'll try to get that working
18:56 timotimo \o/
18:56 MasterDuke found something?
18:58 timotimo nah
19:01 timotimo ouch. system got stuck for a couple minutes because of OOM
19:03 timotimo it runs so much faster with httpbin.org/ip <3
19:03 timotimo but also it doesn't crash with the heap snapshot in these 10 requests
19:04 timotimo ok, but with --profile it still crashes on the 8th run
19:05 timotimo it's basically impossible to get this kind of crash without the profiler, right?
19:06 MasterDuke so far
19:06 geekosaur joined #moarvm
19:07 MasterDuke i'm running both perl6-valgrind-m and perl6-gb-m in a loop with --profile=heap and just one iteration, no segv so far
19:08 timotimo interesting
19:08 timotimo where do you get all this ram? :)
19:08 MasterDuke i only have 8g, that's why i'm only doing one iteration
19:09 MasterDuke while ./install/bin/perl6-gdb-m --profile=heap --profile-filename=hp.prof -e 'use HTTP::UserAgent; my $ua = HTTP::UserAgent.new; $ua.get("http://irclog.perlgeek.de/");'; do true; done;
19:13 timotimo if it's indeed a spesh-related issue, it'll be impossible to trigger in the first iteration
19:15 MasterDuke the first time i got the segv with the heap profiler it was just one iteration, but maybe it's not related?
19:16 timotimo huh
19:16 timotimo well, it could be a different crashbug
19:16 timotimo the profilers aren't exactly battle-hardened
19:17 MasterDuke oh, damn. it wasn't printing iterations
19:17 MasterDuke that first time
19:17 timotimo oh, so it could have been any run?
19:18 MasterDuke i guess, though it probably couldn't have been more than 4 or i would have just run out of ram
19:18 timotimo mhm
19:19 timotimo oh, in addition to that, it seems like i filled up my hard drive
19:20 MasterDuke heh, that's why i set the filename so they just overwrite each other
19:20 timotimo right, i could/should have set it to /tmp/something, as that's a tmpfs if i'm not mistaken
19:38 spebern joined #moarvm
19:43 samcv timotimo, what is httpbin.org/ip
19:43 timotimo it's less than 1kb big
19:43 samcv yeah i see that
19:43 samcv how does it make your system faster
19:44 timotimo reduces memory usage by a lot, also creates fewer objects, i.e. the heap snapshots will not be as big
19:44 samcv ah
19:44 timotimo huh. wat.
19:45 timotimo recv from IO/Socket.pm is taking 35% of the total time
19:45 MasterDuke wonder if it would be even better to have something running on localhost serving up a tiny file
19:45 timotimo and initialize from IO/Socket/INET.pm is another 27%
19:47 timotimo maybe --optimize=1 screws the profile over a whole lot
19:50 samcv i'm pissed off my phone is broken
19:50 timotimo :(
19:50 samcv like was at the tail end of warrenty. so sent it in last month. then got it back 2 weeks ago
19:50 samcv then it died a few days ago. have to send it back again
19:50 samcv which is insane
19:50 samcv pls send me non broken phone LG :(
19:51 timotimo >:(
19:52 samcv i was worried that they might not accept it back because the paper said that if your phone has 30 days of warrenty left, and get a replacement it's covered only 30 days, uness you have less than 30 days in which case you get 90 days warrenty
19:52 samcv which is kind of BS
19:53 samcv should just have it be 90 days or however long your warrenty is left, whichever is larger.
19:53 samcv at least i know for sure i get the 90 days because the warrenty is def up as of last week
19:53 samcv and now i have no phone for another week and a half…
19:54 timotimo ugh ugh.
19:57 zakharyas joined #moarvm
19:59 spebern hi I wanted to ask again on opinions on the nativecall feature to get a way of having an array of structs in contiguous memory
19:59 spebern I think the best way to have that is a new time like timotimo suggested
19:59 spebern so I implemented a version
20:00 spebern just not sure about one case
20:00 spebern what should happen if @arr[1] = $some_struct;
20:00 timotimo same as in C, has to be copy semantics
20:00 spebern this is how I did it
20:01 spebern should it also move the cpointer of the struct?
20:02 spebern I mean so that the cstruct pointer inside the struct object points to the arrray's storage
20:03 timotimo no, i wouldn't expect changes to @arr[1].somefield to be reflected in $some_struct
20:03 spebern ok, nice :-). that would complicate things quite a bit. At least I think so
20:04 matiaslina timotimo, MasterDuke, I just found that MVM_SPESH_INLINE_DISABLE=1 makes the program to not crash
20:04 sivoais joined #moarvm
20:04 timotimo it would mean we'd have to do some extra bookkeeping so that both the struct and the struct inside the array keep the memory region alive
20:05 timotimo otherwise: fantastic explosions all around
20:05 spebern yes :D
20:05 spebern I'm gonna look at the code again this week and then push it to my fork
20:05 timotimo matiaslina: inline? oh nope, nope, nope, nope, nope :)
20:06 spebern also I wanted to ask if there is already a way or a plan for something like creatting "**flat_struct_array"
20:07 spebern *creating
20:07 timotimo apart from just Pointer[CArrayOfStruct[Struct]]?
20:07 matiaslina anything wrong with that?
20:08 timotimo matiaslina: it's quite a difficult piece of code
20:08 spebern what if I want to initialize that
20:08 spebern Pointer only has a constructor that takes an int
20:08 timotimo you'd have to CArrayOfStruct.new and somehow give it a size
20:09 timotimo oh, how do we do that usually ...
20:09 spebern isn't CArrayOfStruct.new something like *carray_of_struct?
20:09 timotimo yeah
20:10 spebern for the bindings that I wanted to write I need **carray_of_struct
20:10 TimToady joined #moarvm
20:10 spebern and I haven't figured out a way to do that
20:10 timotimo you can definitely "is rw" into the parameter
20:11 timotimo i mean "CArrayOfStruct[MyStruct] $foo is rw"
20:11 timotimo it'll give a layer of indirection
20:12 spebern ok, I'll try that, thank you :-)
20:12 timotimo cool!
20:12 timotimo looking forward to that contribution
20:12 spebern hope it's not that bad, too me it seems like it is bit of a copy of the carray code
20:13 spebern *to me
20:13 timotimo yeah, probably has to be :<
20:17 timotimo C doesn't lend itself to code-reuse if things are just slightly different in the right ways
20:29 spebern I'm out, good night
20:32 timotimo have a good one!
20:32 spebern left #moarvm
20:57 matiasli1a joined #moarvm
21:16 MasterDuke matiasli1a: we've got it easily reproducable with just --profile, but not --profile=heap. maybe you can figure out a repro for that?
21:23 MasterDuke timotimo: still around? interested in some unsignedness questions?
21:24 timotimo oh
21:24 timotimo maybe? :)
21:24 MasterDuke well, i added bindattr_u and bindattrs_u ops to moar
21:25 MasterDuke copied bindattr_i, just changing to MVM_reg_uint64
21:26 MasterDuke and added is_unsigned to MVMNativeRefREPRData
21:27 MasterDuke and added MVM_nativeref_write_lex_u
21:27 matiaslina joined #moarvm
21:28 MasterDuke and in a couple places added `if (repr_data->is_unsigned) { <do unsigned stuff> } else { <do pre-existing code> }`
21:29 MasterDuke and the unsigned branch gets called
21:29 MasterDuke ...however...
21:29 timotimo mhm?
21:31 MasterDuke you can still assign a negative number to an unsigned attribute
21:31 MasterDuke and it interprets it as unsigned
21:32 MasterDuke which makes sense, you just give it 64 bits, it interprets those bits as you tell it to
21:32 matiasli1a joined #moarvm
21:33 timotimo ah, so the problem is we don't have unsigned literals?
21:33 MasterDuke possibly
21:33 timotimo or, you know, a conversion operator, or what
21:34 MasterDuke m: my $a = class :: { has uint64 $.foo is rw }.new( foo => -1 ); say $a.foo
21:34 camelia rakudo-moar ca1acb: OUTPUT: «-1␤»
21:35 MasterDuke that should die
21:36 MasterDuke P6bigint.set_uint is being called, so that part is right
21:37 timotimo mhm
21:37 MasterDuke but somehow, somewhere, it (rakudo, nqp, moar) should die
21:38 timotimo i find it really mind-boggling, the whole topic
21:38 MasterDuke same here
21:39 timotimo i have no idea what places should do conversion or what
21:41 MasterDuke right. P6bigint.set_uint takes a MVMuint64, i don't think it can know whether it got a "wrong" value
21:41 MasterDuke it should just set the value its given
21:42 timotimo right, that's impossible
21:42 MasterDuke but even in the first place (i think) where that code i just showed gets into moar from perl6, bindattr_u
21:43 MasterDuke it's doing: REPR(obj)->attr_funcs.bind_attribute(tc, STABLE(obj), obj, OBJECT_BODY(obj), GET_REG(cur_op, 2).o, GET_REG(cur_op, 4).s, -1, GET_REG(cur_op, 6), MVM_reg_int64);
21:43 timotimo perhaps we need to be putting some stuff into the mast compiler
21:43 timotimo it ought to know if a register is signed or unsigned?
21:43 MasterDuke oops, copied the wrong one, it's actually MVM_reg_uint64
21:44 MasterDuke is there any way to know there if the value it's GET_REGing is negative?
21:45 timotimo hm, you ought to be able to ask the frame what type the register is
21:45 MasterDuke ah, how does one do that?
21:46 timotimo MVMStaticFrameBody -> local_types, i think?
21:56 MasterDuke i just got myself more confused
21:59 MasterDuke hm, i'm now in p6box_u
22:02 MasterDuke which is in rakudo, and just does: GET_REG(tc, 0).o = MVM_repr_box_uint(tc, Int, GET_REG(tc, 2).u64);
22:43 MasterDuke [dan@alexandria p6]$ p6 -e 'my $a = class :: { has uint64 $.foo is rw }.new( foo => -1 ); say $a.foo' native unsigned integers can't be negative   in block <unit> at -e line 1
22:45 timotimo oh yeah!!
23:14 matiaslina joined #moarvm
23:55 matiasli1a joined #moarvm

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