unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Olivier Dion via General Guile related discussions <guile-user@gnu.org>
To: guile-user@gnu.org
Subject: scm_shell() SEGV on scm_init_readline()
Date: Wed, 30 Dec 2020 20:50:34 -0500	[thread overview]
Message-ID: <87czyqwxp1.fsf@clara> (raw)

Hi,

When calling scm_shell() in a Guile's context, this sometime results in
a segmentation fault when initializing readline.  This fault is
intermittent and I suspect a race condition since I have a second thread
doing things in Guile's context.  Searching on the web have not gave
much.

I managed to catch the fault with ASAN.  Here's the traceback:
----------------------------------------------------------------------
AddressSanitizer:DEADLYSIGNAL
=================================================================
==10316==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fc9e58fcc9e bp 0x7fc9e58fc570 sp 0x7fc9f4eae000 T2)
==10316==The signal is caused by a READ memory access.
==10316==Hint: address points to the zero page.
    #0 0x7fc9e58fcc9e in scm_init_readline (/usr/lib/guile/2.2/extensions/guile-readline.so+0x3c9e)
    #1 0x7fc9fa2f2d84 in scm_dynamic_call (/usr/lib/libguile-2.2.so.1+0xcdd84)
    #2 0x7fc9fa271148 in scm_load_extension (/usr/lib/libguile-2.2.so.1+0x4c148)
    #3 0x7fc9fa2e5841  (/usr/lib/libguile-2.2.so.1+0xc0841)
    #4 0x7fc9fa2ef710 in scm_call_n (/usr/lib/libguile-2.2.so.1+0xca710)
    #5 0x7fc9fa28ab68 in scm_primitive_load_path (/usr/lib/libguile-2.2.so.1+0x65b68)
    #6 0x7fc9fa2e5841  (/usr/lib/libguile-2.2.so.1+0xc0841)
    #7 0x7fc9fa2ef710 in scm_call_n (/usr/lib/libguile-2.2.so.1+0xca710)
    #8 0x7fc9fa26c118 in scm_primitive_eval (/usr/lib/libguile-2.2.so.1+0x47118)
    #9 0x7fc9fa28a38a in scm_primitive_load (/usr/lib/libguile-2.2.so.1+0x6538a)
    #10 0x7fc9fa2e5841  (/usr/lib/libguile-2.2.so.1+0xc0841)
    #11 0x7fc9fa2ef710 in scm_call_n (/usr/lib/libguile-2.2.so.1+0xca710)
    #12 0x7fc9fa26c118 in scm_primitive_eval (/usr/lib/libguile-2.2.so.1+0x47118)
    #13 0x7fc9fa26c179 in scm_eval (/usr/lib/libguile-2.2.so.1+0x47179)
    #14 0x7fc9fa2bbeea in scm_shell (/usr/lib/libguile-2.2.so.1+0x96eea)
    #15 0x55c0f3a5236d in do_make_shell_inner core/scm.c:32
    #16 0x7fc9fa264b19  (/usr/lib/libguile-2.2.so.1+0x3fb19)
    #17 0x7fc9fa2e9c7f  (/usr/lib/libguile-2.2.so.1+0xc4c7f)
    #18 0x7fc9fa2ef710 in scm_call_n (/usr/lib/libguile-2.2.so.1+0xca710)
    #19 0x7fc9fa2dda23  (/usr/lib/libguile-2.2.so.1+0xb8a23)
    #20 0x7fc9fa265146  (/usr/lib/libguile-2.2.so.1+0x40146)
    #21 0x7fc9fa265225 in scm_c_with_continuation_barrier (/usr/lib/libguile-2.2.so.1+0x40225)
    #22 0x7fc9fa2dc42e  (/usr/lib/libguile-2.2.so.1+0xb742e)
    #23 0x7fc9fa1c3da6 in GC_call_with_stack_base (/usr/lib/libgc.so.1+0x10da6)
    #24 0x7fc9fa2dc828 in scm_with_guile (/usr/lib/libguile-2.2.so.1+0xb7828)
    #25 0x55c0f3a52396 in do_make_shell core/scm.c:41
    #26 0x7fc9fa3653e8 in start_thread (/usr/lib/libpthread.so.0+0x93e8)
    #27 0x7fc9f95c1292 in __GI___clone (/usr/lib/libc.so.6+0x100292)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/usr/lib/guile/2.2/extensions/guile-readline.so+0x3c9e) in scm_init_readline
Thread T2 created by T0 here:
    #0 0x7fc9fa3d61c7 in __interceptor_pthread_create /build/gcc/src/gcc/libsanitizer/asan/asan_interceptors.cpp:214
    #1 0x55c0f3a523b9 in make_shell core/scm.c:48
    #2 0x55c0f3a52b54 in scm_start_inner core/scm.c:85
    #3 0x7fc9fa275ca1 in scm_c_with_fluid (/usr/lib/libguile-2.2.so.1+0x50ca1)

==10316==ABORTING
----------------------------------------------------------------------

Note that the readline module is loaded by my home configuration.

Anyone has encountered this fault before?

-- 
Olivier Dion
PolyMtl



                 reply	other threads:[~2020-12-31  1:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czyqwxp1.fsf@clara \
    --to=guile-user@gnu.org \
    --cc=olivier.dion@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).