From rms@gnu.ai.mit.edu  Fri Sep 13 16:27:19 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Fri" "13" "September" "1996" "19:25:43" "-0400" "Richard Stallman" "rms@gnu.ai.mit.edu" nil "179" "[sasdjb@unx.sas.com: NT Emacs 19.34 crashes in old compiled .elc]" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from ethanol.gnu.ai.mit.edu (ethanol.gnu.ai.mit.edu [128.52.46.64]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id QAA28324 for <voelker@cs.washington.edu>; Fri, 13 Sep 1996 16:27:17 -0700
Received: by ethanol.gnu.ai.mit.edu (8.6.12/8.6.12GNU) id TAA31580; Fri, 13 Sep 1996 19:25:43 -0400
Message-Id: <199609132325.TAA31580@ethanol.gnu.ai.mit.edu>
From: Richard Stallman <rms@gnu.ai.mit.edu>
To: voelker@cs.washington.edu, andrewi@harlequin.co.uk
Subject: [sasdjb@unx.sas.com: NT Emacs 19.34 crashes in old compiled .elc]
Date: Fri, 13 Sep 1996 19:25:43 -0400

I can't reproduce this--can you?

------- Start of forwarded message -------
Newsgroups: gnu.emacs.bug
Path: news
From: sasdjb@unx.sas.com (David Biesack)
Subject: NT Emacs 19.34 crashes in old compiled .elc
Originator: sasdjb@mozart.unx.sas.com
Sender: news@unx.sas.com (Noter of Newsworthy Events)
Date: Fri, 13 Sep 1996 19:37:25 GMT
Distribution: local
X-Nntp-Posting-Host: mozart.unx.sas.com
Organization: SAS Institute Inc.
Lines: 162
Apparently-To: gnu-emacs-bug%uunet.uucp@mcnc.org


GNU Emacs 19.34.1 (i386-*-nt4.0)of Thu Aug 29 1996 
from the cs.washington.edu build.

I have a relatively old compiled .elc file
- -rw-r--r--   1 sasdjb   root        2447 Sep 14  1992 buffer-search.el
which was compiled from Emacs 18.58. Loading this and executing its
M-x buffer-search-regexp in 19.34 on Windows NT 4.0 (final)
causes GNU Emacs to crash. I'm rnning on a 64MB Dell Optiplex GXPro
200 Pentium Pro.

Here is the .el code:

(defvar next-buffer-list nil
  "List of files for next-buffer to process.")

(defun next-buffer (&optional initialize)
  "Select next buffer among files in current buffer list.
Non-nil argument (prefix arg, if interactive)
initializes to the beginning of the list of files in the buffer list."
  (interactive "P")
  (if initialize
      (setq next-buffer-list (buffer-list)))
  (or next-buffer-list
      (error "All files processed."))
  (switch-to-buffer (car next-buffer-list))
  (setq next-buffer-list (cdr next-buffer-list)))

