Raku / App-Rakubrew

Raku environment manager
https://rakubrew.org/
Other
26 stars 13 forks source link

OpenBSD - MoarVM panic: Memory allocation failed #56

Closed Veraellyunjie closed 2 years ago

Veraellyunjie commented 2 years ago

OpenBSD 7.1 amd64 Tried 3 times with rakubrew build moar master, rakubrew build moar-blead and rakubrew build:

MoarVM panic: Memory allocation failed; could not allocate 36864 bytes MoarVM panic: Memory allocation failed; could not allocate 660952 bytes MoarVM panic: Memory allocation failed; could not allocate 660152 bytes

I don't know how to troubleshoot it. I understand it is barely rakubrew issue, but rather OpenBSD compatibility or something, but I don't know where to start.

Raku is packaged (in 3 parts) for OpenBSD, and it does work, so MoarVM is buildable: https://openports.se/lang/rakudo https://openports.se/lang/nqp https://openports.se/lang/moarvm

rakubrew build
Update git reference: rakudo
Update git reference: nqp
Update git reference: MoarVM
Updating submodules .................................... OK
===ATTENTION===
  No --prefix supplied, building and installing to /opt/raku/rakubrew/versions/moar-2022.06/install
Cloning from https://github.com/Raku/nqp.git
Building NQP ...
perl Configure.pl --prefix=/opt/raku/rakubrew/versions/moar-2022.06/install --make-install --git-protocol=https --no-relocatable --no-ignore-errors --silent-build --no-force-rebuild --git-cache-dir=/opt/raku/rakubrew/git_reference --backends=moar --gen-moar
Updating submodules .................................... OK
Cloning from https://github.com/MoarVM/MoarVM.git

Configuring and building MoarVM ...
perl Configure.pl --optimize --git-cache-dir=/opt/raku/rakubrew/git_reference --prefix=/opt/raku/rakubrew/versions/moar-2022.06/install --make-install
Welcome to MoarVM!

Updating submodules .................................... OK
Configuring native build environment ................... 
    trying to compile a simple C program ............... YES
    Testing pkgconfig .................................. 0.29.2
    probing stdatomic .................................. YES
Adding extra include for libzstd: -I/usr/local/include
Adding extra libs for libzstd: -L/usr/local/lib
OK

    probing whether your compiler thinks that it is gcc  YES
    probing how your compiler does static inline ....... static __inline__
    probing if your compiler offers thread local storage  _Thread_local
    probing if your pow() handles NaN and Inf corner cases  YES
    probing if your log() returns NaN for negative values  YES
    probing if your log10() returns NaN for negative values  YES
    probing if your asin() returns NaN for negative values  YES
    probing if your acos() returns NaN for negative values  YES
    probing if you have isnan .......................... YES
    probing if you have isinf .......................... YES
    probing if you have signbit ........................ YES
    your CPU can read unaligned values for all of int32 int64 num64
    probing the size of pointers ....................... 8
Defaulting to mimalloc because you have <stdatomic.h>
    probing C type support for booleans ................ _Bool
    probing computed goto support ...................... YES
    probing pthread_yield support ...................... NO
    probing pthread_setname_np support (optional) ...... NO
    probing existance of optional malloc_trim() ........ NO
    probing support of rdtscp intrinsic ................ YES

        make: make
     compile: clang -fno-omit-frame-pointer -fno-optimize-sibling-calls -Werror=vla -fno-ret-protector -O3 -DNDEBUG -Wno-logical-op-parentheses -D_REENTRANT -D_FILE_OFFSET_BITS=64 -fPIC  -DMVM_HEAPSNAPSHOT_FORMAT=3 -D_GNU_SOURCE -DMI_SKIP_COLLECT_ON_EXIT
    includes:  -I/usr/local/include  -I3rdparty/libuv/include -I3rdparty/libuv/src -I3rdparty/libtommath -I3rdparty/dyncall/dynload -I3rdparty/dyncall/dyncall -I3rdparty/dyncall/dyncallback -I3rdparty/mimalloc/include -I3rdparty/mimalloc/src
        link: clang  -O3 -DNDEBUG -Wl,-rpath,"/@libdir@"
        libs:  -L/usr/local/lib -lm -lpthread -lkvm -lzstd 

  byte order: little endian

Configuring 3rdparty libs .............................. OK

  3rdparty: 3rdparty/cmp/libcmp.a
            3rdparty/dyncall/dyncall/libdyncall_s.a
            3rdparty/dyncall/dyncallback/libdyncallback_s.a
            3rdparty/dyncall/dynload/libdynload_s.a
            3rdparty/libtommath/libtommath.a
            3rdparty/libuv/libuv.a
            3rdparty/sha1/libsha1.a
            3rdparty/tinymt/libtinymt.a

Generating src/gen/config.c ............................ OK
Generating src/gen/config.h ............................ OK
Generating Makefile .................................... OK
Generating tools/check.mk .............................. OK
Generating build/mk-moar-pc.pl ......................... OK

Configuration SUCCESS.

