From: Chong Yidong <cyd@stupidchicken.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Emacs 23.1.93 pretest
Date: Sat, 27 Feb 2010 20:45:45 -0500 [thread overview]
Message-ID: <87mxyuyvxy.fsf@stupidchicken.com> (raw)
In-Reply-To: <83eik6co9l.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 28 Feb 2010 00:22:30 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
>> Hmm, this is strange. This change (actually the succeeding 2010-02-06
>> change to the same place) switches from using alloca to SAFE_ALLOCA
>> (i.e. malloc, since the desired structure is large). But the only way I
>> can see for this code to crash is if load_charset_map somehow makes a
>> pointer into the allocated structure. But in that case, the old alloca
>> case should have crashed too.
>
> Yes, it _is_ weird. But the effect (see below) does look like we are
> freeing memory being used, or maybe overwriting some allocated buffer,
> or in some other way thrashing the arena.
Hmm, I think I may see the problem. Does this patch help?
=== modified file 'src/charset.c'
*** src/charset.c 2010-02-06 13:23:33 +0000
--- src/charset.c 2010-02-28 01:45:17 +0000
***************
*** 530,535 ****
--- 530,536 ----
large (larger than MAX_ALLOCA). */
SAFE_ALLOCA (head, struct charset_map_entries *,
sizeof (struct charset_map_entries));
+ bzero (head, sizeof (struct charset_map_entries));
entries = head;
n_entries = 0;
***************
*** 556,561 ****
--- 557,563 ----
{
SAFE_ALLOCA (entries->next, struct charset_map_entries *,
sizeof (struct charset_map_entries));
+ bzero (entries->next, sizeof (struct charset_map_entries));
entries = entries->next;
}
idx = n_entries % 0x10000;
***************
*** 595,600 ****
--- 597,603 ----
large (larger than MAX_ALLOCA). */
SAFE_ALLOCA (head, struct charset_map_entries *,
sizeof (struct charset_map_entries));
+ bzero (head, sizeof (struct charset_map_entries));
entries = head;
n_entries = 0;
***************
*** 631,636 ****
--- 634,640 ----
{
SAFE_ALLOCA (entries->next, struct charset_map_entries *,
sizeof (struct charset_map_entries));
+ bzero (entries->next, sizeof (struct charset_map_entries));
entries = entries->next;
}
idx = n_entries % 0x10000;
next prev parent reply other threads:[~2010-02-28 1:45 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-27 3:40 Emacs 23.1.93 pretest Chong Yidong
2010-02-27 9:05 ` Eli Zaretskii
2010-02-27 10:21 ` Eli Zaretskii
2010-02-27 11:28 ` Juanma Barranquero
2010-02-27 12:11 ` Juanma Barranquero
2010-02-27 13:15 ` Eli Zaretskii
2010-02-27 14:14 ` Eli Zaretskii
2010-02-27 14:31 ` Andreas Schwab
2010-02-27 14:54 ` Eli Zaretskii
2010-02-27 14:59 ` Lennart Borgman
2010-02-27 15:29 ` Eli Zaretskii
2010-02-27 15:22 ` Chong Yidong
2010-02-27 18:58 ` Eli Zaretskii
2010-03-04 11:32 ` Kenichi Handa
2010-03-04 12:35 ` Jason Rumney
2010-02-27 15:39 ` Juanma Barranquero
2010-02-27 19:41 ` Stefan Monnier
2010-02-27 11:57 ` Eli Zaretskii
2010-02-27 19:03 ` Eli Zaretskii
2010-02-27 21:37 ` Chong Yidong
2010-02-27 22:22 ` Eli Zaretskii
2010-02-28 1:25 ` Chong Yidong
2010-02-28 17:21 ` Eli Zaretskii
2010-02-28 1:45 ` Chong Yidong [this message]
2010-02-28 10:46 ` Andreas Schwab
2010-02-28 14:25 ` Chong Yidong
2010-02-28 15:38 ` Andreas Schwab
2010-02-28 17:32 ` Eli Zaretskii
2010-02-28 19:31 ` Eli Zaretskii
2010-03-02 18:15 ` Eli Zaretskii
2010-03-02 19:53 ` Chong Yidong
2010-03-02 20:53 ` Eli Zaretskii
2010-03-04 11:24 ` Kenichi Handa
2010-02-28 17:34 ` Eli Zaretskii
2010-02-28 21:34 ` Chong Yidong
2010-02-28 17:15 ` Eli Zaretskii
2010-03-02 15:42 ` Drew Adams
2010-03-02 16:02 ` Chong Yidong
2010-03-02 18:35 ` Drew Adams
2010-03-02 19:53 ` Chong Yidong
2010-03-04 14:36 ` bug#5679: " Sergei Organov
2010-03-04 15:57 ` Chong Yidong
2010-03-04 17:43 ` osv
2010-03-04 18:06 ` Chong Yidong
2010-03-04 19:22 ` osv
2010-03-09 0:05 ` YAMAMOTO Mitsuharu
2010-03-09 9:57 ` osv
2010-03-09 11:30 ` osv
2010-03-10 11:19 ` YAMAMOTO Mitsuharu
2010-03-10 11:29 ` osv
2010-03-10 11:54 ` YAMAMOTO Mitsuharu
2010-03-10 12:12 ` osv
2010-03-11 0:38 ` YAMAMOTO Mitsuharu
2010-03-10 6:23 ` YAMAMOTO Mitsuharu
2010-03-10 10:05 ` osv
-- strict thread matches above, loose matches on Subject: below --
2010-04-03 1:13 Chong Yidong
2010-04-03 1:34 ` Juanma Barranquero
2010-04-03 2:36 ` Chong Yidong
2010-04-03 2:38 ` Juanma Barranquero
2010-04-03 9:33 ` Eli Zaretskii
2010-04-03 12:45 ` Sean Sieger
2010-04-03 13:53 ` Eli Zaretskii
2010-04-03 15:06 ` Chong Yidong
2010-04-03 15:52 ` Eli Zaretskii
2010-04-03 1:45 ` Sean Sieger
2010-04-03 7:01 ` Eli Zaretskii
2010-04-03 8:26 ` Eli Zaretskii
2010-04-04 19:22 ` Drew Adams
2010-04-05 0:48 ` Sean Sieger
2010-04-11 18:30 ` Uwe Siart
2010-04-11 18:34 ` Uwe Siart
2010-04-05 9:33 ` Eduard Wiebe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mxyuyvxy.fsf@stupidchicken.com \
--to=cyd@stupidchicken.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.