unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Hard bug caused by window management code?
@ 2013-03-27  6:11 Dmitry Antipov
  2013-03-27  7:07 ` Eli Zaretskii
  2013-03-27  7:23 ` martin rudalics
  0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Antipov @ 2013-03-27  6:11 UTC (permalink / raw)
  To: Emacs development discussions

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]

I'm trying to push some changes to window management code and now using a kind of
simple automated test stuff (attached), mostly to check whether the code doesn't
crash or trigger eassert. Results are totally unexpected - even with 24.3, running:

emacs -Q -l window-test.el -f window-test

causes 2.7G RSS and following OOM killer invocation for the Emacs process.

Can someone run this stuff and see what happens? (On MS-Windows or OSX, you
might want to look for test files somewhere else rather than in /etc).

Dmitry

[-- Attachment #2: window-test.el --]
[-- Type: text/plain, Size: 1188 bytes --]

;; Window random action test.

(defun random-entry (entries)
  (let ((size (length entries)))
    (if (= 1 size) (car entries)
      (nth (abs (% (random) (length entries))) entries))))

(defun window-test ()
  (interactive)
  (let ((conf (current-window-configuration))
	(file-list (directory-files "/etc" t "\\.conf$")))
    (while t
      (let ((action (abs (% (random) 11))))
	(cond ((zerop action)
	       (and (< 16 (window-height)) (split-window-vertically)))
	      ((= 1 action)
	       (and (< 16 (window-width)) (split-window-horizontally)))
	      ((= 2 action)
	       (and (< 1 (count-windows)) (delete-window)))
	      ((= 3 action)
	       (balance-windows))
	      ((= 4 action)
	       (delete-other-windows))
	      ((= 5 action)
	       (select-window (random-entry (window-list))))
	      ((= 6 action)
	       (let ((file (random-entry file-list)))
		 (and (file-readable-p file) (find-file file))))
	      ((= 7 action)
	       (kill-buffer))
	      ((= 8 action)
	       (setq conf (current-window-configuration)))
	      ((= 9 action)
	       (set-window-configuration conf))
	      ((= 10 action)
	       (mapcar 'kill-buffer (buffer-list))))
	(sit-for 0.2)))))

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-03-27 10:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-27  6:11 Hard bug caused by window management code? Dmitry Antipov
2013-03-27  7:07 ` Eli Zaretskii
2013-03-27  7:23 ` martin rudalics
2013-03-27  9:26   ` Dmitry Antipov
2013-03-27 10:02     ` martin rudalics
2013-03-27 10:39       ` Dmitry Antipov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).