unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* scm_shell() SEGV on scm_init_readline()
@ 2020-12-31  1:50 Olivier Dion via General Guile related discussions
  0 siblings, 0 replies; only message in thread
From: Olivier Dion via General Guile related discussions @ 2020-12-31  1:50 UTC (permalink / raw)
  To: guile-user

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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-31  1:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-31  1:50 scm_shell() SEGV on scm_init_readline() Olivier Dion via General Guile related discussions

unofficial mirror of guile-user@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guile-user/0 guile-user/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guile-user guile-user/ https://yhetil.org/guile-user \
		guile-user@gnu.org
	public-inbox-index guile-user

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.lisp.guile.user
	nntp://news.gmane.io/gmane.lisp.guile.user


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git