From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: tramp and diff-mode results in Emacs crash Date: Wed, 28 Feb 2007 11:28:10 -0500 Message-ID: <87fy8qb61x.fsf@stupidchicken.com> References: <20070222120757.GA28434@morgase.caliginous.net> <20070223235449.GA29688@morgase.caliginous.net> <20070225052253.GA13725@morgase.caliginous.net> <20070225221438.GA16508@morgase.caliginous.net> <87hct73vpw.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1172680404 5900 80.91.229.12 (28 Feb 2007 16:33:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 28 Feb 2007 16:33:24 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 28 17:33:14 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HMRjr-0000Wm-4f for ged-emacs-devel@m.gmane.org; Wed, 28 Feb 2007 17:33:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HMRjr-0008WJ-Jn for ged-emacs-devel@m.gmane.org; Wed, 28 Feb 2007 11:33:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HMRjg-0008VJ-7S for emacs-devel@gnu.org; Wed, 28 Feb 2007 11:33:00 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HMRjf-0008V8-SI for emacs-devel@gnu.org; Wed, 28 Feb 2007 11:32:59 -0500 Original-Received: from south-station-annex.mit.edu ([18.72.1.2]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HMRjf-0003Z8-E6 for emacs-devel@gnu.org; Wed, 28 Feb 2007 11:32:59 -0500 Original-Received: from grand-central-station.mit.edu (GRAND-CENTRAL-STATION.MIT.EDU [18.7.21.82]) by south-station-annex.mit.edu (8.13.6/8.9.2) with ESMTP id l1SGWu4X025645; Wed, 28 Feb 2007 11:32:57 -0500 (EST) Original-Received: from outgoing-legacy.mit.edu (OUTGOING-LEGACY.MIT.EDU [18.7.22.104]) by grand-central-station.mit.edu (8.13.6/8.9.2) with ESMTP id l1SGSCHg000786; Wed, 28 Feb 2007 11:28:12 -0500 (EST) Original-Received: from localhost (MAIN-TWELVE-FIFTY-SIX.MIT.EDU [18.19.5.56]) ) by outgoing-legacy.mit.edu (8.13.6/8.12.4) with ESMTP id l1SGSBjD017321; Wed, 28 Feb 2007 11:28:11 -0500 (EST) Original-Received: from cyd by localhost with local (Exim 3.36 #1 (Debian)) id 1HMRf0-0000ji-00; Wed, 28 Feb 2007 11:28:10 -0500 In-Reply-To: (Stefan Monnier's message of "Wed\, 28 Feb 2007 10\:48\:26 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.94 (gnu/linux) X-Scanned-By: MIMEDefang 2.42 X-Spam-Score: -2.599 X-detected-kernel: Solaris 9.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:67043 Archived-At: Stefan Monnier writes: > Oh, wait, you're saying that the problem is that when > combine-after-change-execute is run it begins by calling lock_file, which > causes more changes? Hmm... I still don't see why that would be a problem. > Can you show some backtraces? I couldn't get Emacs to crash, but here is a backtrace from a breakpoint just before Emacs gets confused. Basically, insert_from_string calls prepare_to_modify_buffer before signal_after_change (the latter is supposed to signal the changes due to the insertion). But prepare_to_modify_buffer calls lock_file, which calls the Tramp file handlers, which does its own insertion in a temp buffer, which runs signal_after_change, which first runs signal_after_change on the original buffer---all this happens *before* signal_before_change on the original buffer gets to run! This analysis indicates that the more general solution is to bind inhibit_modification_hooks around the call to lock_file in prepare_to_modify_buffer, but that seems to me too risky a change at this stage in the release. #0 signal_after_change (charpos=1, lendel=0, lenins=12) at insdel.c:2257 #1 0x0811a625 in insert_from_string (string=141595915, pos=0, pos_byte=0, length=12, length_byte=12, inherit=0) at insdel.c:1069 #2 0x08153f7d in general_insert_function (insert_func=0x811aab0 , insert_from_string_func=0x811a5a0 , inherit=0, nargs=1, args=0xbf89bd20) at editfns.c:2176 #3 0x081540b4 in Finsert (nargs=1, args=0xbf89bd20) at editfns.c:2220 #4 0x081874af in Fbyte_code (bytestr=141230795, vector=141367012, maxdepth=40) at bytecode.c:1258 #5 0x0815c2c7 in funcall_lambda (fun=141379860, nargs=2, arg_vector=0xbf89be54) at eval.c:3184 #6 0x0815c711 in Ffuncall (nargs=3, args=0xbf89be50) at eval.c:3054 #7 0x0818793d in Fbyte_code (bytestr=141403235, vector=141259140, maxdepth=56) at bytecode.c:679 #8 0x0815c2c7 in funcall_lambda (fun=141142596, nargs=5, arg_vector=0xbf89bf84) at eval.c:3184 #9 0x0815c711 in Ffuncall (nargs=6, args=0xbf89bf80) at eval.c:3054 #10 0x0818793d in Fbyte_code (bytestr=140040251, vector=139888212, maxdepth=80) at bytecode.c:679 #11 0x0815c2c7 in funcall_lambda (fun=140530676, nargs=2, arg_vector=0xbf89c0c4) at eval.c:3184 #12 0x0815c711 in Ffuncall (nargs=3, args=0xbf89c0c0) at eval.c:3054 #13 0x0815e029 in Fapply (nargs=2, args=0xbf89c194) at eval.c:2485 #14 0x0815ca5a in Ffuncall (nargs=3, args=0xbf89c190) at eval.c:2978 #15 0x0818793d in Fbyte_code (bytestr=139878275, vector=141549748, maxdepth=32) at bytecode.c:679 #16 0x0815c2c7 in funcall_lambda (fun=141253452, nargs=3, arg_vector=0xbf89c2b4) at eval.c:3184 #17 0x0815c711 in Ffuncall (nargs=4, args=0xbf89c2b0) at eval.c:3054 #18 0x0815e029 in Fapply (nargs=3, args=0xbf89c384) at eval.c:2485 #19 0x0815ca5a in Ffuncall (nargs=4, args=0xbf89c380) at eval.c:2978 #20 0x0818793d in Fbyte_code (bytestr=139878451, vector=141181604, maxdepth=32) at bytecode.c:679 #21 0x0815c2c7 in funcall_lambda (fun=139934292, nargs=3, arg_vector=0xbf89c4a4) at eval.c:3184 #22 0x0815c711 in Ffuncall (nargs=4, args=0xbf89c4a0) at eval.c:3054 #23 0x0815cae9 in call3 (fn=138328817, arg1=137589513, arg2=141839179, arg3=137472201) at eval.c:2827 #24 0x0812376c in Fexpand_file_name (name=141839179, default_directory=137472201) at fileio.c:1721 #25 0x08117adc in lock_file (fn=141839179) at filelock.c:605 #26 0x0811869a in prepare_to_modify_buffer (start=1, end=1, preserve_ptr=0x0) at insdel.c:2085 #27 0x0811a2ec in insert_from_string_1 (string=, pos=0, pos_byte=0, nchars=3, nbytes=3, inherit=0, before_markers=0) at insdel.c:1121 #28 0x0811a607 in insert_from_string (string=139867003, pos=0, pos_byte=0, length=3, length_byte=3, inherit=0) at insdel.c:1067 #29 0x08153f7d in general_insert_function (insert_func=0x811aab0 , insert_from_string_func=0x811a5a0 , inherit=0, nargs=1, args=0xbf89c660) at editfns.c:2176 #30 0x081540b4 in Finsert (nargs=1, args=0xbf89c660) at editfns.c:2220 #31 0x0815bf1b in Feval (form=138970861) at eval.c:2301 #32 0x0815c11f in Fprogn (args=137472201) at eval.c:447 #33 0x0815e755 in Flet (args=138970869) at eval.c:1064 #34 0x0815bf3d in Feval (form=138970901) at eval.c:2275 #35 0x0815c11f in Fprogn (args=137472201) at eval.c:447 #36 0x0815c3b4 in funcall_lambda (fun=138970784, nargs=0, arg_vector=0xbf89c894) at eval.c:3177 #37 0x0815c711 in Ffuncall (nargs=1, args=0xbf89c890) at eval.c:3054 #38 0x0815e189 in apply1 (fn=138970789, arg=137472201) at eval.c:2738 #39 0x08159869 in Fcall_interactively (function=138970789, record_flag=137472201, keys=137512716) at callint.c:406 #40 0x080f9313 in Fcommand_execute (cmd=138970789, record_flag=137472201, keys=137472201, special=137472201) at keyboard.c:10014 #41 0x08104d39 in command_loop_1 () at keyboard.c:1873 #42 0x0815b2d2 in internal_condition_case (bfun=0x81049b0 , handlers=137516857, hfun=0x80ff400 ) at eval.c:1481 #43 0x080fe7b3 in command_loop_2 () at keyboard.c:1329 ---Type to continue, or q to quit--- #44 0x0815b38a in internal_catch (tag=137510841, func=0x80fe790 , arg=137472201) at eval.c:1222 #45 0x080ff23c in command_loop () at keyboard.c:1308 #46 0x080ff5fa in recursive_edit_1 () at keyboard.c:1006 #47 0x080ff6e6 in Frecursive_edit () at keyboard.c:1067 #48 0x080f5405 in main (argc=3, argv=0xbf89d134) at emacs.c:1761 Lisp Backtrace: "format-spec" (0x870950b) "tramp-make-tramp-file-name" (0x831a8c9) "tramp-handle-expand-file-name" (0x8744b4b) "apply" (0x86fd461) "tramp-sh-file-name-handler" (0x8337309) "apply" (0x86fd9e1) "tramp-file-name-handler" (0x8337309) "insert" (0x856337b) "let" (0x84886f5) 0x84886a5 Lisp type 5 "call-interactively" (0x84886a5)