From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Linas Vepstas" Newsgroups: gmane.lisp.guile.bugs Subject: Re: [PATCH]: deadlock in make_struct() Date: Tue, 18 Nov 2008 16:05:37 -0600 Message-ID: <3ae3aa420811181405k3438f36cs6164a2761550b9bf@mail.gmail.com> References: <3ae3aa420811161028l4d95d299y9ed997d5bae87a23@mail.gmail.com> Reply-To: linasvepstas@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1227046093 15087 80.91.229.12 (18 Nov 2008 22:08:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Nov 2008 22:08:13 +0000 (UTC) Cc: bug-guile@gnu.org To: "Andy Wingo" Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Nov 18 23:09:14 2008 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L2Ykz-00067a-TW for guile-bugs@m.gmane.org; Tue, 18 Nov 2008 23:09:14 +0100 Original-Received: from localhost ([127.0.0.1]:54292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L2Yjr-00063e-4I for guile-bugs@m.gmane.org; Tue, 18 Nov 2008 17:08:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L2YhX-0005Gh-Qz for bug-guile@gnu.org; Tue, 18 Nov 2008 17:05:39 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L2YhX-0005GL-9J for bug-guile@gnu.org; Tue, 18 Nov 2008 17:05:39 -0500 Original-Received: from [199.232.76.173] (port=56978 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L2YhX-0005GD-17 for bug-guile@gnu.org; Tue, 18 Nov 2008 17:05:39 -0500 Original-Received: from yx-out-1718.google.com ([74.125.44.153]:15432) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L2YhX-0001SM-4p for bug-guile@gnu.org; Tue, 18 Nov 2008 17:05:39 -0500 Original-Received: by yx-out-1718.google.com with SMTP id 34so1665833yxf.66 for ; Tue, 18 Nov 2008 14:05:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=/X1e9wvTz7E5XSP9RQJh6u1//8c/bPnOqf2lJQF3J9A=; b=Jy0tO6HQCuzPzbz/JdK0VgCxWYjqMAvbvh4qJvGNPx3CkDSEMNoUqq5iBmLHdyYc81 bSER29Ksy5hyW+lCnpIdw1I+RALk1uQOlHpRxG0ubj/tC4gF0eTtUEl/hFYzin5BbTV5 TiHEsJbOUShLYaZ9H6fBgWErSUKkiR9mNiypc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:cc:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:references; b=TTkOjRpIBrYH5BAWGUMFPdO1snFpGViBJIEvZAj69TIyKvSd4bMHMipxK+UThdvz8W cA8yLy3VHHyheaVAR1U42LdiIGaUnyV0c5rNNmqLFSreRolqRY5F9AuXqytI6TLLpk0f eW9Ns/0k3LBG8hbPf9wyaTXIg/gzUAz83jmsU= Original-Received: by 10.100.163.8 with SMTP id l8mr219297ane.127.1227045937222; Tue, 18 Nov 2008 14:05:37 -0800 (PST) Original-Received: by 10.100.249.18 with HTTP; Tue, 18 Nov 2008 14:05:37 -0800 (PST) In-Reply-To: Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4112 Archived-At: 2008/11/17 Andy Wingo : > Hi Linas, > > I was about to write about how your patch looked incorrect to me, > because GC could see a half-initialized struct (and potentially sweep > it, with a bad free function); Well, I tried to think that through. I tried to find a need for a "remember_up_to_here", but it didn't look like the code needed it -- it seemed like everything was on stack or in registers, and so would be safe from accidental GC. I did not carefully audit all the routines that are called; there may be problems in there. Whether there is a "global variable" lurking somewhere in there was also unclear. In general, I notice that "global variables" are not highlighted in any way in the guile code, thus making it hard to determine if one is manipulating something which is completely local to the thread, or is possibly accessed from multiple threads. I'm thinking it would be a wise long-term strategy to provide this kind of markup, although I don't know how. --linas