Welcome to the main channel on the development of MoarVM, a virtual machine for NQP and Rakudo (moarvm.org). This channel is being logged for historical purposes.
Set by lizmat on 24 May 2021.
Nicholas good *, #moarvm 08:44
today is clearly a good day to call MVM_repr_box_int, MVM_repr_box_num, MVM_repr_box_str, MVM_repr_box_uint 08:45
nine I thought this was the day for nqp::unbox_i, nqp::unbox_n, nqp::unbox_s and nqp::unbox_u 09:04
Nicholas wouldn't *that* be *Un*boxing day? 09:05
nine Well the name has always confused me because of that :) 09:08
nine MasterDuke: there's no additiional bug wrt Curlie. The segfault and valgrind issues you see are bugs in LibCurl::EasyHandle. They are also restrictions in the NativeCall API wrt memory management. 09:49
What happens is that libcurl expects to be passed a char** which it fills with a char*. LibCurl::EasyHandle therefor allocates a CArray[Str] with 1 element and passes that to libcurl. However, libcurl does not pass ownership of the string to the caller while CArray assumes that if the array is managed, the array elements must be managed as well. 09:50
So CArray frees a string that it doesn't actually own. That's a case that my NativeCall memory management rework is supposed to cover. 09:52
MasterDuke is there something LibCurl::Easy could do differently? or do they just require NYI functionality? 10:03
nine: btw, you've seen dev.azure.com/MoarVM/MoarVM/_build...bf4bfaf11c ? 10:04
i can confirm that branch does fix the other spesh issue with Curlie for me 10:05
Geth MoarVM/fix_rw_native_calls: d783bf2717 | (Stefan Seifert)++ | src/spesh/disp.c
Fix speshed native calls with rw args assigning into wrong target

For rw args of native calls we emit appropriate assign_i instructions after the call to write back the native values from the argument registers to the NativeRef. However the register holding the NativeRef will already have been released at the callsite (as for non-speshed calls writing back is handled by MVM_nativecall_dispatch). If one of the ... (9 more lines)
10:56
nine MasterDuke: thanks for the heads up! Seems like I always fall into this particular trap
MasterDuke: maybe LibCurl::Easy can pass a Str as rw arg instead of the CArray. Don't know off the top of my head if there's a way to avoid MoarVM freeing that string though. I really need to continue work on my branch. Planning to do so right after the uint fixes are done. 10:57
timo .o( i should have done a little survey of existing file formats before making the moarvm heap snapshot format ... like RIFF for example ) 14:01
yup! let's store moarvm heap dumps in .avi files
sena_kun timo, tooling >>>>>> formats 14:31
timo being able to use avidemux2 to wrangle heap snapshots sounds absolutely delightful 14:33
lizmat logs.liz.nl now running on 2021.12 15:07