From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#17168: 24.3.50; Segfault at mark_object Date: Thu, 03 Apr 2014 11:42:54 -0400 Message-ID: References: <87y4zop44m.fsf@yahoo.fr> <533C3AF5.6070502@yandex.ru> <533C6905.9060309@dancol.org> <83bnwjbh8v.fsf@gnu.org> <533C75A6.60900@dancol.org> <533D06E6.2060001@yandex.ru> <533D07EF.1040502@yandex.ru> <533D13E2.3060300@dancol.org> <533D251E.3030108@dancol.org> <533D6A19.8050504@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1396539868 30741 80.91.229.3 (3 Apr 2014 15:44:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Apr 2014 15:44:28 +0000 (UTC) Cc: 17168@debbugs.gnu.org To: Dmitry Antipov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 03 17:44:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WVjoT-0002Jl-8r for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Apr 2014 17:44:21 +0200 Original-Received: from localhost ([::1]:44700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVjoS-0007NR-Tk for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Apr 2014 11:44:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVjoI-0007N2-9P for bug-gnu-emacs@gnu.org; Thu, 03 Apr 2014 11:44:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVjoA-000123-PP for bug-gnu-emacs@gnu.org; Thu, 03 Apr 2014 11:44:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVjoA-00011z-MI for bug-gnu-emacs@gnu.org; Thu, 03 Apr 2014 11:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WVjoA-0004aE-Ed for bug-gnu-emacs@gnu.org; Thu, 03 Apr 2014 11:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Apr 2014 15:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17168 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 17168-submit@debbugs.gnu.org id=B17168.139653978417531 (code B ref 17168); Thu, 03 Apr 2014 15:44:02 +0000 Original-Received: (at 17168) by debbugs.gnu.org; 3 Apr 2014 15:43:04 +0000 Original-Received: from localhost ([127.0.0.1]:34620 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVjnD-0004Yf-Co for submit@debbugs.gnu.org; Thu, 03 Apr 2014 11:43:04 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:41111) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVjnA-0004YF-Ai for 17168@debbugs.gnu.org; Thu, 03 Apr 2014 11:43:01 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s33FgtWi024636; Thu, 3 Apr 2014 11:42:55 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id CBE45603AE; Thu, 3 Apr 2014 11:42:54 -0400 (EDT) In-Reply-To: <533D6A19.8050504@yandex.ru> (Dmitry Antipov's message of "Thu, 03 Apr 2014 18:03:05 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4901=0 X-NAI-Spam-Version: 2.3.0.9378 : core <4901> : inlines <688> : streams <1151245> : uri <1719212> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:87706 Archived-At: > What about this workaround? Until we find a better solution, > this should prevent crashes at least. Let's try to find a better fix instead of another workaround around the existing workaround. So the existing workaround is here: /* Check if the symbol was created during loadup. In such a case it might be pointed to by pure bytecode which we don't trace, so we conservatively assume that it is live. */ bool pure_p = PURE_POINTER_P (XSTRING (sym->s.name)); if (!sym->s.gcmarkbit && !pure_p) { if (sym->s.redirect == SYMBOL_LOCALIZED) xfree (SYMBOL_BLV (&sym->s)); sym->s.next = symbol_free_list; symbol_free_list = &sym->s; #if GC_MARK_STACK symbol_free_list->function = Vdead; #endif ++this_free; } else { ++num_used; if (!pure_p) eassert (!STRING_MARKED_P (XSTRING (sym->s.name))); sym->s.gcmarkbit = 0; } I.e. any symbol with a pure name is assumed to be potentially reachable from some pure objects. But not only this assumption is wrong, but its implementation is wrong as well: we just keep the symbol without making sure we also keep the objects it points to. Furthermore, in theory some pure object may very well point to a symbol whose name was not made pure. Worse, a pure object may point to several other kinds of non-pure objects, so this special treatment we have for symbols should really be applied to other "non-purifyable" objects. How 'bout we change `purecopy' such that before doing /* Not purified, don't hash-cons. */ return obj; it adds the object to a table of "objects pointed from pure space"? This table should probably be a hash-table (for simplicity), and of course we'd only add objects to it when the purecopy call was a recursive call, not for toplevel calls (i.e. calling (purecopy ) should not add to the table since it's not pointed to from a pure object, whereas (purecopy '()) should). Stefan