From xemacs-m  Wed Mar 12 22:43:37 1997
Received: from mailbox1.ucsd.edu (mailbox1.ucsd.edu [132.239.1.53])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id WAA15594
	for <xemacs-beta@xemacs.org>; Wed, 12 Mar 1997 22:43:36 -0600 (CST)
Received: from sdnp5.ucsd.edu (sdnp5.ucsd.edu [132.239.79.10]) by mailbox1.ucsd.edu (8.8.5/8.6.9) with SMTP id UAA20887 for <xemacs-beta@xemacs.org>; Wed, 12 Mar 1997 20:43:37 -0800 (PST)
Received: by sdnp5.ucsd.edu (SMI-8.6/SMI-SVR4)
	id UAA01746; Wed, 12 Mar 1997 20:45:43 -0800
Sender: dmoore@sdnp5.ucsd.edu
To: XEmacs Beta Mailing List <xemacs-beta@xemacs.org>
Subject: 19.15b97+patches core dump
X-Face: "oX;zS#-JU$-,WKSzG.1gGE]x^cIg!hW.dq>.f6pzS^A+(k!T|M:}5{_%>Io<>L&{hO7W4cicOQ|>/lZ1G(m%7iaCf,6Qgk0%%Bz7b2-W3jd0m_UG\Y;?]}4s0O-U)uox>P3JN)9cm]O\@,vy2e{`3pb!"pqmRy3peB90*2L
Mail-Copies-To: never
Mime-Version: 1.0 (generated by tm-edit 7.105)
Content-Type: multipart/mixed;
 boundary="Multipart_Wed_Mar_12_20:45:41_1997-1"
Content-Transfer-Encoding: 7bit
From: David Moore <dmoore@ucsd.edu>
Date: 12 Mar 1997 20:45:41 -0800
Message-ID: <rv3eu01jt6.fsf@sdnp5.ucsd.edu>
Lines: 153
X-Mailer: Gnus v5.4.24/XEmacs 19.15

--Multipart_Wed_Mar_12_20:45:41_1997-1
Content-Type: text/plain; charset=US-ASCII


19.15b97 (with either the b98 event-stream.c or b99 event-stream.c)
solaris 2.5.1, xpm, gif, with -pg profiling enabled


I was using efs, and went to write a file, and got an `xxx seems not a
pty. Kill?' message.  One time I just hit C-g and killed the ftp buffer
manually, and kept things going fine.  Later, I tried 'y', and it dumped
core.  I think it made it past the killing.

Ok, I think I see the problem.  If CLASH_DETECTION is defined, then the
lock_file or unlock_file function may call a lisp hook (as in efs's
case).  However, the routine continues to use the variable `buf' after
that point without verifying that it's still alive.

So, what the heck.  Here's a patch against 19.15b98 and below that the
core traces for anyone else interested.


--Multipart_Wed_Mar_12_20:45:41_1997-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="buffer.diff"
Content-Transfer-Encoding: 7bit

--- buffer.c.orig	Wed Mar 12 20:40:38 1997
+++ buffer.c	Wed Mar 12 20:40:17 1997
@@ -996,6 +996,7 @@
      display).  We still need to make sure redisplay realizes that the
      contents have potentially altered and it needs to do some
      work. */
+  buf = decode_buffer(buffer, 0);
   BUF_MODIFF (buf)++;
   BUF_SAVE_MODIFF (buf) = NILP (flag) ? BUF_MODIFF (buf) : 0;
   MARK_MODELINE_CHANGED;



--Multipart_Wed_Mar_12_20:45:41_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="core.where"
Content-Transfer-Encoding: 7bit

#0  0x18ed50 in _kill ()
#1  <signal handler called>
#2  Fset_buffer_modified_p (flag=274350108, buffer=274350084) at buffer.c:999
#3  0x73034 in primitive_funcall (fn=0x5015c <Fset_buffer_modified_p>, 
    nargs=2, args=0xefffbd48) at eval.c:3457
