unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10793: 24.0.93; yet another macro lock up
@ 2012-02-11 19:56 John Yates
  2012-02-14  5:50 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: John Yates @ 2012-02-11 19:56 UTC (permalink / raw)
  To: 10793; +Cc: Alan Mackenzie

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgement at that address.




Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.




Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

Attempting to open the following .cpp never renders even the first line.

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

#define NEXT_NCHAR(LIMIT,LENGTH_ACCUMULATOR,CONTEXT,TRAIL)\
                        do {\
                            enum {\
                                mYes, mNo, mSPrime\
                            } MaybeEncountered = mNo;\
                            uint8 CurWeight = NO_WEIGHT;\
                            bool firstPass = TRUE;\
                            unsigned int
Utf32GraphemeStack[MAX_GRAPHEME_COUNT];\
                            unsigned int* pUtf32GraphemeEnd =
Utf32GraphemeStack;\
                            pUtf8GraphemeStart = pText - 1;\
                            while (TRUE) {   /* Loop exits at the end
of a grapheme after stable character found */\
                                unsigned int codePoint = ch;\
                                unsigned int charByteSize = 1;\
                                uint8 Props = PROPS_STABLE;\
                                pUtf8GraphemeEnd = pText - 1;\
                                /* The stopper need not be valid UTF8.
Cannot use IF_STOPPER_GOTO */\
                                /* because it advances pText for a
double quote. (SWS42635) Only need check for */\
                                /* the delimiter here. */\
                                if (ch == REG_valueDelim) goto
STOPPER_##CONTEXT;\
                                if ((ch & 0x80) != 0)   /* Decode
multiple UTF8 bytes into a codepoint */\
                                    {\
                                    unsigned int ContByteLo = 0x80;\
                                    unsigned int ContByteHi = 0xBF;\
                                    unsigned int nContBytes = 1;\
                                    charByteSize = 2;\
                                    codePoint &= 0x1F;\
                                    if (ch <= 0xC1)\
                                        goto UTF8_ILLEGAL_INITIAL_BYTE;\
                                    if (ch <= 0xDF)\
                                        goto
DECODE_CONTINUATION_BYTES_##CONTEXT;\
                                    nContBytes = 2;\
                                    charByteSize = 3;\
                                    codePoint &= 0xF;\
                                    if (ch == 0xE0) {\
                                        ContByteLo = 0xA0;\
                                        goto
DECODE_CONTINUATION_BYTES_##CONTEXT;\
                                    }\
                                    if (ch == 0xED) {\
                                        ContByteHi = 0x9F;\
                                        goto
DECODE_CONTINUATION_BYTES_##CONTEXT;\
                                    }\
                                    if (ch <= 0xEF)\
                                        goto
DECODE_CONTINUATION_BYTES_##CONTEXT;\
                                    nContBytes = 3;\
                                    charByteSize = 4;\
                                    if (ch == 0xF0) {\
                                        ContByteLo = 0x90;\
                                        goto
DECODE_CONTINUATION_BYTES_##CONTEXT;\
                                    }\
                                    if (ch < 0xF4)\
                                        goto
DECODE_CONTINUATION_BYTES_##CONTEXT;\
                                    if (ch == 0xF4) {\
                                        ContByteHi = 0x8F;\
                                        goto
DECODE_CONTINUATION_BYTES_##CONTEXT;\
                                    }\
                                    goto UTF8_ILLEGAL_INITIAL_BYTE;\
                                    do {\
                                        ContByteLo = 0x80;\
                                        ContByteHi = 0xBF;\
                                        DECODE_CONTINUATION_BYTES_##CONTEXT:\
                                        TRAIL ;/* SWS 41355 */\
                                        ch = *pText++;\
                                        codePoint <<= 6;\
                                        if (ch < ContByteLo || ch > ContByteHi)\
                                            goto UTF8_BAD_CONTINUATION_BYTE;\
                                        codePoint |= (ch & 0x3F);\
                                    }\
                                    while (--nContBytes);\
                                    CHECK_UNICODE_PROPS; \
                                } /* End of the non 7 bit ASCII clause*/\
                                STOPPER_##CONTEXT:\
                                if ((pUtf32GraphemeEnd -
Utf32GraphemeStack) >= MAX_GRAPHEME_COUNT) {\
                                    goto EXCEED;\
                                }\
                                *pUtf32GraphemeEnd++ = codePoint;\
                                if ((Props & 0x80) == 0x80 ||\
                                    (firstPass) ||\
                                    !declExtra) { /* Stable or Stable'
or the first character in the grapheme or filled the record */\
                                    /* If we are at stable character,
but have encountered a previous Maybe then */\
                                    /* let the ICU routine decide. If
here on firstPass then MaybeEncountered will be No */\
                                    if ((MaybeEncountered == mYes) &&\
                                        !is_NFC(Utf32GraphemeStack,
pUtf32GraphemeEnd - 1)) {\
                                        goto BAD_SEQUENCE;\
                                    }\
                                    if (firstPass) {    /* Continue if
this is the first stable char in the grapheme */\
                                        firstPass = FALSE;\
                                    } else {\
                                    /* This stable character is
processed twice. Once to mark the end of the previous grapheme */\
                                    /* and then at the start of the
next. At some point we may want to eliminate this if it demonstrates
*/\
                                    /* a real performance loss. No
need to check for the stopper or record size here because we decrease
pText*/\

IF_STOPPER_GOTO(REG_valueDelim,LIMIT,G_FINISH_##CONTEXT);\
                                        if (!declExtra) goto FINISH_##CONTEXT;\
                                        pText=pUtf8GraphemeEnd;/*
Ended the grapheme and it is NFC */\
                                        NEXT_CHAR(LIMIT);\
                                        break;/* out of the while(true) loop */\
                                    }\
                                    if ((Props & 0xC0) == 0xC0) {  /*
Stable' */\
                                        MaybeEncountered = mSPrime; /*
Never count any Maybe in this grapheme */\
                                    }\
                                }/* End of Stable Props (Grapheme end)
or first pass */\
                                if ((MaybeEncountered != mSPrime) && \
                                    (Props & 0xC0) == 0x40) {\
                                    MaybeEncountered = mYes;\
                                }\
                                Props &= 0x3F;\
                                if ((Props < CurWeight) && Props
!=BASE_WEIGHT) {\
                                    badUnicodeCodePoint = codePoint;\
                                    goto DIAGNOSE_BAD_WEIGHT;\
                                }\
                                CurWeight = Props;\
                                LENGTH_ACCUMULATOR+=charByteSize;\
                                NEXT_CHAR(LIMIT);\
                                declExtra--; /* Exit on zero after
seeing if the final grapheme is NFC' */\
                            }/*End of While(TRUE) break out of here at
the end of a grapheme*/\
                            /*LENGTH_ACCUMULATOR += pUtf8GraphemeEnd -
pUtf8GraphemeStart;*/\
                            pUtf8GraphemeStart = pUtf8GraphemeEnd;\
                        } while (FALSE); /*In a do  while false
structure just for the macro semantics*/

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


If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/usr/share/emacs/24.0.93/etc/DEBUG.








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)





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

* bug#10793: 24.0.93; yet another macro lock up
  2012-02-11 19:56 bug#10793: 24.0.93; yet another macro lock up John Yates
@ 2012-02-14  5:50 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2012-02-14  5:50 UTC (permalink / raw)
  To: John Yates; +Cc: Alan Mackenzie, 10793

John Yates <john@yates-sheets.org> writes:

> Attempting to open the following .cpp never renders even the first
> line.

I can't reproduce this now.  Presumably it's been fixed together with
Bug#10664 and/or Bug#10792?  John, can you confirm?





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

end of thread, other threads:[~2012-02-14  5:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-11 19:56 bug#10793: 24.0.93; yet another macro lock up John Yates
2012-02-14  5:50 ` Chong Yidong

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).