Type 'make' to build and 'make help' to see a list of
available make targets.
compiling src/main.o
compiling src/core/callsite.o
compiling src/core/args.o
compiling src/core/exceptions.o
compiling src/core/interp.o
compiling src/core/str_hash_table.o
compiling src/core/fixkey_hash_table.o
compiling src/core/index_hash_table.o
compiling src/core/ptr_hash_table.o
compiling src/core/uni_hash_table.o
compiling src/core/threadcontext.o
compiling src/core/compunit.o
compiling src/core/bytecode.o
compiling src/core/frame.o
compiling src/core/callstack.o
compiling src/core/validation.o
compiling src/core/bytecodedump.o
compiling src/core/threads.o
compiling src/core/ops.o
compiling src/core/hll.o
compiling src/core/loadbytecode.o
compiling src/core/coerce.o
compiling src/core/dll.o
compiling src/core/ext.o
compiling src/core/nativecall.o
compiling src/core/nativecall_dyncall.o
compiling src/core/continuation.o
compiling src/core/intcache.o
compiling src/core/fixedsizealloc.o
compiling src/core/regionalloc.o
compiling src/debug/debugserver.o
compiling src/gen/config.o
compiling src/gc/orchestrate.o
compiling src/gc/allocation.o
compiling src/gc/worklist.o
compiling src/gc/roots.o
compiling src/gc/collect.o
compiling src/gc/gen2.o
compiling src/gc/wb.o
compiling src/gc/objectid.o
compiling src/gc/finalize.o
compiling src/gc/debug.o
compiling src/io/io.o
compiling src/io/eventloop.o
compiling src/io/syncfile.o
compiling src/io/syncsocket.o
compiling src/io/fileops.o
compiling src/io/dirops.o
compiling src/io/procops.o
compiling src/io/timers.o
compiling src/io/filewatchers.o
compiling src/io/signals.o
compiling src/io/asyncsocket.o
compiling src/io/asyncsocketudp.o
compiling src/6model/reprs.o
compiling src/6model/reprconv.o
compiling src/6model/containers.o
compiling src/6model/parametric.o
compiling src/6model/reprs/MVMString.o
compiling src/6model/reprs/VMArray.o
compiling src/6model/reprs/MVMHash.o
compiling src/6model/reprs/MVMCFunction.o
compiling src/6model/reprs/KnowHOWREPR.o
compiling src/6model/reprs/KnowHOWAttributeREPR.o
compiling src/6model/reprs/P6str.o
compiling src/6model/reprs/P6opaque.o
compiling src/6model/reprs/MVMCode.o
compiling src/6model/reprs/MVMOSHandle.o
compiling src/6model/reprs/MVMCompUnit.o
compiling src/6model/reprs/MVMStaticFrame.o
compiling src/6model/reprs/P6int.o
compiling src/6model/reprs/P6num.o
compiling src/6model/reprs/Uninstantiable.o
compiling src/6model/reprs/HashAttrStore.o
compiling src/6model/reprs/MVMThread.o
compiling src/6model/reprs/MVMIter.o
compiling src/6model/reprs/MVMContext.o
compiling src/6model/reprs/SCRef.o
compiling src/6model/reprs/P6bigint.o
compiling src/6model/reprs/NFA.o
compiling src/6model/reprs/MVMException.o
compiling src/6model/reprs/MVMDLLSym.o
compiling src/6model/reprs/MVMContinuation.o
compiling src/6model/reprs/NativeCall.o
compiling src/6model/reprs/CPointer.o
compiling src/6model/reprs/CStr.o
compiling src/6model/reprs/CArray.o
compiling src/6model/reprs/CStruct.o
compiling src/6model/reprs/CUnion.o
compiling src/6model/reprs/ReentrantMutex.o
compiling src/6model/reprs/ConditionVariable.o
compiling src/6model/reprs/Semaphore.o
compiling src/6model/reprs/ConcBlockingQueue.o
compiling src/6model/reprs/MVMAsyncTask.o
compiling src/6model/reprs/MVMNull.o
compiling src/6model/reprs/CPPStruct.o
compiling src/6model/reprs/NativeRef.o
compiling src/6model/reprs/MultiDimArray.o
compiling src/6model/reprs/Decoder.o
compiling src/6model/reprs/MVMSpeshLog.o
compiling src/6model/reprs/MVMStaticFrameSpesh.o
compiling src/6model/reprs/MVMCapture.o
compiling src/6model/reprs/MVMTracked.o
compiling src/6model/6model.o
compiling src/6model/bootstrap.o
compiling src/6model/sc.o
compiling src/6model/serialization.o
compiling src/disp/boot.o
compiling src/disp/registry.o
compiling src/disp/inline_cache.o
compiling src/disp/program.o
compiling src/disp/syscall.o
compiling src/disp/resume.o
compiling src/spesh/dump.o
compiling src/spesh/graph.o
compiling src/spesh/codegen.o
compiling src/spesh/manipulate.o
compiling src/spesh/args.o
compiling src/spesh/usages.o
compiling src/spesh/facts.o
compiling src/spesh/optimize.o
compiling src/spesh/dead_bb_elimination.o
compiling src/spesh/dead_ins_elimination.o
compiling src/spesh/deopt.o
compiling src/spesh/log.o
compiling src/spesh/threshold.o
compiling src/spesh/inline.o
compiling src/spesh/osr.o
compiling src/spesh/lookup.o
compiling src/spesh/iterator.o
compiling src/spesh/worker.o
compiling src/spesh/debug.o
compiling src/spesh/stats.o
compiling src/spesh/plan.o
compiling src/spesh/arg_guard.o
compiling src/spesh/frame_walker.o
compiling src/spesh/pea.o
compiling src/6model/reprs/MVMSpeshCandidate.o
compiling src/spesh/disp.o
compiling src/strings/decode_stream.o
compiling src/strings/ascii.o
compiling src/strings/parse_num.o
compiling src/strings/utf8.o
compiling src/strings/utf8_c8.o
compiling src/strings/nfg.o
compiling src/strings/ops.o
compiling src/strings/unicode.o
compiling src/strings/normalize.o
compiling src/strings/latin1.o
compiling src/strings/utf16.o
compiling src/strings/windows1252.o
compiling src/strings/shiftjis.o
compiling src/strings/gb2312.o
compiling src/strings/gb18030.o
compiling src/math/bigintops.o
compiling src/profiler/instrument.o
compiling src/profiler/log.o
compiling src/profiler/profile.o
compiling src/profiler/heapsnapshot.o
compiling src/profiler/telemeh.o
compiling src/profiler/configuration.o
compiling src/instrument/crossthreadwrite.o
compiling src/instrument/line_coverage.o
compiling src/platform/sys.o
compiling src/platform/random.o
compiling src/platform/memmem32.o
compiling 3rdparty/freebsd/memmem.o
compiling 3rdparty/ryu/ryu/d2s.o
compiling 3rdparty/mimalloc/src/static.o
compiling src/platform/malloc_trim.o
compiling src/moar.o
compiling src/platform/posix/mmap.o
compiling src/platform/posix/time.o
compiling src/platform/posix/io.o
compiling src/platform/posix/fork.o
compiling src/jit/graph.o
compiling src/jit/label.o
compiling src/jit/compile.o
compiling src/jit/dump.o
Precompiling templates from src/jit/core_templates.expr
compiling src/jit/expr.o
Building tile tables from src/jit/x64/tile_pattern.tile
compiling src/jit/tile.o
compiling src/jit/linear_scan.o
compiling src/jit/interface.o
clang  3rdparty/dynasm/minilua.c -lm -o 3rdparty/dynasm/minilua
preprocessing src/jit/x64/emit.dasc
compiling src/jit/x64/emit.o
compiling src/jit/x64/arch.o
compiling 3rdparty/cmp/cmp.o
linking 3rdparty/cmp/libcmp.a
building dyncall...
Configuration written to Makefile.config
done.
compiling 3rdparty/tinymt/tinymt64.o
linking 3rdparty/tinymt/libtinymt.a
compiling 3rdparty/sha1/sha1.o
linking 3rdparty/sha1/libsha1.a
compiling 3rdparty/libtommath/bn_cutoffs.o
compiling 3rdparty/libtommath/bn_deprecated.o
compiling 3rdparty/libtommath/bn_mp_2expt.o
compiling 3rdparty/libtommath/bn_mp_abs.o
compiling 3rdparty/libtommath/bn_mp_add.o
compiling 3rdparty/libtommath/bn_mp_add_d.o
compiling 3rdparty/libtommath/bn_mp_addmod.o
compiling 3rdparty/libtommath/bn_mp_and.o
compiling 3rdparty/libtommath/bn_mp_clamp.o
compiling 3rdparty/libtommath/bn_mp_clear.o
compiling 3rdparty/libtommath/bn_mp_clear_multi.o
compiling 3rdparty/libtommath/bn_mp_cmp.o
compiling 3rdparty/libtommath/bn_mp_cmp_d.o
compiling 3rdparty/libtommath/bn_mp_cmp_mag.o
compiling 3rdparty/libtommath/bn_mp_cnt_lsb.o
compiling 3rdparty/libtommath/bn_mp_complement.o
compiling 3rdparty/libtommath/bn_mp_copy.o
compiling 3rdparty/libtommath/bn_mp_count_bits.o
compiling 3rdparty/libtommath/bn_mp_decr.o
compiling 3rdparty/libtommath/bn_mp_div.o
compiling 3rdparty/libtommath/bn_mp_div_2.o
compiling 3rdparty/libtommath/bn_mp_div_2d.o
compiling 3rdparty/libtommath/bn_mp_div_3.o
compiling 3rdparty/libtommath/bn_mp_div_d.o
compiling 3rdparty/libtommath/bn_mp_dr_is_modulus.o
compiling 3rdparty/libtommath/bn_mp_dr_reduce.o
compiling 3rdparty/libtommath/bn_mp_dr_setup.o
compiling 3rdparty/libtommath/bn_mp_error_to_string.o
compiling 3rdparty/libtommath/bn_mp_exch.o
compiling 3rdparty/libtommath/bn_mp_expt_u32.o
compiling 3rdparty/libtommath/bn_mp_exptmod.o
compiling 3rdparty/libtommath/bn_mp_exteuclid.o
compiling 3rdparty/libtommath/bn_mp_fread.o
compiling 3rdparty/libtommath/bn_mp_from_sbin.o
compiling 3rdparty/libtommath/bn_mp_from_ubin.o
compiling 3rdparty/libtommath/bn_mp_fwrite.o
compiling 3rdparty/libtommath/bn_mp_gcd.o
compiling 3rdparty/libtommath/bn_mp_get_double.o
compiling 3rdparty/libtommath/bn_mp_get_i32.o
compiling 3rdparty/libtommath/bn_mp_get_i64.o
compiling 3rdparty/libtommath/bn_mp_get_l.o
compiling 3rdparty/libtommath/bn_mp_get_ll.o
compiling 3rdparty/libtommath/bn_mp_get_mag_u32.o
compiling 3rdparty/libtommath/bn_mp_get_mag_u64.o
compiling 3rdparty/libtommath/bn_mp_get_mag_ul.o
compiling 3rdparty/libtommath/bn_mp_get_mag_ull.o
compiling 3rdparty/libtommath/bn_mp_grow.o
compiling 3rdparty/libtommath/bn_mp_incr.o
compiling 3rdparty/libtommath/bn_mp_init.o
compiling 3rdparty/libtommath/bn_mp_init_copy.o
compiling 3rdparty/libtommath/bn_mp_init_i32.o
compiling 3rdparty/libtommath/bn_mp_init_i64.o
compiling 3rdparty/libtommath/bn_mp_init_l.o
compiling 3rdparty/libtommath/bn_mp_init_ll.o
compiling 3rdparty/libtommath/bn_mp_init_multi.o
compiling 3rdparty/libtommath/bn_mp_init_set.o
compiling 3rdparty/libtommath/bn_mp_init_size.o
compiling 3rdparty/libtommath/bn_mp_init_u32.o
compiling 3rdparty/libtommath/bn_mp_init_u64.o
compiling 3rdparty/libtommath/bn_mp_init_ul.o
compiling 3rdparty/libtommath/bn_mp_init_ull.o
compiling 3rdparty/libtommath/bn_mp_invmod.o
compiling 3rdparty/libtommath/bn_mp_is_square.o
compiling 3rdparty/libtommath/bn_mp_iseven.o
compiling 3rdparty/libtommath/bn_mp_isodd.o
compiling 3rdparty/libtommath/bn_mp_kronecker.o
compiling 3rdparty/libtommath/bn_mp_lcm.o
compiling 3rdparty/libtommath/bn_mp_log_u32.o
compiling 3rdparty/libtommath/bn_mp_lshd.o
compiling 3rdparty/libtommath/bn_mp_mod.o
compiling 3rdparty/libtommath/bn_mp_mod_2d.o
compiling 3rdparty/libtommath/bn_mp_mod_d.o
compiling 3rdparty/libtommath/bn_mp_montgomery_calc_normalization.o
compiling 3rdparty/libtommath/bn_mp_montgomery_reduce.o
compiling 3rdparty/libtommath/bn_mp_montgomery_setup.o
compiling 3rdparty/libtommath/bn_mp_mul.o
compiling 3rdparty/libtommath/bn_mp_mul_2.o
compiling 3rdparty/libtommath/bn_mp_mul_2d.o
compiling 3rdparty/libtommath/bn_mp_mul_d.o
compiling 3rdparty/libtommath/bn_mp_mulmod.o
compiling 3rdparty/libtommath/bn_mp_neg.o
compiling 3rdparty/libtommath/bn_mp_or.o
compiling 3rdparty/libtommath/bn_mp_pack.o
compiling 3rdparty/libtommath/bn_mp_pack_count.o
compiling 3rdparty/libtommath/bn_mp_prime_fermat.o
compiling 3rdparty/libtommath/bn_mp_prime_frobenius_underwood.o
compiling 3rdparty/libtommath/bn_mp_prime_is_prime.o
compiling 3rdparty/libtommath/bn_mp_prime_miller_rabin.o
compiling 3rdparty/libtommath/bn_mp_prime_next_prime.o
compiling 3rdparty/libtommath/bn_mp_prime_rabin_miller_trials.o
compiling 3rdparty/libtommath/bn_mp_prime_rand.o
compiling 3rdparty/libtommath/bn_mp_prime_strong_lucas_selfridge.o
compiling 3rdparty/libtommath/bn_mp_radix_size.o
compiling 3rdparty/libtommath/bn_mp_radix_smap.o
compiling 3rdparty/libtommath/bn_mp_rand.o
compiling 3rdparty/libtommath/bn_mp_read_radix.o
compiling 3rdparty/libtommath/bn_mp_reduce.o
compiling 3rdparty/libtommath/bn_mp_reduce_2k.o
compiling 3rdparty/libtommath/bn_mp_reduce_2k_l.o
compiling 3rdparty/libtommath/bn_mp_reduce_2k_setup.o
compiling 3rdparty/libtommath/bn_mp_reduce_2k_setup_l.o
compiling 3rdparty/libtommath/bn_mp_reduce_is_2k.o
compiling 3rdparty/libtommath/bn_mp_reduce_is_2k_l.o
compiling 3rdparty/libtommath/bn_mp_reduce_setup.o
compiling 3rdparty/libtommath/bn_mp_root_u32.o
compiling 3rdparty/libtommath/bn_mp_rshd.o
compiling 3rdparty/libtommath/bn_mp_sbin_size.o
compiling 3rdparty/libtommath/bn_mp_set.o
compiling 3rdparty/libtommath/bn_mp_set_double.o
compiling 3rdparty/libtommath/bn_mp_set_i32.o
compiling 3rdparty/libtommath/bn_mp_set_i64.o
compiling 3rdparty/libtommath/bn_mp_set_l.o
compiling 3rdparty/libtommath/bn_mp_set_ll.o
compiling 3rdparty/libtommath/bn_mp_set_u32.o
compiling 3rdparty/libtommath/bn_mp_set_u64.o
compiling 3rdparty/libtommath/bn_mp_set_ul.o
compiling 3rdparty/libtommath/bn_mp_set_ull.o
compiling 3rdparty/libtommath/bn_mp_shrink.o
compiling 3rdparty/libtommath/bn_mp_signed_rsh.o
compiling 3rdparty/libtommath/bn_mp_sqr.o
compiling 3rdparty/libtommath/bn_mp_sqrmod.o
compiling 3rdparty/libtommath/bn_mp_sqrt.o
compiling 3rdparty/libtommath/bn_mp_sqrtmod_prime.o
compiling 3rdparty/libtommath/bn_mp_sub.o
compiling 3rdparty/libtommath/bn_mp_sub_d.o
compiling 3rdparty/libtommath/bn_mp_submod.o
compiling 3rdparty/libtommath/bn_mp_to_radix.o
compiling 3rdparty/libtommath/bn_mp_to_sbin.o
compiling 3rdparty/libtommath/bn_mp_to_ubin.o
compiling 3rdparty/libtommath/bn_mp_ubin_size.o
compiling 3rdparty/libtommath/bn_mp_unpack.o
compiling 3rdparty/libtommath/bn_mp_xor.o
compiling 3rdparty/libtommath/bn_mp_zero.o
compiling 3rdparty/libtommath/bn_prime_tab.o
compiling 3rdparty/libtommath/bn_s_mp_add.o
compiling 3rdparty/libtommath/bn_s_mp_balance_mul.o
compiling 3rdparty/libtommath/bn_s_mp_exptmod.o
compiling 3rdparty/libtommath/bn_s_mp_exptmod_fast.o
compiling 3rdparty/libtommath/bn_s_mp_get_bit.o
compiling 3rdparty/libtommath/bn_s_mp_invmod_fast.o
compiling 3rdparty/libtommath/bn_s_mp_invmod_slow.o
compiling 3rdparty/libtommath/bn_s_mp_karatsuba_mul.o
compiling 3rdparty/libtommath/bn_s_mp_karatsuba_sqr.o
compiling 3rdparty/libtommath/bn_s_mp_montgomery_reduce_fast.o
compiling 3rdparty/libtommath/bn_s_mp_mul_digs.o
compiling 3rdparty/libtommath/bn_s_mp_mul_digs_fast.o
compiling 3rdparty/libtommath/bn_s_mp_mul_high_digs.o
compiling 3rdparty/libtommath/bn_s_mp_mul_high_digs_fast.o
compiling 3rdparty/libtommath/bn_s_mp_prime_is_divisible.o
compiling 3rdparty/libtommath/bn_s_mp_rand_jenkins.o
compiling 3rdparty/libtommath/bn_s_mp_rand_platform.o
compiling 3rdparty/libtommath/bn_s_mp_reverse.o
compiling 3rdparty/libtommath/bn_s_mp_sqr.o
compiling 3rdparty/libtommath/bn_s_mp_sqr_fast.o
compiling 3rdparty/libtommath/bn_s_mp_sub.o
compiling 3rdparty/libtommath/bn_s_mp_toom_mul.o
compiling 3rdparty/libtommath/bn_s_mp_toom_sqr.o
linking 3rdparty/libtommath/libtommath.a
compiling 3rdparty/libuv/src/unix/openbsd.o
compiling 3rdparty/libuv/src/unix/random-getentropy.o
compiling 3rdparty/libuv/src/unix/kqueue.o
compiling 3rdparty/libuv/src/unix/posix-hrtime.o
compiling 3rdparty/libuv/src/unix/bsd-proctitle.o
compiling 3rdparty/libuv/src/unix/bsd-ifaddrs.o
compiling 3rdparty/libuv/src/strscpy.o
compiling 3rdparty/libuv/src/fs-poll.o
compiling 3rdparty/libuv/src/inet.o
compiling 3rdparty/libuv/src/uv-common.o
compiling 3rdparty/libuv/src/version.o
compiling 3rdparty/libuv/src/timer.o
compiling 3rdparty/libuv/src/unix/async.o
compiling 3rdparty/libuv/src/unix/core.o
compiling 3rdparty/libuv/src/unix/dl.o
compiling 3rdparty/libuv/src/unix/fs.o
compiling 3rdparty/libuv/src/unix/getaddrinfo.o
compiling 3rdparty/libuv/src/unix/loop-watcher.o
compiling 3rdparty/libuv/src/unix/loop.o
compiling 3rdparty/libuv/src/unix/pipe.o
compiling 3rdparty/libuv/src/unix/poll.o
compiling 3rdparty/libuv/src/unix/process.o
compiling 3rdparty/libuv/src/unix/signal.o
compiling 3rdparty/libuv/src/unix/stream.o
compiling 3rdparty/libuv/src/unix/tcp.o
compiling 3rdparty/libuv/src/unix/thread.o
compiling 3rdparty/libuv/src/threadpool.o
compiling 3rdparty/libuv/src/unix/tty.o
compiling 3rdparty/libuv/src/unix/udp.o
linking 3rdparty/libuv/libuv.a
linking libmoar.so
linking moar
perl build/mk-moar-pc.pl pkgconfig/moar.pc
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/bin"
perl -MExtUtils::Command -e cp moar "/opt/raku/rakubrew/versions/moar-2022.06/install/bin"
perl -MExtUtils::Command -e chmod 755 "/opt/raku/rakubrew/versions/moar-2022.06/install/bin/moar"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/lib"
perl -MExtUtils::Command -e rm_f "/opt/raku/rakubrew/versions/moar-2022.06/install/lib/libmoar.so"
perl -MExtUtils::Command -e cp libmoar.so  "/opt/raku/rakubrew/versions/moar-2022.06/install/lib"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/share/nqp/lib/MAST"
perl -MExtUtils::Command -e cp lib/MAST/Nodes.nqp "/opt/raku/rakubrew/versions/moar-2022.06/install/share/nqp/lib/MAST"
perl -MExtUtils::Command -e cp lib/MAST/Ops.nqp "/opt/raku/rakubrew/versions/moar-2022.06/install/share/nqp/lib/MAST"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/share/pkgconfig"
perl -MExtUtils::Command -e cp pkgconfig/moar.pc "/opt/raku/rakubrew/versions/moar-2022.06/install/share/pkgconfig"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar"
perl -MExtUtils::Command -e cp src/gen/config.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/6model/reprs"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/core"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/gc"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/gen"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/io"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/math"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/platform"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/profiler"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/disp"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/spesh"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/debug"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/strings"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/strings/siphash"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/jit"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/instrument"
perl -MExtUtils::Command -e cp 3rdparty/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar"
perl -MExtUtils::Command -e cp src/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar"
perl -MExtUtils::Command -e cp src/6model/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/6model"
perl -MExtUtils::Command -e cp src/6model/reprs/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/6model/reprs"
perl -MExtUtils::Command -e cp src/core/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/core"
perl -MExtUtils::Command -e cp src/gc/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/gc"
perl -MExtUtils::Command -e cp src/gen/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/gen"
perl -MExtUtils::Command -e cp src/io/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/io"
perl -MExtUtils::Command -e cp src/math/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/math"
perl -MExtUtils::Command -e cp src/platform/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/platform"
perl -MExtUtils::Command -e cp src/profiler/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/profiler"
perl -MExtUtils::Command -e cp src/disp/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/disp"
perl -MExtUtils::Command -e cp src/spesh/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/spesh"
perl -MExtUtils::Command -e cp src/debug/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/debug"
perl -MExtUtils::Command -e cp src/strings/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/strings"
perl -MExtUtils::Command -e cp src/strings/siphash/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/strings/siphash"
perl -MExtUtils::Command -e cp src/jit/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/jit"
perl -MExtUtils::Command -e cp src/instrument/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/moar/instrument"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/libuv"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/libuv/uv"
perl -MExtUtils::Command -e cp 3rdparty/libuv/include/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/libuv"
perl -MExtUtils::Command -e cp 3rdparty/libuv/include/uv/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/libuv/uv"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/libtommath"
perl -MExtUtils::Command -e cp 3rdparty/libtommath/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/libtommath"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/dyncall"
perl -MExtUtils::Command -e cp 3rdparty/dyncall/dynload/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/dyncall"
perl -MExtUtils::Command -e cp 3rdparty/dyncall/dyncall/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/dyncall"
perl -MExtUtils::Command -e cp 3rdparty/dyncall/dyncallback/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/dyncall"
perl -MExtUtils::Command -e mkpath "/opt/raku/rakubrew/versions/moar-2022.06/install/include/mimalloc"
perl -MExtUtils::Command -e cp 3rdparty/mimalloc/include/*.h "/opt/raku/rakubrew/versions/moar-2022.06/install/include/mimalloc"
Cleaning up ...
+++ Preparing MOAR build directories
++++++ Building MOAR backend
+++ Generating  gen/moar/stage1/nqpmo.nqp
+++ Compiling   gen/moar/stage1/nqpmo.moarvm
+++ Compiling   gen/moar/stage1/ModuleLoader.moarvm
+++ Generating  gen/moar/stage1/NQPCORE.setting
+++ Compiling   gen/moar/stage1/NQPCORE.setting.moarvm
+++ Generating  gen/moar/stage1/QASTNode.nqp
+++ Compiling   gen/moar/stage1/QASTNode.moarvm
+++ Generating  gen/moar/stage1/QRegex.nqp
+++ Compiling   gen/moar/stage1/QRegex.moarvm
+++ Generating  stage 1 nqp-config.nqp
+++ Generating  gen/moar/stage1/NQPHLL.nqp
+++ Generating  gen/moar/stage1/MASTNodes.nqp
+++ Compiling   gen/moar/stage1/MASTOps.moarvm
+++ Compiling   gen/moar/stage1/MASTNodes.moarvm
+++ Compiling   gen/moar/stage1/NQPHLL.moarvm
+++ Generating  gen/moar/stage1/QAST.nqp
+++ Compiling   gen/moar/stage1/QAST.moarvm
+++ Generating  gen/moar/stage1/NQPP6QRegex.nqp
+++ Compiling   gen/moar/stage1/NQPP6QRegex.moarvm
+++ Creating    stage 1 NQP
+++ Generating  gen/moar/stage2/nqpmo.nqp
+++ Compiling   gen/moar/stage2/nqpmo.moarvm
+++ Compiling   gen/moar/stage2/ModuleLoader.moarvm
+++ Generating  gen/moar/stage2/NQPCORE.setting
+++ Compiling   gen/moar/stage2/NQPCORE.setting.moarvm
+++ Generating  gen/moar/stage2/QASTNode.nqp
+++ Compiling   gen/moar/stage2/QASTNode.moarvm
+++ Generating  gen/moar/stage2/QRegex.nqp
+++ Compiling   gen/moar/stage2/QRegex.moarvm
+++ Generating  stage 2 nqp-config.nqp
+++ Generating  gen/moar/stage2/NQPHLL.nqp
+++ Generating  gen/moar/stage2/MASTNodes.nqp
+++ Compiling   gen/moar/stage2/MASTOps.moarvm
+++ Compiling   gen/moar/stage2/MASTNodes.moarvm
+++ Compiling   gen/moar/stage2/NQPHLL.moarvm
+++ Generating  gen/moar/stage2/QAST.nqp
+++ Compiling   gen/moar/stage2/QAST.moarvm
+++ Generating  gen/moar/stage2/NQPP6QRegex.nqp
+++ Compiling   gen/moar/stage2/NQPP6QRegex.moarvm
+++ Creating    stage 2 NQP
+++ Installing MOAR stage 2 files locally
+++ Setting up  nqp-m
+++ Compiling   NQPP5QRegex.moarvm
+++ Compiling   inst-nqp-m
+++ Compiling   inst-nqp
+++ Compiling MOAR default runner
+++ Preparing MOAR build directories
++++++ Building MOAR backend
+++ Installing MOAR stage 2 files locally
+++ Compiling   NQPP5QRegex.moarvm
+++ Creating MOAR installation directories
+++ Installing into /opt/raku/rakubrew/versions/moar-2022.06/install
+++ Installing MOAR specifics
+++ Compiling MOAR default runner
+++ Installing default runner

NQP has been built and installed.
Using /opt/raku/rakubrew/versions/moar-2022.06/install/bin/nqp-m (version 2022.06 / MoarVM 2022.06).
Cleaning up ...
+++ Checking for moar NQP version
+++ Expanding   gen/moar/main-version.nqp
+++ Generating  gen/moar/rakudo.nqp
+++ Generating  gen/moar/Grammar.nqp
+++ Generating  gen/moar/World.nqp
+++ Generating  gen/moar/ModuleLoader.nqp
+++ Compiling   blib/Perl6/ModuleLoader.moarvm
+++ Generating  gen/moar/Ops.nqp
+++ Compiling   dynext/libperl6_ops_moar.so
+++ Compiling   blib/Perl6/Ops.moarvm
+++ Generating  gen/moar/Pod.nqp
+++ Compiling   blib/Perl6/Pod.moarvm
+++ Compiling   blib/Perl6/World.moarvm
+++ Generating  gen/moar/Actions.nqp
+++ Compiling   blib/Perl6/Actions.moarvm
+++ Compiling   blib/Perl6/Grammar.moarvm
+++ Generating  gen/moar/Compiler.nqp
+++ Generating  gen/moar/Optimizer.nqp
+++ Generating  gen/moar/Metamodel.nqp
+++ Compiling   blib/Perl6/Metamodel.moarvm
+++ Compiling   blib/Perl6/Optimizer.moarvm
+++ Compiling   blib/Perl6/Compiler.moarvm
+++ Generating  gen/moar/SysConfig.nqp
+++ Compiling   blib/Perl6/SysConfig.moarvm
+++ Compiling   rakudo.moarvm
+++ Generating  gen/moar/BOOTSTRAP/v6c.nqp
+++ Compiling   blib/Perl6/BOOTSTRAP/v6c.moarvm
+++ Compiling   blib/CORE.c.setting.moarvm
The following step can take a long time, please be patient.
Stage start      :   0.001
MoarVM panic: Memory allocation failed; could not allocate 660152 bytes
gmake: *** [Makefile:1219: blib/CORE.c.setting.moarvm] Error 1
Command failed (status 512): /usr/local/bin/gmake
 at /opt/raku/rakubrew/versions/moar-2022.06/3rdparty/nqp-configure/lib/NQP/Config.pm line 34.
        NQP::Config::__ANON__("Command failed (status 512): /usr/local/bin/gmake\x{a}") called at /opt/raku/rakubrew/versions/moar-2022.06/3rdparty/nqp-configure/lib/NQP/Config.pm line 1502
        NQP::Config::system_or_die("/usr/local/bin/gmake") called at Configure.pl line 121
Failed running perl Configure.pl --backends=moar --gen-moar --make-install  --git-cache-dir="/opt/raku/rakubrew/git_reference" at /opt/raku/rakubrew/bin/rakubrew line 752.
patrickbkr commented 2 years ago

@Veraellyunjie How much RAM does the computer have you are building on? The Rakudo CORE.c.setting compilation (the part where it failed) does require quite some RAM (>1 GB).

Veraellyunjie commented 2 years ago

@patrickbkr Have 16 GB RAM

patrickbkr commented 2 years ago

Hm. The error points quite clearly at an out of memory situation. Can you determine at what memory use the build roughly errors? (e.g. by looking at top/htop/...) Do you know whether OpenBSD has any mechanisms to limit the resources a process can use and whether any such limit is in effect?

Veraellyunjie commented 2 years ago

Success. Your @patrickbkr cue made me look in the right direction.


Can you determine at what memory use the build roughly errors? (e.g. by looking at top/htop/...)

I recall it was 1 GB back then.


Now, for measuring memory consumtion of a successful build I tried:

/usr/bin/time -l rakubrew build  # -l - The contents of the rusage structure are printed.
time: rakubrew: No such file or directory
/usr/bin/time -l /opt/raku/rakubrew/bin/rakubrew build
The shell hook required to run rakubrew in either 'env' mode or with the 'shell' command seems not to be installed.
Run 'rakubrew init' for installation instructions if you want to use those features,
or run 'rakubrew mode shim' to use 'shim' mode which doesn't require a shell hook.

Is there a way to run rakubrew via a wrapper programm like /usr/bin/time or torsocks?


while :; do ps -x -o rss,maxrss,vsz,command >> /tmp/rakubrew_build.ps.log; sleep 1; done grep moar /tmp/rakubrew_build.ps.log | sort -h -k 1 grep moar /tmp/rakubrew_build.ps.log | sort -h -k 2 grep moar /tmp/rakubrew_build.ps.log | sort -h -k 3 Maximum in KB: 1803816 for resident set size; 1803816 for max resident set size (dunno the difference); 1934780 for virtual size.


Do you know whether OpenBSD has any mechanisms to limit the resources a process can use and whether any such limit is in effect?

datasize in /etc/login.conf and /etc/login.conf.d/${class}

MoarVM seems to honor datasize-cur soft limit - even when datasize-max hard limit is also set and is higher, MoarVM still stops at datasize-cur.

Here are defaults for OpenBSD 7.1 amd64: Without having added yourself to a class:

default:\
...
        :datasize-cur=1024M:\
...

root is like daemon:

daemon:\
...
        :datasize=4096M:\
...

It is common to add a user to staff:

staff:\
        :datasize-cur=1536M:\
...

Note raised limit for compiling ports:

pbuild:\
...
        :datasize-cur=8192M:\
...

So, I raised my user's class' datasize-cur to 8192m first, 2022.06 release did compile and measurements showed almost 2G. I lowered datasize-cur to 2048m and 2022.04 release did compile. Similar memory usage.


If you are on OpenBSD and experience similar problem, As regular user: ulimit -S -d, ulimit -H -d. If -Hard limit is higher and seems sufficient, raise your -Soft limit: ulimit -S -d $(ulimit -H -d). As root: usermod -L <login class> <username> - make the user belong to a class edit /etc/login.conf.d/${class} or /etc/login.conf appropriately Print current limit: su -c <login class>, ulimit -d

Memory exhaustion check:

while :; do ps auxw | { sleep 0.01; grep loop ;} ; sleep 0.1; done

somehow, ps doesn't show rakudo command name at the beginning of the line - it starts with arguments and at the end there is (rakudo) in parentheses, which may not be shown due to line length, so grep loop

raku -e 'my @a.[0] = 0; loop { @a.push: @a[^@a.elems/5].Str }'

Better one-liners to test memory exhaustion are welcome.


The internet shows similar issues to be rather frequent, due to OpenBSD policy of tighter limits. So if rakubrew team find it appropriate, I'd suggest adding to rakubrew webpage and built-in help:

OpenBSD note:
For building Raku from source you may need to bump up `datasize` system limit to `2048M` or higher.
As regular user, try: `ulimit -S -d $(ulimit -H -d)` - consult `man 1 ksh` http://man.openbsd.org/ksh#ulimit
As root: `:datasize-cur=2048M:` in `login.conf`, then relogin - consult `man 5 login.conf` http://man.openbsd.org/login.conf#CAPABILITIES

and maybe a check in code:

if ($^O eq 'openbsd') {
    require BSD::Resource;
    BSD::Resource->import;
    my ($soft, $hard) = getrlimit("RLIMIT_DATA");
    if ($soft < 2097152) {
        my $warning = <<~"END";
            system limit of $soft on datasize is likely to be insufficient for building Raku.
            2048M was reported to be required for `moar-2022.06` on OpenBSD 7.1 amd64.
            If build fails due to lack of memory, raise system limit on the size of the data area:
            as regular user, try: `ulimit -S -d $(ulimit -H -d)` - consult `man 1 ksh`
            as root: `:datasize-cur=2048M:` in `login.conf`, then relogin - consult `man 5 login.conf`
            END
        warn $warning;
    }
}

Thanks