(defvar buffer-loop-form nil
  "Form for buffer-loop-continue to eval to process one file.
If it returns nil, it is through with one file; move on to next.")

(defun buffer-loop-continue (&optional first-time)
  "Continue last \\[buffer-search-regexp] or \\[buffer-query-replace] command.
Used noninteractively with non-nil argument
to begin such a command.  See variable buffer-loop-form."
  (interactive)
  (if first-time
      (progn (next-buffer t)
	     (goto-char (point-min))))
  (while (not (eval buffer-loop-form))
    (next-buffer)
    (message "Scanning file %s..." buffer-file-name)
    (goto-char (point-min)))
  (if (get-buffer-window (current-buffer))
      (select-window (get-buffer-window (current-buffer)))
      (switch-to-buffer (current-buffer))))

(defun buffer-search-regexp (regexp)
  "Search through all files listed in buffer list for match for REGEXP.
Stops when a match is found.
To continue searching for next match, use command \\[buffer-loop-continue]."
  (interactive "sBuffer search (regexp): ")
  (if (and (equal regexp "")
	   (eq (car buffer-loop-form) 're-search-forward))
      (buffer-loop-continue nil)
    (setq buffer-loop-form
	  (list 're-search-forward regexp nil t))
    (buffer-loop-continue t)))

(defun buffer-query-replace (from to &optional delimited)
  "query-replace-regexp FROM with TO through all files listed in buffer list.
Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
If you exit (C-G or ESC), you can resume the query-replace
with the command \\[buffer-loop-continue].

See documentation of variable buffer-file-name."
  (interactive "sBuffer query replace (regexp): \nsBuffer query replace %s by: \nP")
  (setq buffer-loop-form
	(list 'and (list 'save-excursion
			 (list 're-search-forward from nil t))
	      (list 'not (list 'perform-replace from to t t 
			       (not (null delimited))))))
  (buffer-loop-continue t))

8<------8<------8<------8<------8<------8<------8<------8<------8<------

Here is the uuencoded .elc code, which you can also
recreate by compiling the above on GNU Emacs 18.58

begin 644 buffer-search.elc
M*&1E9G9A<B!N97AT+6)U9F9E<BUL:7-T(&YI;"`B7`I,:7-T(&]F(&9I;&5S
M(&9O<B!N97AT+6)U9F9E<B!T;R!P<F]C97-S+B(I"@HH9&5F=6X@;F5X="UB
M=69F97(@*"9O<'1I;VYA;"!I;FET:6%L:7IE*2`B7`I396QE8W0@;F5X="!B
M=69F97(@86UO;F<@9FEL97,@:6X@8W5R<F5N="!B=69F97(@;&ES="X*3F]N
M+6YI;"!A<F=U;65N="`H<')E9FEX(&%R9RP@:68@:6YT97)A8W1I=F4I"FEN
M:71I86QI>F5S('1O('1H92!B96=I;FYI;F<@;V8@=&AE(&QI<W0@;V8@9FEL
M97,@:6X@=&AE(&)U9F9E<B!L:7-T+B(@*&EN=&5R86-T:79E(")0(BD@*&)Y
M=&4M8V]D92`BPH@(A0H`PR")$8@)AA(`Q,4AB,8)0"&("4&)$8<B(%MI;FET
M:6%L:7IE(&YE>'0M8G5F9F5R+6QI<W0@;FEL(&)U9F9E<BUL:7-T(&5R<F]R
M(")!;&P@9FEL97,@<')O8V5S<V5D+B(@<W=I=&-H+71O+6)U9F9E<ET@-2DI
M"@HH9&5F=F%R(&)U9F9E<BUL;V]P+69O<FT@;FEL(")<"D9O<FT@9F]R(&)U
M9F9E<BUL;V]P+6-O;G1I;G5E('1O(&5V86P@=&\@<')O8V5S<R!O;F4@9FEL
M92X*268@:70@<F5T=7)N<R!N:6PL(&ET(&ES('1H<F]U9V@@=VET:"!O;F4@
M9FEL93L@;6]V92!O;B!T;R!N97AT+B(I"@HH9&5F=6X@8G5F9F5R+6QO;W`M
M8V]N=&EN=64@*"9O<'1I;VYA;"!F:7)S="UT:6UE*2`B7`I#;VYT:6YU92!L
M87-T(%Q<6V)U9F9E<BUS96%R8V@M<F5G97AP72!O<B!<7%MB=69F97(M<75E
M<GDM<F5P;&%C95T@8V]M;6%N9"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!L86-E+7)E9V5X<"!&4D]-('=I=&@@5$\@=&AR;W5G:"!A
M;&P@9FEL97,@;&ES=&5D(&EN(&)U9F9E<B!L:7-T+@I4:&ER9"!A<F<@1$5,
M24U)5$5$("AP<F5F:7@@87)G*2!M96%N<R!R97!L86-E(&]N;'D@=V]R9"UD
M96QI;6ET960@;6%T8VAE<RX*268@>6]U(&5X:70@*$,M1R!O<B!%4T,I+"!Y
M;W4@8V%N(')E<W5M92!T:&4@<75E<GDM<F5P;&%C90IW:71H('1H92!C;VUM
M86YD(%Q<6V)U9F9E<BUL;V]P+6-O;G1I;G5E72X*"E-E92!D;V-U;65N=&%T
M:6]N(&]F('9A<FEA8FQE(&)U9F9E<BUF:6QE+6YA;64N(B`H:6YT97)A8W1I
M=F4@(G-"=69F97(@<75E<GD@<F5P;&%C92`H<F5G97AP*3H@"G-"=69F97(@
M<75E<GD@<F5P;&%C92`E<R!B>3H@"E`B*2`H8GET92UC;V1E("+"B,;'R`G"
MPT9$R<K+"0S#PPT_/R8&1$6)$(C,PR&'(B!;8G5F9F5R+6QO;W`M9F]R;2!F
M<F]M(&YI;"!T('1O(&1E;&EM:71E9"!A;F0@<V%V92UE>&-U<G-I;VX@<F4M
M<V5A<F-H+69O<G=A<F0@;F]T(&QI<W0@<&5R9F]R;2UR97!L86-E(&)U9F9E
6<BUL;V]P+6-O;G1I;G5E72`Q,"DI"G0@
`
end

8<------8<------8<------8<------8<------8<------8<------8<------8<------

Steps to reproduce:

    put the .el code in a file, C:\temp\bug.el
    put the .elc code in a file, C:\temp\bug.elc
    start emacs 19.34 (via runemacs.exe)
    C-x C-f C:\temp\bug.el
    M-x load-file C:\temp\bug.elc
    M-x buffer-search-regexp defvar ret

Emacs crashes; you get a dialog:

    The instruction at 0x1014e2cf referenced memory at 0xfe2169a9
    The memory could not be "read"

Recompiling the .el file with (setq byte-compile-compatibility t)
solves the problem ... 19.34 loads/executes the new .elc 
(which is quite a bit different) fine. So, this is a pretty
low priority... Are there known problems with the byte code
interpreter handling older byte codes?

I know both the old and the new .elc run fine on:
   GNU Emacs 19.32.1 (hppa1.1-hp-hpux9shr) of Fri Aug  2 1996 on cpusrv04
but I don't have 19.32 on NT or 19.34 on HP/UX to determine
when/where the problem started.

- -- 
David J. Biesack                                    sasdjb@unx.sas.com
Object Programming Technology                  (919) 677-8000 ext 7771
SAS Institute Inc. SAS Campus Drive Cary, NC 27513  http://www.sas.com
------- End of forwarded message -------

