From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Olivier Dion via General Guile related discussions Newsgroups: gmane.lisp.guile.user Subject: scm_shell() SEGV on scm_init_readline() Date: Wed, 30 Dec 2020 20:50:34 -0500 Message-ID: <87czyqwxp1.fsf@clara> Reply-To: Olivier Dion Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8250"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Dec 31 02:51:00 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kun7D-0001zs-Az for guile-user@m.gmane-mx.org; Thu, 31 Dec 2020 02:50:59 +0100 Original-Received: from localhost ([::1]:33442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kun7C-0008T6-2Q for guile-user@m.gmane-mx.org; Wed, 30 Dec 2020 20:50:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kun72-0008Sj-2U for guile-user@gnu.org; Wed, 30 Dec 2020 20:50:48 -0500 Original-Received: from smtp.polymtl.ca ([132.207.4.11]:46338) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kun6z-0005yV-Tt for guile-user@gnu.org; Wed, 30 Dec 2020 20:50:47 -0500 Original-Received: from localhost (modemcable059.101-200-24.mc.videotron.ca [24.200.101.59]) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 0BV1oYd0005951 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 30 Dec 2020 20:50:39 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 0BV1oYd0005951 X-Poly-FromMTA: (modemcable059.101-200-24.mc.videotron.ca [24.200.101.59]) at Thu, 31 Dec 2020 01:50:34 +0000 Received-SPF: pass client-ip=132.207.4.11; envelope-from=olivier.dion@polymtl.ca; helo=smtp.polymtl.ca X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17141 Archived-At: 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