all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Barry OReilly <gundaetiapo@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: stephen.berman@gmx.net, 15405@debbugs.gnu.org,
	Leo Liu <sdl.web@gmail.com>
Subject: bug#15405: 24.3; #[] freezes emacs
Date: Fri, 20 Sep 2013 11:33:13 -0400	[thread overview]
Message-ID: <CAFM41H33ugGPQeX_6HSaJkUUpCY3ARCBx_2QDeyLaPiCptfNPw@mail.gmail.com> (raw)
In-Reply-To: <83ob7pmh28.fsf@gnu.org>

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

Here's what happens:
   - read1 reads the #[] and proceeds to create a vector of zero
     length
   - allocate_vectorlike has a special case for zero length vectors:
       if (len == 0)
         p = XVECTOR (zero_vector);
   - zero_vector is a global variable, so all zero length vectors
     point to it. This can be seen when evalling:
       (eq [] []) ; Evalutes to t
       (eq [1 2 3] [1 2 3]) ; Evaluates to nil
   - After read1 creates the zero_vector, it sets bits in the size
     field to indicate it is a PVEC_COMPILED pseudo vector
   - The global zero_vector is thereafter a PVEC_COMPILED pseudo
     vector, including the empty vector of the font data
   - Later, the font_list_entities function checks the size of the
     font data vector using ASIZE. It does not expect a pseudo vector,
     so it makes no such checks.
   - Because the pseudo vector bits are set, the size is very large
   - Indexing too far into the font data vector results in a core dump

What should the behavior be? Perhaps (eval #[]) should evaluate to []
instead of #[]?

Maybe an eassert in font_list_entities that its vector is not a pseudo
vector couldn't hurt either?

[-- Attachment #2: Type: text/html, Size: 1287 bytes --]

  reply	other threads:[~2013-09-20 15:33 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18  1:50 bug#15405: 24.3; #[] freezes emacs Leo Liu
2013-09-18  7:23 ` Andreas Schwab
2013-09-18 14:36 ` Barry OReilly
2013-09-18 15:07   ` Eli Zaretskii
2013-09-18 15:14     ` Barry OReilly
2013-09-18 15:27       ` Eli Zaretskii
2013-09-18 15:41         ` Stephen Berman
2013-09-18 16:26           ` Eli Zaretskii
2013-09-18 17:31             ` Barry OReilly
2013-09-18 19:26               ` Eli Zaretskii
2013-09-18 23:20                 ` Barry OReilly
2013-09-19  7:00                   ` Eli Zaretskii
2013-09-20 15:33                     ` Barry OReilly [this message]
2013-09-20 16:13                       ` Barry OReilly
2013-09-20 16:21                         ` Drew Adams
2013-09-20 19:09                       ` Stefan Monnier
2013-09-20 19:43                         ` Barry OReilly
2013-09-20 21:26                           ` Stefan Monnier
2013-09-20 21:38                             ` Barry OReilly
2013-09-21  1:28                               ` Dmitry Antipov
2013-09-21  1:39                                 ` Dmitry Antipov
2013-09-21  2:51                                 ` Stefan Monnier
2013-09-25 15:22                                   ` Barry OReilly
2013-09-25 16:12                                     ` Dmitry Antipov
2013-09-25 17:35                                       ` Stefan Monnier
2013-09-25 19:09                                         ` Barry OReilly
2013-09-25 21:50                                           ` Dmitry Antipov
2013-09-26  1:15                                           ` Stefan Monnier
2013-09-26  3:51                                             ` Barry OReilly
2013-09-25 17:10                                     ` Stefan Monnier
2013-09-18 23:41                 ` Barry OReilly
2013-09-18 17:57             ` Stephen Berman

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=CAFM41H33ugGPQeX_6HSaJkUUpCY3ARCBx_2QDeyLaPiCptfNPw@mail.gmail.com \
    --to=gundaetiapo@gmail.com \
    --cc=15405@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=sdl.web@gmail.com \
    --cc=stephen.berman@gmx.net \
    /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.