Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Last active August 13, 2017 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dogbert17/7e7baa9475ccb03961939aa20bc35b0e to your computer and use it in GitHub Desktop.
Save dogbert17/7e7baa9475ccb03961939aa20bc35b0e to your computer and use it in GitHub Desktop.
SEGV in t/spec/S32-io/IO-Socket-Async.t
dogbert@dogbert-VirtualBox ~/repos/rakudo $ ./perl6-gdb-m t/spec/S32-io/IO-Socket-Async.t
================================================================================================
This is Rakudo Perl 6 running in the GNU 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 2017.07.152.g.30584.dac.2 built on MoarVM version 2017.07.378.g.5.e.94.da.03,
running on ubuntu (14.04.3.LTS.Trusty.Tahr) / linux (3.19.0.32.generic)
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...done.
Starting program: /home/dogbert/repos/rakudo/install/bin/moar --execname=./perl6-gdb-m --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib --libpath=. /home/dogbert/repos/rakudo/perl6.moarvm --nqp-lib=blib t/spec/S32-io/IO-Socket-Async.t
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
[New Thread 0xb7119b40 (LWP 7748)]
1..16
[New Thread 0xb30feb40 (LWP 7749)]
ok 1 - Async listen on bogus hostname
[New Thread 0xb24fcb40 (LWP 7750)]
[New Thread 0xb16feb40 (LWP 7751)]
[New Thread 0xb08feb40 (LWP 7752)]
ok 2 - Async connect to unavailable server breaks promise
[New Thread 0xafafeb40 (LWP 7753)]
[New Thread 0xaecfeb40 (LWP 7754)]
[New Thread 0xadefeb40 (LWP 7755)]
ok 3 - Async connect to available server keeps promise
[New Thread 0xad0feb40 (LWP 7756)]
[New Thread 0xac2feb40 (LWP 7757)]
[New Thread 0xab4feb40 (LWP 7758)]
[New Thread 0xa9afcb40 (LWP 7760)]
[New Thread 0xaa2fdb40 (LWP 7759)]
[New Thread 0xa8efab40 (LWP 7761)]
[New Thread 0xa82f8b40 (LWP 7762)]
[New Thread 0xa76f6b40 (LWP 7763)]
[New Thread 0xa6af4b40 (LWP 7764)]
[New Thread 0xa5ef2b40 (LWP 7765)]
ok 4 - Echo server
ok 5 - Coped with grapheme split across packets
ok 6 - Coped with UTF-8 bytes split across packets
ok 7 - Bad UTF-8 causes quit on Supply (but program survives)
ok 8 - Discard server
ok 9 - bytes-supply
ok 10 - Server socket configured with latin-1 handles it
ok 11 - Can set encoding on incoming Supply separately
ok 12 - Latin-1 client socket correctly encodes
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb16feb40 (LWP 7751)]
0xb7d132b8 in uv_close () from //home/dogbert/repos/rakudo/nqp/MoarVM/../../install/lib/libmoar.so
(gdb) bt
#0 0xb7d132b8 in uv_close () from //home/dogbert/repos/rakudo/nqp/MoarVM/../../install/lib/libmoar.so
#1 0xb7c525a8 in listen_cancel (tc=0xa3306a8, loop=0x9d2ed68, async_task=0xb3bdd1c8, data=0xa2c1ca8) at src/io/asyncsocket.c:791
#2 0xb7c49d8b in cancel_work (tc=0xa3306a8) at src/io/eventloop.c:49
#3 async_handler (handle=0xb0d50470) at src/io/eventloop.c:65
#4 0xb7d12c05 in uv.async_event () from //home/dogbert/repos/rakudo/nqp/MoarVM/../../install/lib/libmoar.so
#5 0xb7d12d06 in uv.async_io () from //home/dogbert/repos/rakudo/nqp/MoarVM/../../install/lib/libmoar.so
#6 0xb7d0f1f2 in uv.io_poll () from //home/dogbert/repos/rakudo/nqp/MoarVM/../../install/lib/libmoar.so
#7 0xb7d135f3 in uv_run () from //home/dogbert/repos/rakudo/nqp/MoarVM/../../install/lib/libmoar.so
#8 0xb7c49b48 in enter_loop (tc=0xa3306a8, callsite=0xb7fd6924 <null_args_callsite>, args=0x0) at src/io/eventloop.c:83
#9 0xb7c63da3 in invoke_handler (tc=tc@entry=0xa3306a8, invokee=invokee@entry=0xb3af9664, callsite=0xb7fd6924 <null_args_callsite>, args=args@entry=0x0) at src/6model/reprs/MVMCFunction.c:9
#10 0xb7c2fde8 in thread_initial_invoke (tc=0xa3306a8, data=0xa115040) at src/core/threads.c:57
#11 0xb7c0d246 in MVM_interp_run (tc=tc@entry=0xa3306a8, initial_invoke=initial_invoke@entry=0xb7c2fd80 <thread_initial_invoke>, invoke_data=0xb7c52850 <on_listen_cancelled>) at src/core/interp.c:88
#12 0xb7c2fe5a in start_thread (data=0xa115040) at src/core/threads.c:81
#13 0xb7d1cee7 in uv.thread_start () from //home/dogbert/repos/rakudo/nqp/MoarVM/../../install/lib/libmoar.so
#14 0xb7953f72 in start_thread (arg=0xb16feb40) at pthread_create.c:312
#15 0xb7a9e3ee in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129
(gdb) f 1
#1 0xb7c525a8 in listen_cancel (tc=0xa3306a8, loop=0x9d2ed68, async_task=0xb3bdd1c8, data=0xa2c1ca8) at src/io/asyncsocket.c:791
791 uv_close((uv_handle_t *)li->socket, on_listen_cancelled);
(gdb) p MVM_dump_backtrace(tc)
$1 = void
(gdb)
-- valgrind
dogbert@dogbert-VirtualBox ~/repos/rakudo $ ./perl6-valgrind-m t/spec/S32-io/IO-Socket-Async.t
================================================================================================
This is Rakudo Perl 6 running in valgrind, a tool for debugging and profiling programs.
Running a program in valgrind usually takes *a lot* more time than running it directly,
so please be patient.
This Rakudo version is 2017.07.152.g.30584.dac.2 built on MoarVM version 2017.07.378.g.5.e.94.da.03,
running on ubuntu (14.04.3.LTS.Trusty.Tahr) / linux (3.19.0.32.generic)
------------------------------------------------------------------------------------------------
==8349== Memcheck, a memory error detector
==8349== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==8349== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==8349== Command: /home/dogbert/repos/rakudo/install/bin/moar --execname=./perl6-valgrind-m --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib --libpath=. /home/dogbert/repos/rakudo/perl6.moarvm --nqp-lib=blib t/spec/S32-io/IO-Socket-Async.t
==8349==
1..16
ok 1 - Async listen on bogus hostname
ok 2 - Async connect to unavailable server breaks promise
ok 3 - Async connect to available server keeps promise
ok 4 - Echo server
ok 5 - Coped with grapheme split across packets
ok 6 - Coped with UTF-8 bytes split across packets
ok 7 - Bad UTF-8 causes quit on Supply (but program survives)
ok 8 - Discard server
ok 9 - bytes-supply
ok 10 - Server socket configured with latin-1 handles it
ok 11 - Can set encoding on incoming Supply separately
ok 12 - Latin-1 client socket correctly encodes
==8349== Thread 5:
==8349== Invalid read of size 4
==8349== at 0x41D02B8: uv_close (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==8349== by 0x410F5A7: listen_cancel (asyncsocket.c:791)
==8349== by 0x4106D8A: cancel_work (eventloop.c:49)
==8349== by 0x4106D8A: async_handler (eventloop.c:65)
==8349== by 0x41CFC04: uv__async_event (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==8349== by 0x41CFD05: uv__async_io (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==8349== by 0x41CC1F1: uv__io_poll (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==8349== by 0x41D05F2: uv_run (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==8349== by 0x4106B47: enter_loop (eventloop.c:83)
==8349== by 0x4120DA2: invoke_handler (MVMCFunction.c:9)
==8349== by 0x40ECDE7: thread_initial_invoke (threads.c:57)
==8349== by 0x40CA245: MVM_interp_run (interp.c:88)
==8349== by 0x40ECE59: start_thread (threads.c:81)
==8349== Address 0x2c is not stack'd, malloc'd or (recently) free'd
==8349==
==8349==
==8349== Process terminating with default action of signal 11 (SIGSEGV)
==8349== Access not within mapped region at address 0x2C
==8349== at 0x41D02B8: uv_close (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==8349== by 0x410F5A7: listen_cancel (asyncsocket.c:791)
==8349== by 0x4106D8A: cancel_work (eventloop.c:49)
==8349== by 0x4106D8A: async_handler (eventloop.c:65)
==8349== by 0x41CFC04: uv__async_event (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==8349== by 0x41CFD05: uv__async_io (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==8349== by 0x41CC1F1: uv__io_poll (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==8349== by 0x41D05F2: uv_run (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==8349== by 0x4106B47: enter_loop (eventloop.c:83)
==8349== by 0x4120DA2: invoke_handler (MVMCFunction.c:9)
==8349== by 0x40ECDE7: thread_initial_invoke (threads.c:57)
==8349== by 0x40CA245: MVM_interp_run (interp.c:88)
==8349== by 0x40ECE59: start_thread (threads.c:81)
==8349== If you believe this happened as a result of a stack
==8349== overflow in your program's main thread (unlikely but
==8349== possible), you can try to increase the size of the
==8349== main thread stack using the --main-stacksize= flag.
==8349== The main thread stack size used in this run was 8388608.
==8349==
==8349== HEAP SUMMARY:
==8349== in use at exit: 150,560,237 bytes in 350,841 blocks
==8349== total heap usage: 619,382 allocs, 268,541 frees, 281,655,721 bytes allocated
==8349==
==8349== LEAK SUMMARY:
==8349== definitely lost: 57,820 bytes in 2,354 blocks
==8349== indirectly lost: 80 bytes in 9 blocks
==8349== possibly lost: 1,268,660 bytes in 39,657 blocks
==8349== still reachable: 149,233,677 bytes in 308,821 blocks
==8349== suppressed: 0 bytes in 0 blocks
==8349== Rerun with --leak-check=full to see details of leaked memory
==8349==
==8349== For counts of detected and suppressed errors, rerun with: -v
==8349== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment