GNU bug report logs -
#15411
libguile initialization inside a pthread segfaults
Previous Next
Reported by: Dale Mellor <dale <at> rdmp.org>
Date: Wed, 18 Sep 2013 19:47:01 UTC
Severity: normal
Done: ludo <at> gnu.org (Ludovic Courtès)
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15411 in the body.
You can then email your comments to 15411 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-guile <at> gnu.org
:
bug#15411
; Package
guile
.
(Wed, 18 Sep 2013 19:47:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Dale Mellor <dale <at> rdmp.org>
:
New bug report received and forwarded. Copy sent to
bug-guile <at> gnu.org
.
(Wed, 18 Sep 2013 19:47:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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=============================================================
[signature.asc (application/pgp-signature, inline)]
Reply sent
to
ludo <at> gnu.org (Ludovic Courtès)
:
You have taken responsibility.
(Sun, 13 Oct 2013 14:07:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Dale Mellor <dale <at> rdmp.org>
:
bug acknowledged by developer.
(Sun, 13 Oct 2013 14:07:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 15411-done <at> debbugs.gnu.org (full text, mbox):
Hi Dale,
Dale Mellor <dale <at> rdmp.org> skribis:
> =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=============================================================
This program is similar to this test:
http://git.savannah.gnu.org/cgit/guile.git/tree/test-suite/standalone/test-pthread-create-secondary.c
> =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
The test above appeared in 2.0.6. As the comment notes, this bug was
fixed in libgc after version 7.2alpha5.
Thus, I would recommend upgrading libgc.
I’m closing the bug, but feel free to reopen if you think I got it wrong!
HTH,
Ludo’.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 11 Nov 2013 12:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 11 years and 228 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.