#4  0x73248 in funcall_subr (subr=0x1c63b0, args=0xefffbd48) at eval.c:3481
#5  0x726ec in funcall_recording_as (recorded_as=270295984, nargs=1, 
    args=0xefffbe64) at eval.c:3170
#6  0x72844 in Ffuncall (nargs=2, args=0xefffbe64) at eval.c:3217
#7  0x537a4 in Fbyte_code (bytestr=818433948, vector=1086881728, 
    maxdepth=10930161) at bytecode.c:449
#8  0x7304c in primitive_funcall (fn=0x531f4 <Fbyte_code>, nargs=3, 
    args=0xefffc0e0) at eval.c:3458
#9  0x73248 in funcall_subr (subr=0x1c6988, args=0xefffc0e0) at eval.c:3481
#10 0x722d8 in Feval (form=549890140) at eval.c:3029
#11 0x6edcc in Fprogn (args=549890220) at eval.c:740
#12 0x701b4 in run_condition_case_handlers (val=547049596, var=274871548)
    at eval.c:1683
#13 0x70160 in condition_case_1 (handlers=549890204, bfun=0x71ca4 <Feval>, 
    barg=549904452, hfun=0x70168 <run_condition_case_handlers>, harg=274871548)
    at eval.c:1630
#14 0x702f8 in Fcondition_case_3 (bodyform=549904452, var=274871548, 
    handlers=549890204) at eval.c:1710
#15 0x53c20 in Fbyte_code (bytestr=818432868, vector=1086796800, 
    maxdepth=10929724) at bytecode.c:654
#16 0x7363c in funcall_lambda (fun=281255492, nargs=5, arg_vector=0xefffc724)
    at eval.c:3591
#17 0x727e4 in funcall_recording_as (recorded_as=281255492, nargs=5, 
    args=0xefffc720) at eval.c:3189
#18 0x72844 in Ffuncall (nargs=6, args=0xefffc720) at eval.c:3217
#19 0x72f8c in Fapply (nargs=4, args=0xefffc93c) at eval.c:3429
#20 0x72670 in funcall_recording_as (recorded_as=270309420, nargs=2, 
    args=0xefffc938) at eval.c:3156
#21 0x72844 in Ffuncall (nargs=3, args=0xefffc938) at eval.c:3217
#22 0x537a4 in Fbyte_code (bytestr=817858280, vector=1087002368, 
    maxdepth=11012087) at bytecode.c:449
#23 0x7363c in funcall_lambda (fun=281497956, nargs=6, arg_vector=0xefffcbec)
    at eval.c:3591
#24 0x727e4 in funcall_recording_as (recorded_as=281497956, nargs=6, 
    args=0xefffcbe8) at eval.c:3189
#25 0x72844 in Ffuncall (nargs=7, args=0xefffcbe8) at eval.c:3217
#26 0x73ee4 in call6 (fn=276341844, arg0=274439252, arg1=1, arg2=6654, 
    arg3=818185732, arg4=274350084, arg5=274350108) at eval.c:4026
#27 0x95120 in Fwrite_region_internal (start=1, end=6654, filename=818185732, 
    append=274350084, visit=274350108, lockname=815190704) at fileio.c:3380
#28 0x73200 in primitive_funcall (fn=0x94ec8 <Fwrite_region_internal>, 
    nargs=6, args=0xefffd084) at eval.c:3467
#29 0x73248 in funcall_subr (subr=0x1cb4cc, args=0xefffd084) at eval.c:3481
#30 0x72700 in funcall_recording_as (recorded_as=270316748, nargs=6, 
    args=0xefffd080) at eval.c:3173
#31 0x72844 in Ffuncall (nargs=7, args=0xefffd080) at eval.c:3217
#32 0x537a4 in Fbyte_code (bytestr=807606604, vector=1076042124, 
    maxdepth=2300258) at bytecode.c:449
#33 0x7363c in funcall_lambda (fun=270735788, nargs=6, arg_vector=0xefffd33c)
    at eval.c:3591
