unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Dale Mellor <dale@rdmp.org>
To: 15411@debbugs.gnu.org
Subject: bug#15411: libguile initialization inside a pthread segfaults
Date: Wed, 18 Sep 2013 20:36:39 +0100	[thread overview]
Message-ID: <1379532999.4818.5.camel@l2> (raw)

[-- Attachment #1: Type: text/plain, Size: 3157 bytes --]

The following program fails; it produces the session shown below.  Any
help greatly appreciated.

Dale



=PROGRAM==============================================================
#include <libguile.h>



static void *do_guile (void *)
{
  for (;;) ;

  return nullptr;
}



static void *run_thread (void *)
{
  return scm_with_guile (&do_guile, nullptr);
}



int main (int, char **)
{
  pthread_t thread;
  pthread_create (&thread, nullptr, run_thread, nullptr);

  pthread_join (thread, nullptr);

  return 0;
}

=/PROGRAM=============================================================

=SESSION==============================================================
$ cat /etc/debian_version 
7.1

$ g++-4.6 --version
g++-4.6 (Debian 4.6.3-14) 4.6.3

$ guile --version
guile (GNU Guile) 2.0.5-deb+1-3

$ g++-4.6 --std=c++0x test.cc `pkg-config --libs --cflags guile-2.0` -g

$ gdb a.out
GNU gdb (GDB) 7.4.1-debian
This GDB was configured as "i486-linux-gnu".
Reading symbols from a.out...done.
(gdb) r
Starting program: a.out 
warning: Could not load shared library symbols for linux-gate.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library
"/lib/i386-linux-gnu/i686/cmov/libthread_db.so.1".
[New Thread 0xb7916b40 (LWP 4792)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7916b40 (LWP 4792)]
0xb7e2854f in GC_push_all_eager () from /usr/lib/libgc.so.1
(gdb) info stack
#0  0xb7e2854f in GC_push_all_eager () from /usr/lib/libgc.so.1
#1  0xb7e285a3 in GC_push_all_stack () from /usr/lib/libgc.so.1
#2  0xb7e30b9b in GC_push_all_stacks () from /usr/lib/libgc.so.1
#3  0xb7e2b6e4 in GC_default_push_other_roots ()
from /usr/lib/libgc.so.1
#4  0xb7e29c45 in GC_push_roots () from /usr/lib/libgc.so.1
#5  0xb7e290b6 in GC_mark_some () from /usr/lib/libgc.so.1
#6  0xb7e1ffb5 in GC_stopped_mark () from /usr/lib/libgc.so.1
#7  0xb7e206ba in GC_try_to_collect_inner () from /usr/lib/libgc.so.1
#8  0xb7e2ae50 in GC_init_inner () from /usr/lib/libgc.so.1
#9  0xb7e2afa4 in GC_init () from /usr/lib/libgc.so.1
#10 0xb7eba7d0 in ?? () from /usr/lib/libguile-2.0.so.22
#11 0xb7ecbebd in ?? () from /usr/lib/libguile-2.0.so.22
#12 0xb7f29750 in ?? () from /usr/lib/libguile-2.0.so.22
#13 0xb7f29790 in ?? () from /usr/lib/libguile-2.0.so.22
#14 0xb7e2aa2e in GC_call_with_stack_base () from /usr/lib/libgc.so.1
#15 0xb7f2998f in scm_with_guile () from /usr/lib/libguile-2.0.so.22
#16 0x08048663 in run_thread () at test.cc:16
#17 0xb7cb2cf1 in start_thread ()
   from /lib/i386-linux-gnu/i686/cmov/libpthread.so.0
#18 0xb7bebfee in clone () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
(gdb) thr 1
[Switching to thread 1 (Thread 0xb7918700 (LWP 4789))]
#0  0xb7fde424 in __kernel_vsyscall ()
(gdb) info stack
#0  0xb7fde424 in __kernel_vsyscall ()
#1  0xb7cb3d8c in pthread_join ()
   from /lib/i386-linux-gnu/i686/cmov/libpthread.so.0
#2  0x080486a6 in main () at test.cc:26
(gdb) quit

=/SESSION=============================================================

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

             reply	other threads:[~2013-09-18 19:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18 19:36 Dale Mellor [this message]
2013-10-13 14:06 ` bug#15411: libguile initialization inside a pthread segfaults Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1379532999.4818.5.camel@l2 \
    --to=dale@rdmp.org \
    --cc=15411@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).