From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Linas Vepstas Newsgroups: gmane.lisp.guile.bugs Subject: bug#26711: Example1 is buggy Date: Sun, 30 Apr 2017 16:59:34 -0500 Message-ID: References: Reply-To: linasvepstas@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1146d04e3e550c054e696d73 X-Trace: blaine.gmane.org 1493589678 25027 195.159.176.226 (30 Apr 2017 22:01:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Apr 2017 22:01:18 +0000 (UTC) To: 26711@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon May 01 00:01:11 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 1d4wty-0006NU-Lg for guile-bugs@m.gmane.org; Mon, 01 May 2017 00:01:10 +0200 Original-Received: from localhost ([::1]:46021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d4wu4-0001dP-Af for guile-bugs@m.gmane.org; Sun, 30 Apr 2017 18:01:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d4wty-0001cc-G7 for bug-guile@gnu.org; Sun, 30 Apr 2017 18:01:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d4wtq-000497-5X for bug-guile@gnu.org; Sun, 30 Apr 2017 18:01:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49981) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d4wtq-000493-0f for bug-guile@gnu.org; Sun, 30 Apr 2017 18:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d4wtp-0004Rh-PO for bug-guile@gnu.org; Sun, 30 Apr 2017 18:01:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Linas Vepstas Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 30 Apr 2017 22:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26711 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 26711-submit@debbugs.gnu.org id=B26711.149358960316960 (code B ref 26711); Sun, 30 Apr 2017 22:01:01 +0000 Original-Received: (at 26711) by debbugs.gnu.org; 30 Apr 2017 22:00:03 +0000 Original-Received: from localhost ([127.0.0.1]:48180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4wss-0004PN-Jv for submit@debbugs.gnu.org; Sun, 30 Apr 2017 18:00:03 -0400 Original-Received: from mail-qk0-f173.google.com ([209.85.220.173]:35304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4wsq-0004OT-I0 for 26711@debbugs.gnu.org; Sun, 30 Apr 2017 18:00:00 -0400 Original-Received: by mail-qk0-f173.google.com with SMTP id q1so10525863qkd.2 for <26711@debbugs.gnu.org>; Sun, 30 Apr 2017 15:00:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:from:date:message-id:subject:to; bh=Q1noS1YpgmghGjo9bGVv8eJCb1IOLL/hTzQHx562WvE=; b=u9YFjG+XkL57TVtj1lthn36ZPzW+bsBq9NCjoA0gMjawMHRhaqSWY15snKRSIy0x3d NO05pWTEaXan3beojgYXlvwAISMqgrhehM07kqCF/zfXxMEXs4aLJ5O9TaVUiEt47GtZ Fm1UVpqvzzW36hygFtj3FeiXdJaRmOnCoGgIiaOIr9jHWlHabeUG1mo6Pt1A45dSFZas ro86MxVC+FmL7LIOSEdP0k4OOQElZPx/JKrq6K6RNqzV+332zDqcVXWa7jYUfVrpw6Lv zvQw9vP7PlaY3/WbT8Oll4teeAQwO+7nGT4VZd4jnOnUMTU6pY0kgdhIwbLjE0/PHYuu xNyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=Q1noS1YpgmghGjo9bGVv8eJCb1IOLL/hTzQHx562WvE=; b=DsJw6lakgmGndz9tEc0neh3PEV5F8l0RNNKniEDesCh/Y0qQRk3+qRMv4igfP4cCmP U2AgqUak+v25kShwCG8mvQrGlOKuCb/Usa+O5XUCckoPHYuS4zjwYVVMqviQaIEUAgRD 4X1ZMDRWLpBSGLxoSPTCV90N2QuVltv2suES/UvOgzdSFFN/0RJU7kvKT8ZiZrlCR1NO Sz/TGS+nPQ3WRLq4tgVDpW+i4Luzf/Mb4+Tzb/a9hC37zZng9Tbs0QhXhr4EsYK7SSpA ngMIfB2cjy2NeDmjlHPnbxDlRc5eWA3RzKosGeRZsMLzMHk46dldOk57DRraLiakkx0B OX7w== X-Gm-Message-State: AN3rC/7c6YnKgyZAkgakyzZL9OK+cyVWXzW+5+RXFvcm5zhsmy8rau6n hKHilQVc2ukhyXIHpBq3KQ1V1np30g== X-Received: by 10.55.23.96 with SMTP id i93mr21550506qkh.114.1493589594885; Sun, 30 Apr 2017 14:59:54 -0700 (PDT) Original-Received: by 10.12.135.88 with HTTP; Sun, 30 Apr 2017 14:59:34 -0700 (PDT) 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:8797 Archived-At: --001a1146d04e3e550c054e696d73 Content-Type: text/plain; charset=UTF-8 Example1.cc is has a work-around -- main() needs to call scm_init_guile() or scm_with_guile(). If this is done, the problem goes away. The problem with example1 is that the first thread to initialize guile is eventually destroyed. However, the first thread to call guile never ever sets "needs_unregister" in libguile/threads.c and thus, bdwgc never finds out that this thread no longer exists. Sooner or later, bdwgc touches this non-existent thread, and crashes. If its OK to initialize guile for the first time ever in a transient thread, then there's a bug in guile; else there's a bug in the example. I'm now looking into example2. --linas --001a1146d04e3e550c054e696d73 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Example1.cc is has a work-around = -- main() needs to call scm_init_guile() or scm_with_guile().=C2=A0 If this= is done, the problem goes away.

The problem with exampl= e1 is that the first thread to initialize guile is eventually destroyed. Ho= wever, the first thread to call guile never ever sets "needs_unregiste= r" in libguile/threads.c and thus, bdwgc never finds out that this thr= ead no longer exists. Sooner or later, bdwgc touches this non-existent thre= ad, and crashes.

If its OK to initialize guile for the first t= ime ever in a transient thread, then there's a bug in guile; else there= 's a bug in the example.

I'm now looking into example2= .

--linas
--001a1146d04e3e550c054e696d73--