From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: johnanthony@lavabit.com Newsgroups: gmane.lisp.guile.bugs Subject: bug#14035: Bug Report: scm_with_guile inside pthread segfault Date: Fri, 22 Mar 2013 08:15:04 -0400 (EDT) Message-ID: <8629.90.244.59.36.1363954504.squirrel@lavabit.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1363992363 30995 80.91.229.3 (22 Mar 2013 22:46:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Mar 2013 22:46:03 +0000 (UTC) To: 14035@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Mar 22 23:46:29 2013 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UJAjB-00086e-UE for guile-bugs@m.gmane.org; Fri, 22 Mar 2013 23:46:26 +0100 Original-Received: from localhost ([::1]:33117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJAio-0000ly-Gl for guile-bugs@m.gmane.org; Fri, 22 Mar 2013 18:46:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJAZE-0007Qa-54 for bug-guile@gnu.org; Fri, 22 Mar 2013 18:36:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJAZB-0006W4-An for bug-guile@gnu.org; Fri, 22 Mar 2013 18:36:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJAZB-0006Vy-76 for bug-guile@gnu.org; Fri, 22 Mar 2013 18:36:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UJAb4-0005ig-Uq for bug-guile@gnu.org; Fri, 22 Mar 2013 18:38:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: johnanthony@lavabit.com Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 22 Mar 2013 22:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14035 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.136399186221953 (code B ref -1); Fri, 22 Mar 2013 22:38:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Mar 2013 22:37:42 +0000 Original-Received: from localhost ([127.0.0.1]:41337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJAag-0005hx-E8 for submit@debbugs.gnu.org; Fri, 22 Mar 2013 18:37:42 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41079) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJ0uL-0006rm-Ht for submit@debbugs.gnu.org; Fri, 22 Mar 2013 08:17:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJ0sP-0001nS-S2 for submit@debbugs.gnu.org; Fri, 22 Mar 2013 08:15:20 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:43863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJ0sP-0001nH-Px for submit@debbugs.gnu.org; Fri, 22 Mar 2013 08:15:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJ0sI-0002CD-Ob for bug-guile@gnu.org; Fri, 22 Mar 2013 08:15:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJ0sF-0001ka-37 for bug-guile@gnu.org; Fri, 22 Mar 2013 08:15:10 -0400 Original-Received: from karen.lavabit.com ([72.249.41.33]:45227) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJ0sE-0001kO-Ky for bug-guile@gnu.org; Fri, 22 Mar 2013 08:15:07 -0400 Original-Received: from a.earth.lavabit.com (a.earth.lavabit.com [192.168.111.10]) by karen.lavabit.com (Postfix) with ESMTP id 0E67B11BB11 for ; Fri, 22 Mar 2013 07:15:06 -0500 (CDT) Original-Received: from lavabit.com (user-5af43b24.broadband.tesco.net [90.244.59.36]) by lavabit.com with ESMTP id OQOL0BEOOSF1 for ; Fri, 22 Mar 2013 07:15:05 -0500 Original-Received: from 90.244.59.36 (SquirrelMail authenticated user johnanthony) by lavabit.com with HTTP; Fri, 22 Mar 2013 08:15:04 -0400 (EDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=LTYa0MigegXpj+9OI8/X/i8MPpUfpUNUVUQfx3Vl7TeNBd4t8kYUCPQv4ot8Io6tAGIvvU31ct+h/eNqoQPaLN3Cff+KmpnjIUYqn4bzJFSq1VNhRz+n/miwAAqjb/LuK2jqDffbNcF8FzR0GWJdSo0lTtxnyYFr2uhwyfthzoI=; h=Message-ID:Date:Subject:From:To:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding; User-Agent: SquirrelMail/1.4.13 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Fri, 22 Mar 2013 18:37:37 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-Mailman-Approved-At: Fri, 22 Mar 2013 18:46:00 -0400 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6994 Archived-At: Hey, there. I was asked to provide this information to you by the guilefriends in Freenode #guile. This code segfaults and I've been having trouble figuring out why. I'm running Ubuntu 12.10 i686 and I'm happy to help any way I can if you need any more information. Please forgive me if I'm doing a terrible job of this as I've never submitted a bug report before. Version Information: guile 2.0.5-deb+1-3 libgc 1:7.1-9 Example program: ``` #include static void* register_functions(void* data){ int argc =3D 1; char *argv[] =3D {"guile", "--listen=3D54491"}; scm_shell(argc, argv); return NULL; } static void* thread_scheme(void* data) { scm_with_guile(®ister_functions, NULL); return NULL; } int main(void) { pthread_t *threads; pthread_attr_t pthread_custom_attr; threads =3D malloc(sizeof(pthread_t)); pthread_attr_init(&pthread_custom_attr); pthread_create(&threads[0], &pthread_custom_attr, thread_scheme, NULL= ); pthread_join(threads[0], NULL); return 0; } ``` Built with gcc (version 4.7.2) like so: gcc test-program.c -ggdb -o test `pkg-config guile-2.0 --cflags` \ `pkg-config guile-2.0 --libs` And here's the bt: ``` Reading symbols from /home/john/test...done. (gdb) r Starting program: /home/john/test [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1". [New Thread 0xb7a24b40 (LWP 15154)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb7a24b40 (LWP 15154)] 0xb7c654ef in GC_push_all_eager () from /usr/lib/libgc.so.1 (gdb) thread apply all bt Thread 2 (Thread 0xb7a24b40 (LWP 15154)): #0 0xb7c654ef in GC_push_all_eager () from /usr/lib/libgc.so.1 #1 0xb7c65543 in GC_push_all_stack () from /usr/lib/libgc.so.1 #2 0xb7c6dc4b in GC_push_all_stacks () from /usr/lib/libgc.so.1 #3 0xb7c68724 in GC_default_push_other_roots () from /usr/lib/libgc.so.1 #4 0xb7c66be5 in GC_push_roots () from /usr/lib/libgc.so.1 #5 0xb7c66056 in GC_mark_some () from /usr/lib/libgc.so.1 #6 0xb7c5cf15 in GC_stopped_mark () from /usr/lib/libgc.so.1 #7 0xb7c5d61a in GC_try_to_collect_inner () from /usr/lib/libgc.so.1 #8 0xb7c67e90 in GC_init_inner () from /usr/lib/libgc.so.1 #9 0xb7c67fe4 in GC_init () from /usr/lib/libgc.so.1 #10 0xb7eb9d90 in ?? () from /usr/lib/libguile-2.0.so.22 #11 0xb7ecb5d7 in ?? () from /usr/lib/libguile-2.0.so.22 #12 0xb7f29100 in ?? () from /usr/lib/libguile-2.0.so.22 #13 0xb7f2913e in ?? () from /usr/lib/libguile-2.0.so.22 #14 0xb7c67a6e in GC_call_with_stack_base () from /usr/lib/libgc.so.1 #15 0xb7f2949f in scm_with_guile () from /usr/lib/libguile-2.0.so.22 #16 0x0804879a in thread_scheme (data=3D0x0) at guile-pthread-test.c:14 #17 0xb7e49d4c in start_thread (arg=3D0xb7a24b40) at pthread_create.c:308 #18 0xb7d86d3e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Thread 1 (Thread 0xb7a26b00 (LWP 15149)): #0 0xb7fdd424 in __kernel_vsyscall () #1 0xb7e4ae1c in pthread_join (threadid=3D3080866624, thread_return=3D0x= 0) at pthread_join.c:89 #2 0x0804880c in main () at guile-pthread-test.c:26 (gdb) q ```