Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Created November 12, 2021 17:53
Show Gist options
  • Save dogbert17/93fc8512fda91df90563d5ce49522baa to your computer and use it in GitHub Desktop.
Save dogbert17/93fc8512fda91df90563d5ce49522baa to your computer and use it in GitHub Desktop.
Memory allocation error
dogbert@dogbert-VirtualBox:~/repos/rakudo$ MVM_SPESH_NODELAY=1 ./rakudo-gdb-m -Ilib t/spec/S32-num/complex.t
================================================================================================
This is Rakudo running in the debugger, which often allows the user to generate useful back-
traces to debug or report issues in Rakudo, the MoarVM backend or the currently running code.
This Rakudo version is 2021.10.90.gfca.63.e.6.c.0 built on MoarVM version 2021.10.65.gf.8.addda.15,
running on linuxmint (20.Ulyana) / linux
Type `bt full` to generate a backtrace if applicable, type `q` to quit or `help` for help.
------------------------------------------------------------------------------------------------
Reading symbols from /home/dogbert/repos/rakudo/install/bin/moar...
Starting program: /home/dogbert/repos/rakudo/install/bin/moar --execname=/home/dogbert/repos/rakudo/rakudo-gdb-m --libpath=/home/dogbert/repos/rakudo --libpath=/home/dogbert/repos/rakudo/blib --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib /home/dogbert/repos/rakudo/perl6.moarvm -Ilib t/spec/S32-num/complex.t
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff7215700 (LWP 194248)]
1..555
ok 1 - Complex.new() gives 0+0i
ok 2 - postfix:<i> creates a Complex number
ok 3 - i creates a Complex number
...
ok 348 - 3/2 - -2-3i
ok 349 - 0.4535961214255773+0.8912073600614354i + 0 = 0.4535961214255773+0.8912073600614354i
[Switching to Thread 0x7ffff7215700 (LWP 194255)]
Thread 2 "spesh optimizer" hit Breakpoint 1, MVM_panic (exitCode=0, messageFormat=0x0) at src/core/exceptions.c:840
840 MVM_NO_RETURN void MVM_panic(MVMint32 exitCode, const char *messageFormat, ...) {
(gdb) bt
#0 MVM_panic (exitCode=0, messageFormat=0x0) at src/core/exceptions.c:840
#1 0x00007ffff77e1133 in MVM_panic_allocation_failed (len=16195990944) at src/core/exceptions.c:854
#2 0x00007ffff784ac39 in MVM_calloc (num=1, size=16195990944) at src/core/alloc.h:14
#3 0x00007ffff784ae20 in MVM_region_alloc (tc=0x555555623ac0, al=0x7ffff3b49228, bytes=16195990944) at src/core/regionalloc.c:22
#4 0x00007ffff7924e5f in MVM_spesh_alloc (tc=0x555555623ac0, g=0x7ffff3b491d0, bytes=16195990944) at src/spesh/graph.c:41
#5 0x00007ffff793f20d in analyze_phi (tc=0x555555623ac0, g=0x7ffff3b491d0, ins=0x7ffff2cf374e) at src/spesh/optimize.c:2021
#6 0x00007ffff793f47b in optimize_bb_switch (tc=0x555555623ac0, g=0x7ffff3b491d0, bb=0x7ffff2cf0198, p=0x0) at src/spesh/optimize.c:2045
#7 0x00007ffff793fc07 in optimize_bb (tc=0x555555623ac0, g=0x7ffff3b491d0, bb=0x7ffff2cf0198, p=0x0) at src/spesh/optimize.c:2350
#8 0x00007ffff793df13 in optimize_runbytecode (tc=0x555555623ac0, g=0x7ffff3b491d0, bb=0x7ffff135b170, ins=0x7ffff3ad85b0, p=0x7ffff2d6cc60) at src/spesh/optimize.c:1617
#9 0x00007ffff793f9f0 in optimize_bb_switch (tc=0x555555623ac0, g=0x7ffff3b491d0, bb=0x7ffff135b170, p=0x7ffff2d6cc60) at src/spesh/optimize.c:2290
#10 0x00007ffff793fc07 in optimize_bb (tc=0x555555623ac0, g=0x7ffff3b491d0, bb=0x7ffff135b170, p=0x7ffff2d6cc60) at src/spesh/optimize.c:2350
#11 0x00007ffff793fc41 in optimize_bb (tc=0x555555623ac0, g=0x7ffff3b491d0, bb=0x7ffff30038f0, p=0x7ffff2d6cc60) at src/spesh/optimize.c:2354
#12 0x00007ffff793fc41 in optimize_bb (tc=0x555555623ac0, g=0x7ffff3b491d0, bb=0x7ffff3003868, p=0x7ffff2d6cc60) at src/spesh/optimize.c:2354
#13 0x00007ffff79414cf in MVM_spesh_optimize (tc=0x555555623ac0, g=0x7ffff3b491d0, p=0x7ffff2d6cc60) at src/spesh/optimize.c:2788
#14 0x00007ffff795b996 in MVM_spesh_candidate_add (tc=0x555555623ac0, p=0x7ffff2d6cc60) at src/6model/reprs/MVMSpeshCandidate.c:256
#15 0x00007ffff794c8eb in worker (tc=0x555555623ac0, arg_info=...) at src/spesh/worker.c:29
#16 0x00007ffff7836c45 in thread_initial_invoke (tc=0x555555623ac0, data=0x5555556338c0) at src/core/threads.c:68
#17 0x00007ffff77e3345 in MVM_interp_run (tc=0x555555623ac0, initial_invoke=0x7ffff7836b80 <thread_initial_invoke>, invoke_data=0x5555556338c0, outer_runloop=0x0) at src/core/interp.c:180
#18 0x00007ffff7836d19 in start_thread (data=0x5555556338c0) at src/core/threads.c:101
#19 0x00007ffff7269609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#20 0x00007ffff74f4293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb) info threads
Id Target Id Frame
1 Thread 0x7ffff7259440 (LWP 194254) "moar" futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55555555a380) at ../sysdeps/nptl/futex-internal.h:183
* 2 Thread 0x7ffff7215700 (LWP 194255) "spesh optimizer" MVM_panic (exitCode=0, messageFormat=0x0) at src/core/exceptions.c:840
(gdb) f 2
#2 0x00007ffff784ac39 in MVM_calloc (num=1, size=16195990944) at src/core/alloc.h:14
14 MVM_panic_allocation_failed(num * size);
(gdb) l
9
10 MVM_STATIC_INLINE void * MVM_calloc(size_t num, size_t size) {
11 void *ptr = calloc(num, size);
12
13 if (!ptr)
14 MVM_panic_allocation_failed(num * size);
15
16 return ptr;
17 }
18
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment