Subject: bug#10792: 24.0.93; emacs goes comatose opening C header

From: John Yates <[email-masked]>
Date: Sat, 11 Feb 2012 12:26:36 -0500

When I attemt to visit the following header emacs locks up.  If
I make the contents of the macro significantly shorted emacs is
able to open and fontlock it successfully.  To me this suggests
some form of n-squared processing.

-----------------------------------

#define PARSE_TYPE_LIST \
_EMIT_(PT_ZERO,            "*ZERO*"            ) _DELIM_ \
_EMIT_(PT_CHAR1,           "CHAR"              ) _DELIM_ \
_EMIT_(PTN_CHAR1,          "CHAR"              ) _DELIM_ \
_EMIT_(PT_CHAR,            "CHAR"              ) _DELIM_ \
_EMIT_(PTN_CHAR,           "CHAR"              ) _DELIM_ \
_EMIT_(PT_VAR_CHAR,        "VARCHAR"           ) _DELIM_ \
_EMIT_(PTN_VAR_CHAR,       "VARCHAR"           ) _DELIM_ \
_EMIT_(PT_VAR_FIXED_CHAR,  "CHAR"              ) _DELIM_ \
_EMIT_(PTN_VAR_FIXED_CHAR, "CHAR"              ) _DELIM_ \
_EMIT_(PT_INT1,            "INT1"              ) _DELIM_ \
_EMIT_(PT_INT2,            "INT2"              ) _DELIM_ \
_EMIT_(PT_INT4,            "INT4"              ) _DELIM_ \
_EMIT_(PT_INT8,            "INT8"              ) _DELIM_ \
_EMIT_(PT_NUMERIC4,        "NUMERIC"           ) _DELIM_ \
_EMIT_(PT_NUMERIC8,        "NUMERIC"           ) _DELIM_ \
_EMIT_(PT_NUMERIC16,       "NUMERIC"           ) _DELIM_ \
_EMIT_(PT_DATE_MMM_D_Y,    "DATE"              ) _DELIM_ \
_EMIT_(PTN_DATE_MMM_D_Y,   "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_N_DMMMY,    "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_D_DMMMY,    "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_N_DMY,      "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_D_DMY,      "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_N_MDY,      "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_D_MDY,      "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_N_YMD,      "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_D_YMD,      "DATE"              ) _DELIM_ \
_EMIT_(PT_TIME_N_24,       "TIME"              ) _DELIM_ \
_EMIT_(PT_TIME_D_24,       "TIME"              ) _DELIM_ \
_EMIT_(PT_TIME_N_12,       "TIME"              ) _DELIM_ \
_EMIT_(PT_TIME_D_12,       "TIME"              ) _DELIM_ \
_EMIT_(PT_TIME_N_24_TZ,    "TIME_TZ"           ) _DELIM_ \
_EMIT_(PT_TIME_D_24_TZ,    "TIME_TZ"           ) _DELIM_ \
_EMIT_(PT_TIME_N_12_TZ,    "TIME_TZ"           ) _DELIM_ \
_EMIT_(PT_TIME_D_12_TZ,    "TIME_TZ"           ) _DELIM_ \
_EMIT_(PT_TIME_N_24_TRUNC, "[TIME]"            ) _DELIM_ \
_EMIT_(PT_TIME_D_24_TRUNC, "[TIME]"            ) _DELIM_ \
_EMIT_(PT_TIME_N_12_TRUNC, "[TIME]"            ) _DELIM_ \
_EMIT_(PT_TIME_D_12_TRUNC, "[TIME]"            ) _DELIM_ \
_EMIT_(PT_BOOL_1_0,        "BOOL (1/0)"        ) _DELIM_ \
_EMIT_(PT_BOOL_T_F,        "BOOL (T/F)"        ) _DELIM_ \
_EMIT_(PTN_BOOL_T_F,       "BOOL (T/F)"        ) _DELIM_ \
_EMIT_(PT_BOOL_TRUE_FALSE, "BOOL (TRUE/FALSE)" ) _DELIM_ \
_EMIT_(PTN_BOOL_TRUE_FALSE,"BOOL (TRUE/FALSE)" ) _DELIM_ \
_EMIT_(PT_BOOL_Y_N,        "BOOL (Y/N)"        ) _DELIM_ \
_EMIT_(PTN_BOOL_Y_N,       "BOOL (Y/N)"        ) _DELIM_ \
_EMIT_(PT_BOOL_YES_NO,     "BOOL (YES/NO)"     ) _DELIM_ \
_EMIT_(PTN_BOOL_YES_NO,    "BOOL (YES/NO)"     ) _DELIM_ \
_EMIT_(PT_FLOAT,           "FLOAT"             ) _DELIM_ \
_EMIT_(PT_DOUBLE,          "DOUBLE"            ) _DELIM_ \
_EMIT_(PT_NVAR_FIXED_CHAR, "NCHAR"             ) _DELIM_ \
_EMIT_(PTN_NVAR_FIXED_CHAR,"NCHAR"             ) _DELIM_ \
_EMIT_(PT_NVAR_CHAR,       "NVARCHAR"          ) _DELIM_ \
_EMIT_(PTN_NVAR_CHAR,      "NVARCHAR"          ) _DELIM_ \
_EMIT_(PT_INT1_ZERO_CHECK, "INT1"              ) _DELIM_ \
_EMIT_(PT_INT2_ZERO_CHECK, "INT2"              ) _DELIM_ \
_EMIT_(PT_INT4_ZERO_CHECK, "INT4"              ) _DELIM_ \
_EMIT_(PT_SYNTH1,          "SYNTH1"            ) _DELIM_ \
_EMIT_(PT_SYNTH2,          "SYNTH2"            ) _DELIM_ \
_EMIT_(PT_SYNTH4,          "SYNTH4"            ) _DELIM_ \
_EMIT_(PT_END,             "*END*"             )

-----------------------------------

In GNU Emacs 24.0.93.1 (x86_64-pc-linux-gnu, GTK+ Version 3.2.3)
 of 2012-02-08 on zelenka, modified by Debian
 (emacs-snapshot package, version 2:20120208-1)
Windowing system distributor `The X.Org Foundation', version 11.0.11001000
Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--host' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.0.93/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.0.93/site-lisp:/usr/share/emacs/site-lisp'
 '--without-compress-info' '--with-crt-dir=/usr/lib/x86_64-linux-gnu/'
 '--with-x=yes' '--with-x-toolkit=gtk3' '--with-imagemagick=yes'
 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu'
 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<escape> x r e p o r t - <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
/usr/share/emacs/24.0.93/site-lisp/debian-startup hides
/usr/share/emacs/site-lisp/debian-startup

Features:
(shadow sort gnus-util mail-extr message format-spec rfc822 mml easymenu
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
emacsbug time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)