Subject: bug#52067: 29.0.50; string-glyph-split halts on certain emoji strings

From: PAVLOS MARAGAKIS <[email-masked]>
Date: Tue, 23 Nov 2021 18:01:12 -0500

In a clean instance of emacs paste the following lines
into the scratch buffer and evaluate the lines starting
with string-glyph-split.  I show the outputs below:

(string-glyph-split "🌍🦹")
("🌍" "🦹")

(string-glyph-split "✈️✈️")
("✈️" "✈️")

(string-glyph-split "🌍✈️")
("🌍" "✈️")

(string-glyph-split "✈️🌍")

The last line will halt emacs; C-g can stop the evaluation.
The expected behavior was to split the string in two glyphs.

In GNU Emacs 29.0.50 (build 2, aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build 21A559))
of 2021-11-21 built on MacbookPro13.local
Repository revision: b7db7eb2c7b8ac1bddf4afa9ccf9b30ebeb0224e
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.0.1

Configured using:
'configure --disable-silent-rules
--enable-locallisppath=/usr/local/share/emacs/28.0.50/site-lisp
--prefix=/usr/local/opt/gccemacs --without-dbus --without-imagemagick
--with-mailutils --with-ns --disable-ns-self-contained --with-cairo
--with-modules --with-xml2 --with-gnutls --with-json --with-rsvg
--with-native-compilation CC=/usr/bin/clang
CFLAGS=-I/opt/homebrew/lib/gcc/11/include
'LDFLAGS=-L/opt/homebrew/lib/gcc/11/
-I/opt/homebrew/lib/gcc/11/include'
CPPFLAGS=-I/opt/homebrew/opt/libffi/include
'PKG_CONFIG_PATH=/opt/homebrew/opt/libffi/lib/pkgconfig --no-create
--no-recursion''

Configured features:
ACL GLIB GNUTLS JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS
PDUMPER PNG RSVG THREADS TOOLKIT_SCROLL_BARS WEBP XIM ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-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
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media rmc puny
dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068
epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json map
text-property-search seq gv byte-opt bytecomp byte-compile cconv
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils time-date subr-x help-fns radix-tree cl-print debug backtrace
find-func help-mode cl-loaddefs cl-lib iso-transl tooltip eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget keymap hashtable-print-readable backquote threads
kqueue cocoa ns lcms2 multi-tty make-network-process native-compile
emacs)

Memory information:
((conses 16 76126 7924)
(symbols 48 7053 0)
(strings 32 21398 1914)
(string-bytes 1 725508)
(vectors 16 15268)
(vector-slots 8 317989 13284)
(floats 8 26 61)
(intervals 56 341 0)
(buffers 992 13))