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