From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: [bug #32436] bugs entering guile from pthreads Date: Sat, 12 Feb 2011 14:16:30 +0000 Message-ID: <20110212-141629.sv20118.45730@savannah.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Trace: dough.gmane.org 1297520030 8877 80.91.229.12 (12 Feb 2011 14:13:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 12 Feb 2011 14:13:50 +0000 (UTC) To: Andy Wingo , bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Feb 12 15:13:41 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PoGEG-0005ha-Pl for guile-bugs@m.gmane.org; Sat, 12 Feb 2011 15:13:41 +0100 Original-Received: from localhost ([127.0.0.1]:39969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoGEG-00046B-5x for guile-bugs@m.gmane.org; Sat, 12 Feb 2011 09:13:40 -0500 Original-Received: from [140.186.70.92] (port=46182 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoGE9-000442-VT for bug-guile@gnu.org; Sat, 12 Feb 2011 09:13:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PoGE8-00074k-MM for bug-guile@gnu.org; Sat, 12 Feb 2011 09:13:33 -0500 Original-Received: from colonialone.fsf.org ([140.186.70.51]:57152 helo=internal.in.savannah.gnu.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PoGE8-00074P-9Q for bug-guile@gnu.org; Sat, 12 Feb 2011 09:13:32 -0500 Original-Received: from [10.1.0.103] (helo=frontend.in.savannah.gnu.org) by internal.in.savannah.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PoGE7-0003bR-RS; Sat, 12 Feb 2011 14:13:31 +0000 Original-Received: from www-data by frontend.in.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1PoGH0-0000nW-1W; Sat, 12 Feb 2011 14:16:30 +0000 X-Savane-Server: savannah.gnu.org:443 [10.1.0.103] X-Savane-Project: guile X-Savane-Tracker: bugs X-Savane-Item-ID: 32436 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Safari/531.2+ Epiphany/2.30.2 X-Apparently-From: 90.164.198.39 (Savane authenticated user wingo) Original-References: In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.51 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5116 Archived-At: URL: Summary: bugs entering guile from pthreads Project: Guile Submitted by: wingo Submitted on: Sat 12 Feb 2011 02:16:29 PM GMT Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: Cedric Cellier posted an interesting bug report back in September: http://thread.gmane.org/gmane.lisp.guile.user/8169 It was about 1.8, but the bugs are different in 1.9. Specifically, the program as it is segfaults directly, here with libgc from CVS: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff76d3710 (LWP 2983)] 0x00007ffff7a016e3 in GC_is_black_listed (h=0x633000, len=) at blacklst.c:233 233 if (get_pht_entry_from_index(GC_old_normal_bl, index) (gdb) thr apply all bt Thread 2 (Thread 0x7ffff76d3710 (LWP 2983)): #0 0x00007ffff7a016e3 in GC_is_black_listed (h=0x633000, len=) at blacklst.c:233 #1 0x00007ffff79ff3db in GC_allochblk_nth (sz=512, kind=1, flags=0, n=14, may_split=) at allchblk.c:694 #2 0x00007ffff79ff7dc in GC_allochblk (sz=512, kind=1, flags=0) at allchblk.c:629 #3 0x00007ffff7a0c2fb in GC_new_hblk (gran=32, kind=1) at new_hblk.c:191 #4 0x00007ffff7a01593 in GC_allocobj (gran=32, kind=1) at alloc.c:1312 #5 0x00007ffff7a0658a in GC_generic_malloc_inner (lb=488, k=1) at malloc.c:126 #6 0x00007ffff7a06638 in GC_generic_malloc (lb=488, k=1) at malloc.c:166 #7 0x00007ffff7a06924 in GC_core_malloc (lb=488) at malloc.c:289 #8 0x00007ffff7d48c0a in guilify_self_1 (base=0x7ffff76d2da8) at threads.c:379 #9 0x00007ffff7cf762c in scm_i_init_guile (base=) at init.c:408 #10 0x00007ffff7d4a6f8 in scm_i_init_thread_for_guile (base=0x7ffff76d2da8, parent=0x0) at threads.c:649 #11 0x00007ffff7d4a9a6 in scm_i_with_guile_and_parent (func=0x400704 , data=0x0, parent=) at threads.c:786 #12 0x000000000040072e in the_thread () #13 0x00007ffff7a103c5 in GC_inner_start_routine (sb=, arg=) at pthread_start.c:59 #14 0x00007ffff7a0a525 in GC_call_with_stack_base (fn=, arg=) at misc.c:1491 #15 0x0000003cc8c07761 in start_thread (arg=0x7ffff76d3710) at pthread_create.c:301 #16 0x0000003cc84e14fd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115 Thread 1 (Thread 0x7ffff76d5700 (LWP 2980)): #0 __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136 #1 0x0000003cc8c092c5 in _L_lock_868 () from /lib64/libpthread.so.0 #2 0x0000003cc8c09197 in __pthread_mutex_lock (mutex=0x7ffff7c2b740) at pthread_mutex_lock.c:61 #3 0x00007ffff7a11629 in GC_pthread_create (new_thread=0x7fffffffe058, attr=0x0, start_routine=0x400713 , arg=0x0) at pthread_support.c:1508 #4 0x0000000000400758 in main () But if you do a scm_init_guile in the main thread first, instead we get, eventually: Program received signal SIGABRT, Aborted. [Switching to Thread 0x7ffff741c710 (LWP 2845)] 0x0000003cc84329a5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 64 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); (gdb) bt #0 0x0000003cc84329a5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #1 0x0000003cc8434185 in abort () at abort.c:92 #2 0x00007ffff7d48d5d in guilify_self_1 (base=0x7ffff741bda8) at threads.c:422 #3 0x00007ffff7d4a6de in scm_i_init_thread_for_guile (base=0x7ffff741bda8, parent=0x92e730) at threads.c:658 #4 0x00007ffff7d4a9a6 in scm_i_with_guile_and_parent (func=0x400754 , data=0x0, parent=) at threads.c:786 #5 0x000000000040077e in the_thread () #6 0x00007ffff7a103c5 in GC_inner_start_routine (sb=, arg=) at pthread_start.c:59 #7 0x00007ffff7a0a525 in GC_call_with_stack_base (fn=, arg=) at misc.c:1491 #8 0x0000003cc8c07761 in start_thread (arg=0x7ffff741c710) at pthread_create.c:301 #9 0x0000003cc84e14fd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115 (gdb) fr 2 #2 0x00007ffff7d48d5d in guilify_self_1 (base=0x7ffff741bda8) at threads.c:422 422 abort (); (gdb) l 417 418 if (pipe (t->sleep_pipe) != 0) 419 /* FIXME: Error conditions during the initialization phase are handled 420 gracelessly since public functions such as `scm_init_guile ()' 421 currently have type `void'. */ 422 abort (); 423 424 scm_i_pthread_mutex_init (&t->admin_mutex, NULL); 425 t->current_mark_stack_ptr = NULL; 426 t->current_mark_stack_limit = NULL; It seems that the sleep pipe is never being closed, which would seem to indicate that the threads's cleanup function is not being called. _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/