github.com/moarvm/moarvm | IRC logs at colabti.org/irclogger/irclogger_logs/moarvm
Set by AlexDaniel on 12 June 2018.
00:00 lizmat joined, p6bannerbot sets mode: +v lizmat 00:18 lizmat left 00:56 MasterDuke joined, p6bannerbot sets mode: +v MasterDuke, MasterDuke left, MasterDuke joined, herbert.freenode.net sets mode: +v MasterDuke, p6bannerbot sets mode: +v MasterDuke
MasterDuke samcv: you might find this darkcephas.blogspot.com/2018/10/val...ookup.html (and the other blog post referenced) interesting 00:57
01:04 fake_space_whale joined 01:05 p6bannerbot sets mode: +v fake_space_whale 01:07 Kaiepi left, Kaiepi joined 01:08 p6bannerbot sets mode: +v Kaiepi
ugexe would it be possible to allow int32 to be atomic on 64bit machine? and if so is it possible to use cas() on a non-atomic int32 that will only ever be 0 or 1, such that in rakudo core we could use cas($int, -> $_ { $_ + 1 }) even on the jvm backend? 02:59
03:33 MasterDuke left 04:13 Redfoxmoon left 04:19 Redfoxmoon joined, p6bannerbot sets mode: +v Redfoxmoon 04:24 Redfoxmoon left, Redfoxmoon joined, tolkien.freenode.net sets mode: +v Redfoxmoon, p6bannerbot sets mode: +v Redfoxmoon 05:47 leedo left 05:50 TimToady_ joined, [Coke]_ joined, [Coke]_ left, [Coke]_ joined 05:51 p6bannerbot sets mode: +v [Coke]_, p6bannerbot sets mode: +v TimToady_, p6bannerbot sets mode: +v [Coke]_ 05:55 samcv_ joined, p6bannerbot sets mode: +v samcv_, Redfoxmoon left, emerson left, nwc10 left, TimToady left, camelia left, samcv left, [Coke] left 05:56 Redfoxmoon joined 05:57 p6bannerbot sets mode: +v Redfoxmoon 05:58 nwc10 joined 05:59 p6bannerbot sets mode: +v nwc10 06:06 camelia joined, samcv_ is now known as samcv, p6bannerbot sets mode: +v camelia 06:14 Redfoxmoon left, Redfoxmoon joined, asimov.freenode.net sets mode: +v Redfoxmoon, p6bannerbot sets mode: +v Redfoxmoon 06:28 fake_space_whale left 06:30 TimToady_ is now known as TimToady, TimToady left, TimToady joined, livingstone.freenode.net sets mode: +v TimToady, p6bannerbot sets mode: +v TimToady 06:43 domidumont joined 06:44 p6bannerbot sets mode: +v domidumont 06:47 domidumont left 06:53 robertle joined, p6bannerbot sets mode: +v robertle 07:02 domidumont joined 07:03 p6bannerbot sets mode: +v domidumont 07:35 rba joined, p6bannerbot sets mode: +v rba 08:09 lizmat joined, p6bannerbot sets mode: +v lizmat 08:32 rba_ joined 08:33 p6bannerbot sets mode: +v rba_ 08:34 zakharyas joined 08:35 rba left, p6bannerbot sets mode: +v zakharyas, robertle left 08:37 robertle joined 08:38 p6bannerbot sets mode: +v robertle
jnthn ugexe: We're exposing what the hardware can offer, so I think the answer would be "that's platform-specific behavior"; the purpose of atomicint is not that it's somehow special as a type, but rather than it's the size that will work on the current hardware. 08:41
iirc, at the moment the only thing we enforce is that the integer typed used with the operation matches the sizeof(AO_t) from the atomic ops libs
08:54 robertle left 08:56 robertle joined 08:57 p6bannerbot sets mode: +v robertle
dogbert2_ .seen brrt 10:03
yoleaux I saw brrt 23 Oct 2018 21:36Z in #moarvm: * brrt is going afk as well
10:31 Sigyn left 10:36 AlexDaniel left 11:09 zakharyas left 11:28 rba_ left 11:36 ItchyPlant joined, p6bannerbot sets mode: +v ItchyPlant 11:37 AlexDaniel joined, p6bannerbot sets mode: +v AlexDaniel
ItchyPlant Hi, I still haven't given up compiling Rakudo/NQP/MoarVM on AIX 7.1... :) 11:41
lizmat ItchyPlant++ 11:42
which I could be of more help
*wish
ItchyPlant MoarVM -> looks compiled but it finishes with "ld: 0711-224 WARNING: Duplicate symbol: .__init_aix_libgcc_cxa_atexit", then make install puts everything in place (I'm using --prefix /opt/rakudo). 11:43
NQP -> "make" compiles without error, "make test" shows one error: 11:44
t/nqp/113-run-command.t (Wstat: 6 Tests: 0 Failed: 0)
Non-zero exit status: -1
Parse errors: Bad plan. You planned 8 tests but ran 0.
Rakudo -> "make" crashes at this stage: 11:45
...
The following step can take a long time, please be patient.
Stage start : 0.000
Stage parse : make: *** [Makefile:511: CORE.setting.moarvm] Segmentation fault (core dumped)
(or sometimes, when trying again, it throws "MoarVM panic: Memory allocation failed..." error at the same stage) 11:46
that's my summary so far :) 11:47
User "cygx" from reddit wrote that this "could just mean that your machine doesn't have enough memory/swap to compile Rakudo (the core 'setting' - basically the standard lib - gets compiled in one go, and that needs quite a lot of ressources). Segfaults should not happen, though." 11:48
but even 1.0 pCPU / 2.0 vCPU and 12 GB of RAM wasn't enough, so I don't think it is a resource problem 11:49
dogbert2_ well given that it is possible to build rakudo on an RPi (2) I seems as if something goes very wrong 11:52
ItchyPlant I can also share what I did to get MoarVM compiled if that helps. 11:54
dogbert2_ sure
ItchyPlant 1.) Installed gcc, make, libffi, libffi-devel RPM packages, unlinked IBM's make and linked GNU make as /usr/bin/make 11:59
2.) vi src/io/syncfile.c -> replaced all the 4 occurences of "STAT" words to something else (to "RETEK" in my case)
3.) vi src/strings/siphash/csiphash.h -> commented out the block about endian.h
(if not doing it, I get a "fatal error"):
# include <sys/endian.h>
# else
# include <endian.h>
# endif */
4.) vi build/Makefile.in -> added the line that you suggested:
UV_AIX = 3rdparty/libuv/src/unix/aix@obj@ \
3rdparty/libuv/src/unix/aix-common@obj@ \
$(UV_UNIX)
5.) perl Configure.pl --has-libffi --prefix /opt/rakudo
6.) Added "-bnoquiet" to LDFLAGS in Makefile to get more details:
LDFLAGS = -Wl,-bnoquiet,-brtl -O3 -DNDEBUG -g3 -L"//opt/rakudo/lib"
7.) make
8.) make install
(the "that you suggested" was because I wrote the same to the user on Reddit) 12:00
dogbert2_ what was the thing with the STAT replacements? 12:04
12:11 ItchyPlant left 12:15 emerson joined, p6bannerbot sets mode: +v emerson, ItchyPlant joined, p6bannerbot sets mode: +v ItchyPlant
ItchyPlant Hi again, so... 12:16
nine ItchyPlan: Q: Why do I get warnings about duplicated symbol like __init_aix_libgcc_cxa_atexit?
A: You have two or more shared objects that were created without export-list (with option -bautoexp or similiar).
web.axelero.hu/lzsiga/aix-linking.html
ItchyPlant the STAT thing was needed because of these errors: 12:17
... src/io/syncfile.c:8:21: error: expected identifier or '(' before numeric constant typedef struct stat STAT; ^ src/io/syncfile.c: In function 'mvm_eof': src/io/syncfile.c:167:14: error: expected ';' before 'statbuf' STAT statbuf; ^~~~~~~ src/io/syncfile.c:168:30: error: 'statbuf' undeclared (first use in this function) if (fstat(data->fd, &statbuf) == -1)
(And replacing STAT by something else was also recommended by a user at Reddit. It then passed that part, proceeded with compilation.) 12:18
Ok, so how can I solve this AIX linking issue? 12:19
nine I guess the -bautoexp linker option is needed on at least some files. 12:20
web.axelero.hu/lzsiga/aix-linking.html#Q0017 has slightly more on that topic 12:22
Some more explanation: lists.mysql.com/bugs/12347 12:23
12:39 zakharyas joined 12:40 p6bannerbot sets mode: +v zakharyas
ItchyPlant Sorry, I'm not familiar in specifically setting custom linker options (either) for some files... where to do that in which file(s) before "make" command? 12:44
I gues it was'n enough for the main Makefile in MoarVM-2018.09 dir:
LDFLAGS = -Wl,-bnoquiet,-bautoexp,-brtl -O3 -DNDEBUG -L"//opt/rakudo/lib"
nine ItchyPlant: note that the Makefile is generated by Configure.pl from build/Makefile.in 12:51
13:01 leedo joined, avar left 13:02 avar joined, avar left, avar joined, p6bannerbot sets mode: +v avar, p6bannerbot sets mode: +v leedo, p6bannerbot sets mode: +v avar 13:11 cygx joined 13:13 cygx left, cygx joined 13:14 p6bannerbot sets mode: +v cygx
cygx renaming STAT in syncfile.c was necessary because AIX seems to define a macro of that name (at least that's my guess) 13:15
ItchyPlant: you can also try deleting libmoar, remake it using `make NOISY=1` to see the actual commands and then play around with that without having to mess with the Makefile... 13:16
ItchyPlant so simply configure with "perl Configure.pl --has-libffi --prefix /opt/rakudo" -> make -> rm libmoar.so -> make NOISY=1 ? 13:19
(all the previously applied changes remain of course, e.g. STAT and so on...) 13:20
cygx or just `make NOISY=1` in the first step if you rebuild anyway
just deleting libmoar.so won't trigger a full rebuild and makes the linking command easier to find 13:21
ItchyPlant I did it like I wrote... it showed a nice long list
gcc -o libmoar.so -Wl,-brtl -O3 -DNDEBUG -L"//opt/rakudo/lib" -shared -fPIC src/core/callsite.o src/core/args.o src/core/exceptions.o src/core/interp.o src/core/threadcontext.o src/core/compunit.o src/core/bytecode.o src/core/frame.o src/core/callstack.o src/core/validation.o src/core/bytecodedump.o src/core/threads.o src/core/ops.o src/core/hll.o src/core/loadbytecode.o src/math/num.o src/math/grisu.o src/core/coerce.o src/core/
(OK, it cannot be copied here :)) 13:22
it ends with:
src/platform/sys.o src/platform/random.o src/platform/memmem32.o src/moar.o src/platform/posix/mmap.o src/platform/posix/time.o src/platform/posix/io.o src/jit/stub.o 3rdparty/cmp/ 13:23
libcmp.a 3rdparty/libatomicops/src/libatomic_ops.a 3rdparty/tinymt/libtinymt.a 3rdparty/sha1/libsha1.a 3rdparty/libtommath/libtommath.a 3rdparty/libuv/libuv.a -lffi -L/opt/freeware/
lib64 -lffi -lm -lpthread -lrt -ldl -lperfstat
gcc -o moar -Wl,-brtl -O3 -DNDEBUG -L"//opt/rakudo/lib" src/main.o -L. -lmoar -L/opt/freeware/lib64 -lffi
ld: 0711-224 WARNING: Duplicate symbol: .__init_aix_libgcc_cxa_atexit
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
nine ItchyPlant: in the gcc -o libmoar.so commant I see no -bautoexp
cygx you can use a pastebin (eg gist.github.com/ ) to avoid spamming the channel 13:24
btw, when I googled the error message earlier, one of the proposed solutions was removing -brtl and rename libfoo.so to libfoo.a 13:28
that seems to be an... interesting way to go about things :) 13:29
ItchyPlant removing "-brtl" means the whole parameterlist of it, right, so this: "-brtl -O3 -DNDEBUG -L"//opt/rakudo/lib"" 13:30
cygx no, just the -Wl,-brtl 13:32
ItchyPlant Ok
and if I get it right, it is needed for libmoar.so only, right? 13:51
gcc -o libmoar.so -O3 -DNDEBUG -L"//opt/rakudo/lib" -shared -fPIC src/core/callsite.o src/core/args.o... 13:58
gcc -o moar -Wl,-brtl -O3 -DNDEBUG -L"//opt/rakudo/lib" src/main.o -L. -lmoar -L/opt/freeware/lib64 -lffi
ld: 0711-224 WARNING: Duplicate symbol: .__init_aix_libgcc_cxa_atexit ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. 13:59
like this?
"-bautoexp" is not recognized by gcc anyway 14:00
"gcc: error: unrecognized command line option '-bautoexp'"
cygx you probably need to pass it as `-Wl,-bautoexp` 14:03
ItchyPlant ahh, Ok :) 14:05
If I compile this way (and still get the warning about duplicate symbol), I get libmoar.so. So this libmoar.so should be renamed to libmoar.a, then do "make NOISY=1" again? It again creates a libmoar.so. 14:19
Should I rename the new libmoar.so to libmoar.a and do "make install"?
It again renames it to .so and copies to final place as is of course. 14:22
nine Err...I think the renaming thing was an entirely different approach. 14:24
If you still get the warning, you may have to add the -bautoexp to other compilations as well
ItchyPlant I don't know. At least NQP doesn't complain about anything, it just compiles. 14:26
"make test" after that shows two errors though
t/nqp/111-spawnprocasync.t ............. Dubious, test returned -1 (wstat 6, 0x6) Failed 4/4 subtests 14:27
t/nqp/113-run-command.t ................ Dubious, test returned -1 (wstat 6, 0x6) Failed 2/8 subtests
(sometimes it shows the 113 one "only")
oh and I also got a "/tmp/nqp-2018.09/core", 24.4 MB sized core file 14:29
14:44 lizmat left
ItchyPlant and when compiling Rakudo, I don't get why it writes this: 14:47
Stage parse : MoarVM panic: Memory allocation failed; could not allocate 8192 bytes
Makefile:509: recipe for target 'CORE.setting.moarvm' failed
just checked and the smallest amount of free mem, when it ended was 1245 MB which is still quite enough I guess 14:48
cygx but was the memory available for allocation? there are ways to restict that (eg ulimit) 14:54
timotimo 1.2 gigs isn't enough to compile the core setting, i don't think 14:55
ItchyPlant yes, all ulimit values were unlimited, I made sure about that 14:58
sometimes it drops "make: *** [CORE.setting.moarvm] Illegal instruction (core dumped)"
OK, adding more memory for it...
timotimo i wonder if illegal instruction is also shown when alignment isn't proper
14:59 fake_space_whale joined 15:00 p6bannerbot sets mode: +v fake_space_whale
cygx Google tells me there's also some LDR_CNTRL/MAXDATA thingy (though that might not apply on 64-bit system?) 15:01
jnthn Might also try MVM_SPESH_DISABLE=1 in the environment when building Rakudo just in case it's something JIT-y or optimization-related 15:03
15:05 domidumont left
ItchyPlant I set both variables with export but got the same. 15:10
make: *** [CORE.setting.moarvm] Segmentation fault (core dumped) 15:12
...with a 257 MB sized core file 15:13
can I diagnose this core file somehow, e.g. with moar? 15:17
or it is totally unnecessary?
timotimo yeah, you would use gdb for that. at least at 257 megs it's unlikely that it was your ram running out 15:18
i hardly ever use core files to debug moar, though
ItchyPlant yes, I constantly checked the free memory and the smallest amount was 9382 MB when the compilation terminated
Reading symbols from /opt/rakudo/bin/moar...done. [New Thread 1] Core was generated by `moar'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0xd011117c in extend_brk () from /usr/lib/libc.a(shr.o) 15:26
this is what "gdb /opt/rakudo/bin/moar /tmp/rakudo-2018.09/core" shows
15:35 zakharyas left
ItchyPlant AIX' errpt doesn't say much either but at lease I keep getting errpt entries from all my attempts 15:35
SYMPTOM CODE PCSS/SPI2 FLDS/moar SIG/11 FLDS/extend_br VALU/2dc FLDS/millicode
jnthn ItchyPlant: Can you try `bt` inside of gdb? 15:36
ItchyPlant sure
it shows the same:
(gdb) bt #0 0xd011117c in extend_brk () from /usr/lib/libc.a(shr.o) 15:37
jnthn that's it? No more frames? Hmm.
ItchyPlant yes, no more
(gdb) up Initial frame selected; you cannot go up. (gdb) down Bottom (innermost) frame selected; you cannot go down.
jnthn What does `info threads` show? 15:38
ItchyPlant (gdb) info threads
Id Target Id Frame
2 Thread 1 (tid 15925633, running) aix-thread: ptrace (52, 15925633) returned -1 (errno = 3 No such process)
jnthn OK, just the one 15:39
You could maybe try running the command that crashes under gdb directly; also do a debug build of moar if you didn't already so there's more symbols to hand
cygx debug build == passing --debug to Configure.pl 15:40
ItchyPlant Ok, rebuilding moarvm with debug then also rebuilding nqp... 15:43
jnthn You shouldn't need an NQP rebuild, just a Rakudo one 15:44
15:54 cygx left 15:55 robertle left
ItchyPlant it doesn't always throws segfault with core dump... this time it was a "MoarVM panic: Memory allocation failed; could not allocate 24576 bytes" 16:01
trying "make" again...
ok, now it did :)
"bt" doesn't say anything more 16:03
#0 0xd011117c in extend_brk () from /usr/lib/libc.a(shr.o)
16:03 fake_space_whale left
ItchyPlant how can I try running the command that crashes under gdb directly? 16:03
however... I'm leaving home now, I will check it later 16:04
thanks a lot for your help guys so far and have a nice weekend :) 16:05
bye
16:06 ItchyPlant left
ugexe jnthn: a more simple version of what I was asking would be: why cant a 64bit machine use an int32 for cas since I would think the smaller size would mean an atomic swap is still doable 16:12
m: my int32 $a; cas($a, 0, 1)
camelia Cannot atomic load from an integer lexical not of the machine's native size
in block <unit> at <tmp> line 1
jnthn I suspect you can on x64; I'm not sure that's a portable assumption 16:13
16:14 cygx joined, cygx left
jnthn bugs.debian.org/cgi-bin/bugreport....bug=471886 16:16
ugexe ah nice, i was only finding things about the other way around 16:17
16:30 domidumont joined 16:31 p6bannerbot sets mode: +v domidumont 16:37 patrickb joined, p6bannerbot sets mode: +v patrickb 16:43 robertle joined 16:44 p6bannerbot sets mode: +v robertle 16:54 AlexDaniel left, domidumont left
AlexDaniel` samcv: hi! How is it going? 17:17
samcv hi, woke up 17:18
18:34 AlexDaniel joined, p6bannerbot sets mode: +v AlexDaniel 19:16 lizmat joined, p6bannerbot sets mode: +v lizmat 21:19 MasterDuke joined, p6bannerbot sets mode: +v MasterDuke, MasterDuke left, MasterDuke joined, herbert.freenode.net sets mode: +v MasterDuke, p6bannerbot sets mode: +v MasterDuke 22:00 patrickb left 22:06 ggoebel left
Geth MoarVM: 32a47383ba | (Samantha McVey)++ | src/jit/graph.c
[JIT] Fix a bug with sleep op receiving bogus values

This bug resulted in sleep getting bogus values, since sleep() needs a float. This could cause high cpu usage when Perl 6 was doing nothing. When the JIT kicked in, ThreadPoolSchedular in Rakudo would start sleeping for 0.0 seconds instead of 0.01 seconds resulting in cpu usage while doing nothing.
23:23
timotimo i think it should be possible to write a little tool that looks for the functions that correspond to ops in graph.c and check that the functions that take doubles have a _F in there somewhere 23:25
samcv that would be nice
timotimo even though graph.c is "on the way out" :P 23:26