[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19523: Segfault when creating thread with scm_with_guile

From: Andy Wingo
Subject: bug#19523: Segfault when creating thread with scm_with_guile
Date: Tue, 28 Feb 2017 13:16:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)


On Tue 06 Jan 2015 15:27, Anthonin Bonnefoy <address@hidden> writes:

> Example program:
> ```
> #include <stdlib.h>
> #include <pthread.h>
> #include <libguile.h>

I had to add <libguile/bdw-gc.h> to this to get it to compile on 2.2.  I
wonder if that's a problem?  Anyway it segfaults directly on 2.2:

[Switching to Thread 0x7ffff44d1700 (LWP 8284)]
0x00007ffff785f9ab in return_freelists () from 
(gdb) bt
#0  0x00007ffff785f9ab in return_freelists () from 
#1  0x00007ffff785fad8 in GC_destroy_thread_local () from 
#2  0x00007ffff7861c4d in GC_unregister_my_thread_inner () from 
#3  0x00007ffff7862291 in GC_unregister_my_thread () from 
#4  0x00007ffff74134c9 in __nptl_deallocate_tsd () at pthread_create.c:175
#5  0x00007ffff74145ba in __nptl_deallocate_tsd () at pthread_create.c:326
#6  start_thread (arg=0x7ffff44d1700) at pthread_create.c:346

Looks like I am doubly unregistering the thread.  After landing a fix, I
can't repro the bug any more in master.  I bet in 2.0, Guile is itself
doing GC_unregister_my_thread() even though the GC_pthread_create should
be handling that.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]