From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.devel Subject: Re: Calling Lisp from undo.c's record_* functions Date: Wed, 18 Nov 2015 12:26:10 +0000 Message-ID: <87a8qbsdct.fsf@russet.org.uk> References: <83r3jpc2of.fsf@gnu.org> <87h9kkbz6k.fsf@russet.org.uk> <87d1v8bsbf.fsf@russet.org.uk> <83bnasbnlq.fsf@gnu.org> <87fv04mj9i.fsf@russet.org.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1447851363 12139 80.91.229.3 (18 Nov 2015 12:56:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Nov 2015 12:56:03 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 18 13:55:59 2015 Return-path: Envelope-to: ged-emacs-devel@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 1Zz2HE-0000Zs-24 for ged-emacs-devel@m.gmane.org; Wed, 18 Nov 2015 13:55:56 +0100 Original-Received: from localhost ([::1]:35671 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz2HD-0006RU-7R for ged-emacs-devel@m.gmane.org; Wed, 18 Nov 2015 07:55:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz2Gv-0006RP-CI for emacs-devel@gnu.org; Wed, 18 Nov 2015 07:55:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zz2Gu-0007bl-1M for emacs-devel@gnu.org; Wed, 18 Nov 2015 07:55:37 -0500 Original-Received: from cheviot22.ncl.ac.uk ([128.240.234.22]:48313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz2Go-0007bA-D3; Wed, 18 Nov 2015 07:55:30 -0500 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk) by cheviot22.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1Zz1oQ-0000MK-EH; Wed, 18 Nov 2015 12:26:10 +0000 Original-Received: from jangai.ncl.ac.uk ([10.66.67.223] helo=localhost) by smtpauth.ncl.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1Zz1oQ-0000tY-8F; Wed, 18 Nov 2015 12:26:10 +0000 In-Reply-To: (Stefan Monnier's message of "Tue, 17 Nov 2015 21:55:24 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:194706 Archived-At: Stefan Monnier writes: >> As far as I can tell, changing a text property will result in changes to >> the undo list, but doesn't call prepare_to_modify_buffer. Rather >> modify_text_properties appears to call prepare_to_modify_buffer_1 >> directly. Bit surprising -- I wouldn't have expected a function called >> "blah_1" to be called directly from anywhere other than "blah". > > Ah, so maybe the call to run_undoable_change should be in > prepare_to_modify_buffer_1 rather than in prepare_to_modify_buffer. > I haven't actually looked at the code. Yeah, that's on the other branch fix/segfault-undoable-change-prepare-for-buffer I think I have managed to replicate this error now -- not unit testable, but forcing a GC in undo-auto--undoable-change like so: (defun undo-auto--undoable-change () "Called after every undoable buffer change." (garbage-collect) (add-to-list 'undo-auto--undoably-changed-buffers (current-buffer)) (undo-auto--boundary-ensure-timer)) then running make check seems to segfault pretty reliably, usually during bootstrap. fix/segfault-undoable-change-prepare-for-buffer seems to behave rather better (even with the forced gc). This seems like the better solution to me. Phil