From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Chris Vine Newsgroups: gmane.lisp.guile.user Subject: Re: Guile bugs Date: Tue, 19 Sep 2017 21:18:40 +0100 Message-ID: <20170919211840.0321cf69@bother.homenet> References: <87lgtajpkc.fsf@web.de> <87h8y7ruuz.fsf_-_@gnu.org> <87y3pm7l6j.fsf@gnu.org> <87wp55elvs.fsf@gnu.org> <871sn875tl.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1505852370 29986 195.159.176.226 (19 Sep 2017 20:19:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 19 Sep 2017 20:19:30 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Sep 19 22:19:19 2017 Return-path: Envelope-to: guile-user@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 1duOzH-00078l-9a for guile-user@m.gmane.org; Tue, 19 Sep 2017 22:19:19 +0200 Original-Received: from localhost ([::1]:45193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duOzL-0004lV-A5 for guile-user@m.gmane.org; Tue, 19 Sep 2017 16:19:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duOyp-0004l3-2T for guile-user@gnu.org; Tue, 19 Sep 2017 16:18:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duOyk-0003tS-1o for guile-user@gnu.org; Tue, 19 Sep 2017 16:18:51 -0400 Original-Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:49918) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1duOyj-0003rV-RU for guile-user@gnu.org; Tue, 19 Sep 2017 16:18:45 -0400 Original-Received: by mail-wm0-x232.google.com with SMTP id e71so1916287wmg.4 for ; Tue, 19 Sep 2017 13:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=tbcU1Dp/nNHaBqRY+E6S1JeH+6I+89QVeUrZAMkBmsI=; b=eIMXLRMncxx5xRL9JvFxlXHmwZWS2zExszSs8fr0Po3tf3EFVxT5GgWfcsMSV8Pgpw FWralUTiocqjgVGsZUWtJX0kIB8JHrD8R2i/5pAkapd6QK2pcVih1KVP0aeMpqWPSLtT bjFcqqRaQF23xKv/4D3csReZK2av/k6B27WPPxRFW9lDVdqBC38RZ8QUFgA0f7aza7y6 5GbQ4fKMoN9XE/F4bvugq/3uQHxZAVHKmm8j2iQtL86eWuoRtYWmQCkFJ5hZrRBVqD/Z lddB0SpYjLlA2F3nwLSVG03TuB1YVs8WJrEfvMwXJGMir5KQlrmkVm2x1RJUvK0DES/c sgrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tbcU1Dp/nNHaBqRY+E6S1JeH+6I+89QVeUrZAMkBmsI=; b=uXWZXmMo9jewwbdz9OpFTWY+aue0viRmW/ZZOsPd77bzYItvGvP55Nu4Nqjz+ThQQ8 nf7Ndfj9t1lIm+c50o0SnajwZ7psOVujyQp7o1sfEs66IeXDmxesR5FM8wEtd6+gt1wn bcg06xm53FpDdKKp7gyirHWKT4fux+x1pyLuNVuX+/qmtwkXzGYKWkYzBU2jCNQQiUft tNcpUEx989gTNa9KI1jE5JU8QdbqTEtMUBplWzqbQywK4R8AyfaG73F2bMNJtY6jjU+Z 7g9UbwQSmgJiXzrjckykb+h2oyjadL1kKMMyrFA858OQRFzfRPgkaFwIA3ZcWnCX/WrE f3vw== X-Gm-Message-State: AHPjjUgZimx+yKCpdZKWotEWJeWBLF3++W+TSDgn42Nfc9w4/sRaSZBY 8G9CLXfnmdyv2JDuSqz4uQbofA== X-Google-Smtp-Source: AOwi7QBP7Ho8DvjS3oSl9PQSiYjypyyojXRJQtNvKKNrR9GspNypbTHCfCWDpSQ38j/V+EJUBs3XFg== X-Received: by 10.28.105.92 with SMTP id e89mr1932828wmc.65.1505852323042; Tue, 19 Sep 2017 13:18:43 -0700 (PDT) Original-Received: from bother.homenet ([95.151.180.102]) by smtp.gmail.com with ESMTPSA id t36sm174538wrc.28.2017.09.19.13.18.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Sep 2017 13:18:41 -0700 (PDT) Original-Received: from bother.homenet (localhost [IPv6:::1]) by bother.homenet (Postfix) with ESMTP id 298062632B9 for ; Tue, 19 Sep 2017 21:18:40 +0100 (BST) In-Reply-To: X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::232 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14172 Archived-At: On Tue, 19 Sep 2017 19:04:21 +0800 Linas Vepstas wrote: > On Fri, Sep 15, 2017 at 3:56 PM, Ludovic Court=C3=A8s wrot= e: [snip] > > That said, if you run a REPL server in a separate thread and mutate > > the global state of the program, you could possibly crash it=E2=80=94no > > wonders here. > > =20 >=20 > Yes, well, I would call that a bug! It feels like you are trying to > blame me for a guile bug -- its not my fault that it crashes! >=20 > I did not look very carefully, and don't recall what the stack traces > looked like, but I got the impression that there were race conditions > in guile init, and how it interacted with the sockets. Your problems are clearly at least partly at a deeper level, and you may already know what I say below on thread safety, but: (i) you cannot auto-compile the same file concurrently in two different threads, for obvious reasons: the generated 'go' file will be a mash up to two different compilations. I have not had a problem with user-compiling files concurrently to different locations, although I accept that you may have (although you say this is rare). (ii) prior to guile-2.0.10, guile initialization was not thread safe - you needed to have entered scm_with_guile() at least once in a single thread, and completed initialization (say by having scm_with_guile() return), before starting any new threads which might invoke scm_with_guile() or evaluate any scheme expressions. (iii) modifying most system non-fluid/non-parameter globals is thread unsafe. In particular, loading modules concurrently for the first time will lead to problems (you have to load all required modules up front in a single thread before starting any new threads which might independently try to load the modules). Ports are also not thread safe (rightly so in my view), and I believe that extends to the global stdout and stdin ports. Chris