Mercurial > hg > xemacs-beta
annotate tests/reproduce-bugs.el @ 4321:98e54edf3ab2
Resuscitate reproduce-bugs.el.
Add commentary.
Number unnumbered bugs.
Comment out keybinding.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Mon, 10 Dec 2007 00:57:19 -0800 |
parents | 3ecd8885ac67 |
children | f70e56bb52a7 |
rev | line source |
---|---|
428 | 1 ;;; reproduce-bugs.el --- reproduce bugs in XEmacs; |
2 | |
3 ;; Copyright (C) 1997 Free Software Foundation, Inc. | |
4 ;; Copyright (C) 1997 Sun Microsystems, Inc. | |
5 | |
6 ;; Keywords: bugs, crash, burn, die, croak, munge | |
7 | |
8 ;; This file is part of XEmacs. | |
9 | |
10 ;; This file is free software; you can redistribute it and/or modify it | |
11 ;; under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; XEmacs is distributed in the hope that it will be useful, but | |
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 ;; General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free | |
22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
23 ;; 02111-1307, USA. | |
24 | |
25 ;;; Synched up with: Not in FSF. | |
26 | |
27 ;;; Commentary: | |
28 | |
29 ;; Reproduce XEmacs bugs, so that they can get fixed. | |
30 ;; Especially, make XEmacs crash. | |
31 ;; You may need to use a debug version of XEmacs to reproduce some of these. | |
32 | |
33 ;; Several global keybindings are created, each of which exhibits a bug. | |
34 | |
35 ;; For XEmacs maintainers and other masochists. | |
36 | |
37 ;; It's a bad idea to rely on code in this file continuing to work in | |
38 ;; the same way. :-) | |
39 | |
4321
98e54edf3ab2
Resuscitate reproduce-bugs.el.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
428
diff
changeset
|
40 ;; #### This file should be cleaned up and renamed reproduce-crashes.el. |
98e54edf3ab2
Resuscitate reproduce-bugs.el.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
428
diff
changeset
|
41 ;; #### Bugs need docstrings. |
98e54edf3ab2
Resuscitate reproduce-bugs.el.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
428
diff
changeset
|
42 ;; #### Fixed bugs should become regression tests. |
98e54edf3ab2
Resuscitate reproduce-bugs.el.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
428
diff
changeset
|
43 |
428 | 44 ;;; Code: |
45 | |
46 (defvar bug-hashtable (make-hashtable 10)) | |
47 | |
48 (defmacro defbug (bug-number &rest body) | |
49 `(puthash ,bug-number (lambda () ,@body) bug-hashtable)) | |
50 | |
51 (put 'defbug 'lisp-indent-function 'defun) | |
52 | |
53 (defconst bug-buffer | |
54 (save-excursion | |
55 (set-buffer (get-buffer-create "*Bug*")) | |
56 (erase-buffer) | |
57 (current-buffer))) | |
58 | |
59 ;;;####autoload | |
60 (defun reproduce-bug (number) | |
61 "Reproduce XEmacs bugs, so that they can get fixed. | |
62 Especially, make XEmacs crash. | |
63 See reproduce-bugs.el for bug descriptions and bug numbers. | |
64 A debug version of XEmacs may be needed to reproduce some bugs." | |
65 (interactive "nBug Number: ") | |
66 (funcall (gethash number bug-hashtable))) | |
67 | |
68 ;;; Change this to your preferred key-binding | |
69 | |
4321
98e54edf3ab2
Resuscitate reproduce-bugs.el.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
428
diff
changeset
|
70 ;; (global-set-key [(control ?Z)] 'reproduce-bug) |
428 | 71 |
72 ;;;; Bugs follow: | |
73 | |
74 ;;; ------------------------------------------------------------------ | |
75 ;;; Crash on trace-function | |
76 ;;; Fatal error: assertion failed, file src/eval.c, line 1405, abort() | |
77 (defbug 1 | |
78 (trace-function 'record-buffer bug-buffer) | |
79 (pop-to-buffer bug-buffer)) | |
80 | |
81 | |
82 ;;; ------------------------------------------------------------------ | |
83 ;;; Crashes with stack overflow | |
84 ;;; Should give error via barf-if-buffer-read-only | |
85 ;;; Fatal error: assertion failed, file src/eval.c, line 1874, abort() | |
86 ;; This bug has been fixed. -sb | |
87 (defbug 2 | |
88 (switch-to-buffer bug-buffer) | |
89 ;; The following line should contain a number of eight-bit characters | |
90 (insert "²èÌÌËè¤Î°ÜÆ°¤Ï¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£º£Å٤ϡ¢²èÌ̤ÎÃæ¤Ç¡¢ÆÃÄê¤Î¾ì") | |
91 (setq buffer-read-only t) | |
92 (ignore-errors | |
93 (encode-coding-region (point-min) (point-max) 'euc-japan)) | |
94 (garbage-collect)) | |
95 | |
96 | |
97 ;;; ------------------------------------------------------------------ | |
98 ;;; Crashes in debug version only | |
99 ;;; Fatal error: assertion failed, file src/objects.h, line 149, | |
100 ;;; RECORD_TYPEP (_obj, lrecord_font_instance) || MARKED_RECORD_P (_obj) | |
101 (defbug 3 | |
102 (let (glyph ext) | |
103 (make-face 'adobe-symbol-face) | |
104 (set-face-font | |
105 'adobe-symbol-face | |
106 "-adobe-symbol-medium-r-normal--*-140-*-*-p-*-adobe-fontspecific") | |
107 (setq glyph (make-glyph (list (vector 'string | |
108 :data (char-to-string ?\xD3))))) | |
109 (set-glyph-face glyph 'adobe-symbol-face) | |
110 (setq ext (make-extent 14 18)) | |
111 (set-extent-property ext 'begin-glyph glyph))) | |
112 | |
113 | |
114 ;;; ------------------------------------------------------------------ | |
115 ;;; (maybe?) crash koi8 | |
116 ;;; ACCL: Invalid command (c) | |
117 ;;; With debugging on, crashes as follows: | |
118 ;;; Fatal error: assertion failed, file src/lisp.h, line 1227, INTP (obj) | |
119 (defbug 5 | |
120 ;;(load "cyrillic") | |
121 ;;(load "cyrillic-hooks") | |
122 (princ (decode-coding-string "\xe1" 'koi8))) | |
123 | |
124 | |
125 ;;; ------------------------------------------------------------------ | |
126 ;;; Completely Uninterruptible hang in re-search-backward (Was: java-mode) | |
127 (defbug 6 | |
128 (switch-to-buffer bug-buffer) | |
129 (insert "{ | |
130 public static void main(String[] args) throws java.io.IOException | |
131 { | |
132 } | |
133 } | |
134 ") | |
135 (goto-char (point-min)) | |
136 (search-forward "{" nil nil 2) | |
137 (backward-char) | |
138 (re-search-backward | |
139 "^\\s(\\|\\(^[ \t]*\\(\\(\\(public\\|protected\\|static\\)\\s-+\\)*\\(\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*[][_$.a-zA-Z0-9]+\\|[[a-zA-Z]\\)\\s-*\\)\\s-+\\)\\)?\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*\\s-+\\)\\s-*\\)?\\([_a-zA-Z][^][ \t:;.,{}()=]*\\|\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)\\)\\s-*\\(([^);{}]*)\\)?\\([] \t]*\\)\\(\\s-*\\<throws\\>\\s-*\\(\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)[, \t\n\r\f]*\\)+\\)?\\s-*\\)\\s(")) | |
140 | |
141 | |
142 ;;; ------------------------------------------------------------------ | |
143 ;;; regexp crash | |
144 ;; This doesn't crash for me. -sb | |
145 (defbug 7 | |
146 (string-match "\\(\\s-\\|$\\)" "å")) | |
147 | |
148 | |
149 ;;;; ------------------------------------------------------------------- | |
150 ;;;; Bugs below this line have been fixed. | |
151 ;;;; Keep these for regression testing | |
152 ;;;; ------------------------------------------------------------------- | |
153 | |
154 | |
155 ;;; ------------------------------------------------------------------ | |
156 ;;; Infinite recursion crash - Segmentation Fault | |
157 (defbug 4 | |
158 (switch-to-buffer bug-buffer) | |
159 (insert "abcdefg") | |
160 (setq e (make-extent 1 4)) | |
161 (set-extent-property e 'face 'bold) | |
162 (set-extent-property e 'duplicable t) | |
163 (set-extent-property e 'replicating t) | |
164 (insert (buffer-string)) | |
165 (delete-region 8 9)) | |
166 | |
167 (defbug 5 | |
168 (interactive) | |
169 (with-temp-buffer | |
170 (insert "abc") | |
171 (forward-char -1) | |
172 (subst-char-in-region 1 4 ?b ?\344) | |
173 (if (not (= (point) 3)) | |
174 (message "Bug! point should equal 3 but is %d" (point))))) | |
175 | |
176 ;;; crash popup frames FIXED | |
4321
98e54edf3ab2
Resuscitate reproduce-bugs.el.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
428
diff
changeset
|
177 ;; defbug 8 |
428 | 178 ;;(global-set-key |
179 ;; [(alt meta control f12)] | |
180 ;; (lambda () | |
181 ;; (interactive) | |
182 ;; (let ((f (selected-frame))) | |
183 ;; (make-frame `(popup ,(selected-frame))) | |
184 ;; (make-frame) | |
185 ;; (sit-for 0) | |
186 ;; (delete-frame f) | |
187 ;; (save-buffers-kill-emacs)))) | |
188 | |
189 ;;; crash on delete-frame-hook - FIXED! | |
4321
98e54edf3ab2
Resuscitate reproduce-bugs.el.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
428
diff
changeset
|
190 ;; defbug 9 |
428 | 191 ;;(global-set-key |
192 ;; [(alt meta control f10)] | |
193 ;; (lambda () | |
194 ;; (interactive) | |
195 ;; (setq delete-frame-hook | |
196 ;; (lambda (frame) | |
197 ;; (select-frame frame) | |
198 ;; (kill-buffer (window-buffer (frame-selected-window frame))))))) | |
199 | |
200 ;;; reproduce-bugs.el ends here |