From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Bug #27457 =?utf-8?b?KOKAnFRocmVhZHMs?= mutexes, and critical =?utf-8?b?c2VjdGlvbnPigJ0p?= Date: Tue, 29 Sep 2009 01:21:20 +0200 Message-ID: <87eipqzmdr.fsf_-_@gnu.org> References: <0489FB6F-567B-4967-9703-1A3D89462A37@raeburn.org> <79F7A852-10ED-46DF-9D41-ED545493E8FE@raeburn.org> <87pr9dpgfw.fsf@gnu.org> <871vlr6l2p.fsf@ossau.uklinux.net> <87k4zi6h3q.fsf@gnu.org> <87eipqn12l.fsf@ossau.uklinux.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1254180134 1949 80.91.229.12 (28 Sep 2009 23:22:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Sep 2009 23:22:14 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Sep 29 01:22:07 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MsPXh-0000yZ-10 for guile-devel@m.gmane.org; Tue, 29 Sep 2009 01:22:05 +0200 Original-Received: from localhost ([127.0.0.1]:33613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsPXg-0005TH-18 for guile-devel@m.gmane.org; Mon, 28 Sep 2009 19:22:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MsPXX-0005RH-4m for guile-devel@gnu.org; Mon, 28 Sep 2009 19:21:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MsPXS-0005PV-OF for guile-devel@gnu.org; Mon, 28 Sep 2009 19:21:54 -0400 Original-Received: from [199.232.76.173] (port=60368 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsPXS-0005PC-FQ for guile-devel@gnu.org; Mon, 28 Sep 2009 19:21:50 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:34305) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MsPXR-0005Bw-Fa for guile-devel@gnu.org; Mon, 28 Sep 2009 19:21:50 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1MsPXK-0000ru-Rj for guile-devel@gnu.org; Tue, 29 Sep 2009 01:21:42 +0200 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Sep 2009 01:21:42 +0200 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Sep 2009 01:21:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 148 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 8 =?iso-8859-1?Q?Vend=E9miaire?= an 218 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:iTTiMA8qdAUNCJqItTL0MdpZHfA= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9417 Archived-At: Hi Neil, Neil Jerram writes: > ludo@gnu.org (Ludovic Courtès) writes: > >> Hi, >> >> Neil Jerram writes: >> >>> ludo@gnu.org (Ludovic Courtès) writes: >> >>>> This must be related to http://savannah.gnu.org/bugs/?27457 . >>>> Contributions welcome! ;-) >>> >>> I will start looking at this later this evening. (Unless you're already >>> investigating - in which case please let me know!) >> >> I won’t look into it in the next days, so go ahead! ;-) > > Well... I don't see the throw from critical section problem. Instead, > after a while, I see a hang, with one thread doing: > > #0 0xb7f06424 in __kernel_vsyscall () > #1 0xb7acd255 in sem_wait@@GLIBC_2.1 () from /lib/i686/cmov/libpthread.so.0 > #2 0xb7dc2018 in GC_stop_world () from /usr/lib/libgc.so.1 > > and all the others: > > #0 0xb7f06424 in __kernel_vsyscall () > #1 0xb7b05837 in sigsuspend () from /lib/i686/cmov/libc.so.6 > #2 0xb7dc222b in GC_suspend_handler_inner () from /usr/lib/libgc.so.1 > #3 0xb7dc22b5 in GC_suspend_handler () from /usr/lib/libgc.so.1 > #4 > > In theory, each other thread must have called sem_post(), and the number > of those sem_post()s should be the same as the number of times that the > GC_stop_world thread calls sem_wait(), and so the GC_stop_world thread > shouldn't be waiting. I should have mentioned this one: http://thread.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/3185 . This is normally somewhat fixed in current BDW-GC CVS, but Guile itself may have troubles of its own dealing with cancellation. The critical section issue should be orthogonal, though. > Regarding the throw from critical section problem, I guess I'm not > seeing this because of not running on a multi-core machine. Can someone > who does see this problem > > - run under GDB > - set a breakpoint on the fprintf (stderr, "throw from within critical > section.\n") line in throw.c > - post the thread backtraces (thread apply all bt), when this breakpoint > is hit? Here it is: --8<---------------cut here---------------start------------->8--- Breakpoint 1, scm_ithrow (key=0x707060, args=0x404, noreturn=1) at throw.c:746 (gdb) thread apply all bt Thread 564 (Thread 0x7f90c0d20950 (LWP 18603)): #0 0x00007f90c6f3077a in times () from /nix/store/s88vdfglm94x7jn0vqm24pqhq460s0c7-glibc-2.9/lib/libc.so.6 #1 0x00007f90c85308cc in scm_c_get_internal_run_time () at stime.c:106 #2 0x00007f90c85439ec in vm_debug_engine (vp=0x7f90c0d1f860, program=0x7f90c0d1f860, argv=0x0, nargs=) at vm-engine.c:59 #3 0x00007f90c853a751 in scm_c_with_throw_handler (tag=0x8e90c0, body=, body_data=0x7f90c0d1fa50, handler=, handler_data=, lazy_catch_p=) at throw.c:318 #4 0x00007f90c853a845 in scm_with_throw_handler (key=0x7f90c0d1f860, thunk=, handler=0xc18da0) at throw.c:665 #5 0x00007f90c8545861 in vm_debug_engine (vp=0x703500, program=, argv=, nargs=) at vm-i-system.c:605 #6 0x00007f90c853abc5 in scm_c_catch (tag=, body=, body_data=, handler=, handler_data=, pre_unwind_handler=0, pre_unwind_handler_data=0x7f90c0d1fd60) at throw.c:243 #7 0x00007f90c853ad4e in scm_catch_with_pre_unwind_handler (key=0x7f90c0d1f860, thunk=, handler=0xa2c900, pre_unwind_handler=0x204) at throw.c:627 #8 0x00007f90c853939b in really_launch (d=0x7fff794861b0) at threads.c:801 #9 0x00007f90c84d04aa in c_body (d=0x7f90c0d20000) at continuations.c:318 #10 0x00007f90c853abc5 in scm_c_catch (tag=, body=, body_data=, handler=, handler_data=, pre_unwind_handler=0x7f90c8539fc0 , pre_unwind_handler_data=0x0) at throw.c:243 #11 0x00007f90c84d08d7 in scm_i_with_continuation_barrier (body=, body_data=, handler=0x7f90c84d04c0 , handler_data=0x7f90c0d20000, pre_unwind_handler=, pre_unwind_handler_data=) at continuations.c:294 #12 0x00007f90c84d0970 in scm_c_with_continuation_barrier (func=, data=) at continuations.c:336 #13 0x00007f90c8539972 in scm_i_with_guile_and_parent (func=, data=, parent=) at threads.c:709 #14 0x00007f90c8539a13 in launch_thread (d=0x7fff794861b0) at threads.c:814 #15 0x00007f90c7ffddb2 in GC_inner_start_routine (sb=, arg=) at ../pthread_support.c:1153 #16 0x00007f90c7ff7af5 in GC_call_with_stack_base (fn=0x66b61bdc, arg=0x7f90c0d1f860) at ../misc.c:1323 #17 0x00007f90c7dcaf97 in start_thread () from /nix/store/s88vdfglm94x7jn0vqm24pqhq460s0c7-glibc-2.9/lib/libpthread.so.0 #18 0x00007f90c6f6156d in clone () from /nix/store/s88vdfglm94x7jn0vqm24pqhq460s0c7-glibc-2.9/lib/libc.so.6 Thread 2 (Thread 0x7f90c61c0950 (LWP 18001)): #0 0x00007f90c7dd191b in read () from /nix/store/s88vdfglm94x7jn0vqm24pqhq460s0c7-glibc-2.9/lib/libpthread.so.0 #1 0x00007f90c85182b3 in signal_delivery_thread (data=) at scmsigs.c:164 #2 0x00007f90c853abc5 in scm_c_catch (tag=, body=, body_data=, handler=, handler_data=, pre_unwind_handler=0, pre_unwind_handler_data=0x0) at throw.c:243 #3 0x00007f90c853adb4 in scm_internal_catch (tag=0x2c, body=0x7f90c61bfb8f, body_data=0x1, handler=0xffffffffffffffff, handler_data=0x7f90c8217520) at throw.c:257 #4 0x00007f90c85391ce in really_spawn (d=0x7fff79486dd0) at threads.c:891 #5 0x00007f90c84d04aa in c_body (d=0x7f90c61c0000) at continuations.c:318 #6 0x00007f90c853abc5 in scm_c_catch (tag=, body=, body_data=, handler=, handler_data=, pre_unwind_handler=0x7f90c8539fc0 , pre_unwind_handler_data=0x0) at throw.c:243 #7 0x00007f90c84d08d7 in scm_i_with_continuation_barrier (body=, body_data=, handler=0x7f90c84d04c0 , handler_data=0x7f90c61c0000, pre_unwind_handler=, pre_unwind_handler_data=) at continuations.c:294 #8 0x00007f90c84d0970 in scm_c_with_continuation_barrier (func=, data=) at continuations.c:336 #9 0x00007f90c8539972 in scm_i_with_guile_and_parent (func=, data=, parent=) at threads.c:709 #10 0x00007f90c85399e3 in spawn_thread (d=0x7fff79486dd0) at threads.c:903 #11 0x00007f90c7ffddb2 in GC_inner_start_routine (sb=, arg=) at ../pthread_support.c:1153 #12 0x00007f90c7ff7af5 in GC_call_with_stack_base (fn=0xfffffffffffffe00, arg=0x7f90c61bfb8f) at ../misc.c:1323 #13 0x00007f90c7dcaf97 in start_thread () from /nix/store/s88vdfglm94x7jn0vqm24pqhq460s0c7-glibc-2.9/lib/libpthread.so.0 #14 0x00007f90c6f6156d in clone () from /nix/store/s88vdfglm94x7jn0vqm24pqhq460s0c7-glibc-2.9/lib/libc.so.6 Thread 1 (Thread 0x7f90c89bd6f0 (LWP 17980)): #0 scm_ithrow (key=0x707060, args=0x404, noreturn=1) at throw.c:746 #1 0x00007f90c84f00a0 in scm_i_gsubr_apply_list (self=0x707060, args=) at gsubr.c:316 #2 0x00007f90c8545861 in vm_debug_engine (vp=0x703f00, program=, argv=, nargs=) at vm-i-system.c:605 #3 0x00007f90c84e4b90 in scm_c_with_fluid (fluid=0x6602c0, value=0x4, cproc=0x7f90c84e49e0 , cdata=0xc106c0) at fluids.c:382 #4 0x00007f90c8545861 in vm_debug_engine (vp=0x703f00, program=, argv=, nargs=) at vm-i-system.c:605 #5 0x00007f90c853abc5 in scm_c_catch (tag=, body=, body_data=, handler=, handler_data=, pre_unwind_handler=0, pre_unwind_handler_data=0x7fff79486100) at throw.c:243 #6 0x00007f90c853ad4e in scm_catch_with_pre_unwind_handler (key=0x707060, thunk=, handler=0xc10620, pre_unwind_handler=0x204) at throw.c:627 #7 0x00007f90c84f00a0 in scm_i_gsubr_apply_list (self=0x707060, args=) at gsubr.c:316 #8 0x00007f90c8545ba6 in vm_debug_engine (vp=0x703f00, program=, argv=, nargs=) at vm-i-system.c:689 #9 0x00007f90c8545861 in vm_debug_engine (vp=0x703f00, program=, argv=, nargs=) at vm-i-system.c:605 #10 0x00007f90c84e4b90 in scm_c_with_fluid (fluid=0x6c68e0, value=0x4, cproc=0x7f90c84e49e0 , cdata=0x8e80c0) at fluids.c:382 #11 0x00007f90c8545861 in vm_debug_engine (vp=0x703f00, program=, argv=, nargs=) at vm-i-system.c:605 #12 0x00007f90c84d4df3 in scm_dynamic_wind (in_guard=0x8e8280, thunk=0x8e82a0, out_guard=0x8e81c0) at dynwind.c:112 #13 0x00007f90c8545861 in vm_debug_engine (vp=0x703f00, program=, argv=, nargs=) at vm-i-system.c:605 #14 0x00007f90c853d60f in scm_vm_apply (vm=0x6ff1f0, program=0x8e84c0, args=0x404) at vm.c:406 #15 0x00007f90c8545861 in vm_debug_engine (vp=0x703f00, program=, argv=, nargs=) at vm-i-system.c:605 #16 0x00007f90c84d1122 in scm_sys_start_stack (id=0x104, thunk=0x8cfe20) at debug.c:483 #17 0x00007f90c8545ba6 in vm_debug_engine (vp=0x703f00, program=, argv=, nargs=) at vm-i-system.c:689 #18 0x00007f90c853abc5 in scm_c_catch (tag=, body=, body_data=, handler=, handler_data=, pre_unwind_handler=0, pre_unwind_handler_data=0x7fff79486c30) at throw.c:243 #19 0x00007f90c853ad4e in scm_catch_with_pre_unwind_handler (key=0x707060, thunk=, handler=0x8cfe60, pre_unwind_handler=0x204) at throw.c:627 #20 0x00007f90c84f00a0 in scm_i_gsubr_apply_list (self=0x707060, args=) at gsubr.c:316 #21 0x00007f90c8545861 in vm_debug_engine (vp=0x703f00, program=, argv=, nargs=) at vm-i-system.c:605 #22 0x00007f90c84d1122 in scm_sys_start_stack (id=0x104, thunk=0x8cc0a0) at debug.c:483 #23 0x00007f90c8545861 in vm_debug_engine (vp=0x703f00, program=, argv=, nargs=) at vm-i-system.c:605 #24 0x00007f90c853abc5 in scm_c_catch (tag=, body=, body_data=, handler=, handler_data=, pre_unwind_handler=0x7f90c853a590 , pre_unwind_handler_data=0x7fff794871f0) at throw.c:243 #25 0x00007f90c853ad4e in scm_catch_with_pre_unwind_handler (key=0x707060, thunk=, handler=0xa58fc0, pre_unwind_handler=0x8c5de0) at throw.c:627 #26 0x00007f90c84f00a0 in scm_i_gsubr_apply_list (self=0x707060, args=) at gsubr.c:316 #27 0x00007f90c8545861 in vm_debug_engine (vp=0x703f00, program=, argv=, nargs=) at vm-i-system.c:605 #28 0x00007f90c84d4df3 in scm_dynamic_wind (in_guard=0xa58120, thunk=0xa58100, out_guard=0xa580e0) at dynwind.c:112 #29 0x00007f90c8545861 in vm_debug_engine (vp=0x703f00, program=, argv=, nargs=) at vm-i-system.c:605 #30 0x00007f90c84db73c in ceval (x=0x8b52c0, env=0x8b5220) at eval.i.c:1136 #31 0x00007f90c84e353a in scm_eval_x (exp=0x89b650, module_or_state=0x804720) at eval.c:4095 #32 0x00007f90c85195ff in scm_shell (argc=2, argv=0x7fff79487ae8) at script.c:771 #33 0x00007f90c84f611f in invoke_main_func (body_data=0x7fff794879e0) at init.c:378 #34 0x00007f90c84d04aa in c_body (d=0x7fff79487910) at continuations.c:318 #35 0x00007f90c853abc5 in scm_c_catch (tag=, body=, body_data=, handler=, handler_data=, pre_unwind_handler=0x7f90c8539fc0 , pre_unwind_handler_data=0x0) at throw.c:243 #36 0x00007f90c84d08d7 in scm_i_with_continuation_barrier (body=, body_data=, handler=0x7f90c84d04c0 , handler_data=0x7fff79487910, pre_unwind_handler=, pre_unwind_handler_data=) at continuations.c:294 #37 0x00007f90c84d0970 in scm_c_with_continuation_barrier (func=, data=) at continuations.c:336 #38 0x00007f90c8539972 in scm_i_with_guile_and_parent (func=, data=, parent=) at threads.c:709 #39 0x00007f90c84f60d5 in scm_boot_guile (argc=, argv=, main_func=0x1, closure=0x1) at init.c:361 #40 0x0000000000400b50 in main (argc=7368800, argv=0x404) at guile.c:70 --8<---------------cut here---------------end--------------->8--- Hope this helps, Ludo’.