1 ;;; reproduce-bugs.el --- reproduce bugs in XEmacs;
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 XEmacs.
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)
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.
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
25 ;;; Synched up with: Not in FSF.
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.
33 ;; Several global keybindings are created, each of which exhibits a bug.
35 ;; For XEmacs maintainers and other masochists.
37 ;; It's a bad idea to rely on code in this file continuing to work in
42 (defvar bug-hashtable (make-hashtable 10))
44 (defmacro defbug (bug-number &rest body)
45 `(puthash ,bug-number (lambda () ,@body) bug-hashtable))
47 (put 'defbug 'lisp-indent-function 'defun)
51 (set-buffer (get-buffer-create "*Bug*"))
56 (defun reproduce-bug (number)
57 "Reproduce XEmacs bugs, so that they can get fixed.
58 Especially, make XEmacs crash.
59 See reproduce-bugs.el for bug descriptions and bug numbers.
60 A debug version of XEmacs may be needed to reproduce some bugs."
61 (interactive "nBug Number: ")
62 (funcall (gethash number bug-hashtable)))
64 ;;; Change this to your preferred key-binding
66 (global-set-key [(control ?Z)] 'reproduce-bug)
70 ;;; ------------------------------------------------------------------
71 ;;; Crash on trace-function
72 ;;; Fatal error: assertion failed, file src/eval.c, line 1405, abort()
74 (trace-function 'record-buffer bug-buffer)
75 (pop-to-buffer bug-buffer))
78 ;;; ------------------------------------------------------------------
79 ;;; Crashes with stack overflow
80 ;;; Should give error via barf-if-buffer-read-only
81 ;;; Fatal error: assertion failed, file src/eval.c, line 1874, abort()
82 ;; This bug has been fixed. -sb
84 (switch-to-buffer bug-buffer)
85 ;; The following line should contain a number of eight-bit characters
86 (insert "²èÌÌËè¤Î°ÜÆ°¤Ï¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£º£Å٤ϡ¢²èÌ̤ÎÃæ¤Ç¡¢ÆÃÄê¤Î¾ì")
87 (setq buffer-read-only t)
89 (encode-coding-region (point-min) (point-max) 'euc-japan))
93 ;;; ------------------------------------------------------------------
94 ;;; Crashes in debug version only
95 ;;; Fatal error: assertion failed, file src/objects.h, line 149,
96 ;;; RECORD_TYPEP (_obj, lrecord_font_instance) || MARKED_RECORD_P (_obj)
99 (make-face 'adobe-symbol-face)
102 "-adobe-symbol-medium-r-normal--*-140-*-*-p-*-adobe-fontspecific")
103 (setq glyph (make-glyph (list (vector 'string
104 :data (char-to-string ?\xD3)))))
105 (set-glyph-face glyph 'adobe-symbol-face)
106 (setq ext (make-extent 14 18))
107 (set-extent-property ext 'begin-glyph glyph)))
110 ;;; ------------------------------------------------------------------
111 ;;; (maybe?) crash koi8
112 ;;; ACCL: Invalid command (c)
113 ;;; With debugging on, crashes as follows:
114 ;;; Fatal error: assertion failed, file src/lisp.h, line 1227, INTP (obj)
117 ;;(load "cyrillic-hooks")
118 (princ (decode-coding-string "\xe1" 'koi8)))
121 ;;; ------------------------------------------------------------------
122 ;;; Completely Uninterruptible hang in re-search-backward (Was: java-mode)
124 (switch-to-buffer bug-buffer)
126 public static void main(String[] args) throws java.io.IOException
131 (goto-char (point-min))
132 (search-forward "{" nil nil 2)
135 "^\\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("))
138 ;;; ------------------------------------------------------------------
140 ;; This doesn't crash for me. -sb
142 (string-match "\\(\\s-\\|$\\)" "å"))
145 ;;;; -------------------------------------------------------------------
146 ;;;; Bugs below this line have been fixed.
147 ;;;; Keep these for regression testing
148 ;;;; -------------------------------------------------------------------
151 ;;; ------------------------------------------------------------------
152 ;;; Infinite recursion crash - Segmentation Fault
154 (switch-to-buffer bug-buffer)
156 (setq e (make-extent 1 4))
157 (set-extent-property e 'face 'bold)
158 (set-extent-property e 'duplicable t)
159 (set-extent-property e 'replicating t)
160 (insert (buffer-string))
168 (subst-char-in-region 1 4 ?b ?\344)
169 (if (not (= (point) 3))
170 (message "Bug! point should equal 3 but is %d" (point)))))
172 ;;; crash popup frames FIXED
174 ;; [(alt meta control f12)]
177 ;; (let ((f (selected-frame)))
178 ;; (make-frame `(popup ,(selected-frame)))
182 ;; (save-buffers-kill-emacs))))
184 ;;; crash on delete-frame-hook - FIXED!
186 ;; [(alt meta control f10)]
189 ;; (setq delete-frame-hook
191 ;; (select-frame frame)
192 ;; (kill-buffer (window-buffer (frame-selected-window frame)))))))
194 ;;; reproduce-bugs.el ends here