1 ;;; reproduce-bugs.el --- reproduce bugs in SXEmacs;
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
4 ;; Copyright (C) 1997 Sun Microsystems, Inc.
6 ;; Keywords: bugs, crash, burn, die, croak, munge
8 ;; This file is part of SXEmacs.
10 ;; SXEmacs is free software: you can redistribute it and/or modify it
11 ;; under the terms of the GNU General Public License as published by the
12 ;; Free Software Foundation, either version 3 of the License, or (at your
13 ;; option) any later version.
15 ;; SXEmacs is distributed in the hope that it will be
16 ;; useful, but 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.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
23 ;;; Synched up with: Not in FSF.
27 ;; Reproduce XEmacs bugs, so that they can get fixed.
28 ;; Especially, make XEmacs crash.
29 ;; You may need to use a debug version of XEmacs to reproduce some of these.
31 ;; Several global keybindings are created, each of which exhibits a bug.
33 ;; For XEmacs maintainers and other masochists.
35 ;; It's a bad idea to rely on code in this file continuing to work in
40 (defvar bug-hashtable (make-hashtable 10))
42 (defmacro defbug (bug-number &rest body)
43 `(puthash ,bug-number (lambda () ,@body) bug-hashtable))
45 (put 'defbug 'lisp-indent-function 'defun)
49 (set-buffer (get-buffer-create "*Bug*"))
54 (defun reproduce-bug (number)
55 "Reproduce XEmacs bugs, so that they can get fixed.
56 Especially, make XEmacs crash.
57 See reproduce-bugs.el for bug descriptions and bug numbers.
58 A debug version of XEmacs may be needed to reproduce some bugs."
59 (interactive "nBug Number: ")
60 (funcall (gethash number bug-hashtable)))
62 ;;; Change this to your preferred key-binding
64 (global-set-key [(control ?Z)] 'reproduce-bug)
68 ;;; ------------------------------------------------------------------
69 ;;; Crash on trace-function
70 ;;; Fatal error: assertion failed, file src/eval.c, line 1405, abort()
72 (trace-function 'record-buffer bug-buffer)
73 (pop-to-buffer bug-buffer))
76 ;;; ------------------------------------------------------------------
77 ;;; Crashes with stack overflow
78 ;;; Should give error via barf-if-buffer-read-only
79 ;;; Fatal error: assertion failed, file src/eval.c, line 1874, abort()
80 ;; This bug has been fixed. -sb
82 (switch-to-buffer bug-buffer)
83 ;; The following line should contain a number of eight-bit characters
84 (insert "²èÌÌËè¤Î°ÜÆ°¤Ï¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£º£Å٤ϡ¢²èÌ̤ÎÃæ¤Ç¡¢ÆÃÄê¤Î¾ì")
85 (setq buffer-read-only t)
87 (encode-coding-region (point-min) (point-max) 'euc-japan))
91 ;;; ------------------------------------------------------------------
92 ;;; Crashes in debug version only
93 ;;; Fatal error: assertion failed, file src/objects.h, line 149,
94 ;;; RECORD_TYPEP (_obj, lrecord_font_instance) || MARKED_RECORD_P (_obj)
97 (make-face 'adobe-symbol-face)
100 "-adobe-symbol-medium-r-normal--*-140-*-*-p-*-adobe-fontspecific")
101 (setq glyph (make-glyph (list (vector 'string
102 :data (char-to-string ?\xD3)))))
103 (set-glyph-face glyph 'adobe-symbol-face)
104 (setq ext (make-extent 14 18))
105 (set-extent-property ext 'begin-glyph glyph)))
108 ;;; ------------------------------------------------------------------
109 ;;; (maybe?) crash koi8
110 ;;; ACCL: Invalid command (c)
111 ;;; With debugging on, crashes as follows:
112 ;;; Fatal error: assertion failed, file src/lisp.h, line 1227, INTP (obj)
115 ;;(load "cyrillic-hooks")
116 (princ (decode-coding-string "\xe1" 'koi8)))
119 ;;; ------------------------------------------------------------------
120 ;;; Completely Uninterruptible hang in re-search-backward (Was: java-mode)
122 (switch-to-buffer bug-buffer)
124 public static void main(String[] args) throws java.io.IOException
129 (goto-char (point-min))
130 (search-forward "{" nil nil 2)
133 "^\\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:;.,{}()
\7f=]*\\|\\([_$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("))
136 ;;; ------------------------------------------------------------------
138 ;; This doesn't crash for me. -sb
140 (string-match "\\(\\s-\\|$\\)" "å"))
143 ;;;; -------------------------------------------------------------------
144 ;;;; Bugs below this line have been fixed.
145 ;;;; Keep these for regression testing
146 ;;;; -------------------------------------------------------------------
149 ;;; ------------------------------------------------------------------
150 ;;; Infinite recursion crash - Segmentation Fault
152 (switch-to-buffer bug-buffer)
154 (setq e (make-extent 1 4))
155 (set-extent-property e 'face 'bold)
156 (set-extent-property e 'duplicable t)
157 (set-extent-property e 'replicating t)
158 (insert (buffer-string))
166 (subst-char-in-region 1 4 ?b ?\344)
167 (if (not (= (point) 3))
168 (message "Bug! point should equal 3 but is %d" (point)))))
170 ;;; crash popup frames FIXED
172 ;; [(alt meta control f12)]
175 ;; (let ((f (selected-frame)))
176 ;; (make-frame `(popup ,(selected-frame)))
180 ;; (save-buffers-kill-emacs))))
182 ;;; crash on delete-frame-hook - FIXED!
184 ;; [(alt meta control f10)]
187 ;; (setq delete-frame-hook
189 ;; (select-frame frame)
190 ;; (kill-buffer (window-buffer (frame-selected-window frame)))))))
192 ;;; reproduce-bugs.el ends here