#34 0x727e4 in funcall_recording_as (recorded_as=270735788, nargs=6, 
    args=0xefffd338) at eval.c:3189
#35 0x72844 in Ffuncall (nargs=7, args=0xefffd338) at eval.c:3217
#36 0x537a4 in Fbyte_code (bytestr=807593872, vector=1076029380, 
    maxdepth=2287551) at bytecode.c:449
#37 0x7363c in funcall_lambda (fun=270723048, nargs=2, arg_vector=0xefffd5fc)
    at eval.c:3591
#38 0x727e4 in funcall_recording_as (recorded_as=270723048, nargs=2, 
    args=0xefffd5f8) at eval.c:3189
#39 0x72844 in Ffuncall (nargs=3, args=0xefffd5f8) at eval.c:3217
#40 0x537a4 in Fbyte_code (bytestr=807595244, vector=1076030940, 
    maxdepth=2289094) at bytecode.c:449
#41 0x7363c in funcall_lambda (fun=270725168, nargs=0, arg_vector=0xefffd8b4)
    at eval.c:3591
#42 0x727e4 in funcall_recording_as (recorded_as=270725168, nargs=0, 
    args=0xefffd8b0) at eval.c:3189
#43 0x72844 in Ffuncall (nargs=1, args=0xefffd8b0) at eval.c:3217
#44 0x537a4 in Fbyte_code (bytestr=807594304, vector=1076030044, 
    maxdepth=2288196) at bytecode.c:449
#45 0x7363c in funcall_lambda (fun=270724204, nargs=0, arg_vector=0xefffdb6c)
    at eval.c:3591
#46 0x727e4 in funcall_recording_as (recorded_as=270724204, nargs=0, 
    args=0xefffdb68) at eval.c:3189
#47 0x72844 in Ffuncall (nargs=1, args=0xefffdb68) at eval.c:3217
#48 0x537a4 in Fbyte_code (bytestr=807593272, vector=1076028808, 
    maxdepth=2286966) at bytecode.c:449
#49 0x7363c in funcall_lambda (fun=270722592, nargs=1, arg_vector=0xefffde1c)
    at eval.c:3591
#50 0x727e4 in funcall_recording_as (recorded_as=270722592, nargs=1, 
    args=0xefffde18) at eval.c:3189
#51 0x72844 in Ffuncall (nargs=2, args=0xefffde18) at eval.c:3217
#52 0x56014 in Fcall_interactively (function=274874292, record_flag=274350084, 
    keys=274350084) at callint.c:899
#53 0x71678 in Fcommand_execute (cmd=274874292, record=274350084, 
    keys=274350084) at eval.c:2594
#54 0x7f1e8 in execute_command_event (command_builder=0x5e6d00, 
    event=276488004) at event-stream.c:3573
#55 0x7f7f0 in Fdispatch_event (event=276488004) at event-stream.c:3866
#56 0x590b4 in Fcommand_loop_1 () at cmdloop.c:540
#57 0x58ed4 in command_loop_1 (dummy=274350084) at cmdloop.c:460
#58 0x7011c in condition_case_1 (handlers=274350180, 
    bfun=0x58ea4 <command_loop_1>, barg=274350084, hfun=0x587a4 <cmd_error>, 
    harg=274350084) at eval.c:1647
#59 0x588c4 in command_loop_3 () at cmdloop.c:222
#60 0x588f8 in command_loop_2 (dummy=274350084) at cmdloop.c:233
#61 0x6fd28 in internal_catch (tag=274427300, func=0x588e0 <command_loop_2>, 
    arg=274350084, threw=0x0) at eval.c:1324
#62 0x58b0c in initial_command_loop (load_me=362720) at cmdloop.c:271
#63 0x6d2ec in main_1 (argc=1, argv=0xefffe69c, envp=0xefffe6a4)
    at emacs.c:1411
#64 0x6da58 in main (argc=1, argv=0xefffe69c, envp=0xefffe6a4) at emacs.c:1767

--Multipart_Wed_Mar_12_20:45:41_1997-1--

