From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: define-prefix-command with a name, pressing key sequence bound to it results in memory corruption Date: Sat, 25 Oct 2008 15:02:26 -0400 Message-ID: <87ljwcsdkt.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1224961385 10679 80.91.229.12 (25 Oct 2008 19:03:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Oct 2008 19:03:05 +0000 (UTC) Cc: 1245@emacsbugs.donarmstrong.com To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 25 21:03:37 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KtoQD-0006I2-6u for ged-emacs-devel@m.gmane.org; Sat, 25 Oct 2008 21:03:37 +0200 Original-Received: from localhost ([127.0.0.1]:33194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KtoP7-0005Mu-5j for ged-emacs-devel@m.gmane.org; Sat, 25 Oct 2008 15:02:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KtoP3-0005L5-BF for emacs-devel@gnu.org; Sat, 25 Oct 2008 15:02:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KtoP1-0005Jd-KT for emacs-devel@gnu.org; Sat, 25 Oct 2008 15:02:24 -0400 Original-Received: from [199.232.76.173] (port=37172 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KtoP1-0005JY-Hk for emacs-devel@gnu.org; Sat, 25 Oct 2008 15:02:23 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]:46333) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KtoP1-0002gQ-0w for emacs-devel@gnu.org; Sat, 25 Oct 2008 15:02:23 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 5A50B57E1BA; Sat, 25 Oct 2008 15:02:26 -0400 (EDT) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:105005 > I have trimmed my .emacs to: > > (define-prefix-command 'my-nice-map nil "cOnfigure, Compile, Make, make tEsts, run Tests, trY build, Install, sVn, ctaGs, cscoPe") > (define-key my-nice-map "c" 'compile) > (global-set-key [(meta ?m)] 'my-nice-map) > > Sometimes, when pressing my key sequence (meta-m) for the prefix > command, emacs crashes. Sometimes it crashes on the second key > (e.g. the 'c' following the meta-m). I have also tried with (control > ?.). I can reproduce this. It's strange that realloc fails. If you replacing the xrealloc in enlarge_buffer_text with xmalloc/bcopy/xfree, Emacs crashes at the call to malloc. Anyone have an idea what causes this? #0 0x00110402 in __kernel_vsyscall () #1 0x0049e690 in raise () from /lib/libc.so.6 #2 0x0049ff91 in abort () from /lib/libc.so.6 #3 0x004d69eb in __libc_message () from /lib/libc.so.6 #4 0x004df253 in _int_malloc () from /lib/libc.so.6 #5 0x004e0472 in _int_realloc () from /lib/libc.so.6 #6 0x004e23f7 in realloc () from /lib/libc.so.6 #7 0x0814784d in xrealloc (block=0x0, size=2090) at alloc.c:786 #8 0x0810ef21 in enlarge_buffer_text (b=0x8c2df98, delta=2069) at buffer.c:5067 #9 0x08118a45 in make_gap_larger (nbytes_added=69) at insdel.c:526 #10 0x08119db0 in insert_1_both ( string=0x8966798 "cOnfigure, Compile, Make, make tEsts, run Tests, trY build, Install, sVn, ctaGs, cscoPe: ", nchars=89, nbytes=89, inherit=1, prepare=0, before_markers=0) at insdel.c:978