From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#19523: Segfault when creating thread with scm_with_guile Date: Tue, 28 Feb 2017 13:16:54 +0100 Message-ID: <87wpcao6h5.fsf@pobox.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488284295 23216 195.159.176.226 (28 Feb 2017 12:18:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Feb 2017 12:18:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 19523@debbugs.gnu.org To: Anthonin Bonnefoy Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Feb 28 13:18:12 2017 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cigjK-0005N4-EW for guile-bugs@m.gmane.org; Tue, 28 Feb 2017 13:18:10 +0100 Original-Received: from localhost ([::1]:60599 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cigjO-0000mr-Un for guile-bugs@m.gmane.org; Tue, 28 Feb 2017 07:18:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cigjF-0000k4-V7 for bug-guile@gnu.org; Tue, 28 Feb 2017 07:18:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cigjC-0001MX-O0 for bug-guile@gnu.org; Tue, 28 Feb 2017 07:18:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60952) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cigjC-0001MQ-LO for bug-guile@gnu.org; Tue, 28 Feb 2017 07:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cigjC-0003RC-B4 for bug-guile@gnu.org; Tue, 28 Feb 2017 07:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 28 Feb 2017 12:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19523 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 19523-submit@debbugs.gnu.org id=B19523.148828422813145 (code B ref 19523); Tue, 28 Feb 2017 12:18:02 +0000 Original-Received: (at 19523) by debbugs.gnu.org; 28 Feb 2017 12:17:08 +0000 Original-Received: from localhost ([127.0.0.1]:59151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cigiJ-0003Px-Rx for submit@debbugs.gnu.org; Tue, 28 Feb 2017 07:17:08 -0500 Original-Received: from pb-sasl2.pobox.com ([64.147.108.67]:55760 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cigiI-0003Po-17 for 19523@debbugs.gnu.org; Tue, 28 Feb 2017 07:17:06 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id 6BC8C5DCA1; Tue, 28 Feb 2017 07:17:04 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=AFF0/IzfxhPd/sGR4YUEC3IdZxA=; b=El41VG Cv6WDoedFNfY8T/JQrxhC5SpvtMbQFvXEtqVPjPSTS+kpoEViRfIg6UOw2MqkRqA +az04yWXrEEuj2POI5469A82K77NTeHyZ7IITwAkqYRey7ANGgGriJGwmjVhCfBw LorxQU3U9C5vLg1fZ1sk2X5yWOHefsGqA16LE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=GdCpOYQ+vdIwEZsogb4doA7oIA9pBtB9 bYUkwB5wk2XjkKXBa21dx//MaASov+dhKXY6nP1owJUuYSC1tsXB20fKYTelOSDj xhJp+h2pWU1dESP3ZruyHa/FqUjlDFIODhYucAlWTBu2gmNgZ7/PJbOC4tGSIh8g NOGomF3VOX4= Original-Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id 5CC145DCA0; Tue, 28 Feb 2017 07:17:04 -0500 (EST) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl2.pobox.com (Postfix) with ESMTPSA id BF5C95DC97; Tue, 28 Feb 2017 07:17:02 -0500 (EST) In-Reply-To: (Anthonin Bonnefoy's message of "Tue, 6 Jan 2015 15:27:31 +0100") X-Pobox-Relay-ID: CFEA3412-FDAF-11E6-9354-6141F2301B6D-02397024!pb-sasl2.pobox.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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" Xref: news.gmane.org gmane.lisp.guile.bugs:8578 Archived-At: Hi, On Tue 06 Jan 2015 15:27, Anthonin Bonnefoy writes: > Example program: > ``` > #include > #include > #include I had to add 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 /gnu/store/y8ppqsxiki39n4mqpb4mab6bgwqsnnp7-libgc-7.4.2/lib/libgc.so.1 (gdb) bt #0 0x00007ffff785f9ab in return_freelists () from /gnu/store/y8ppqsxiki39n4mqpb4mab6bgwqsnnp7-libgc-7.4.2/lib/libgc.so.1 #1 0x00007ffff785fad8 in GC_destroy_thread_local () from /gnu/store/y8ppqsxiki39n4mqpb4mab6bgwqsnnp7-libgc-7.4.2/lib/libgc.so.1 #2 0x00007ffff7861c4d in GC_unregister_my_thread_inner () from /gnu/store/y8ppqsxiki39n4mqpb4mab6bgwqsnnp7-libgc-7.4.2/lib/libgc.so.1 #3 0x00007ffff7862291 in GC_unregister_my_thread () from /gnu/store/y8ppqsxiki39n4mqpb4mab6bgwqsnnp7-libgc-7.4.2/lib/libgc.so.1 #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. Andy