Subject: Re: bug#44349: 28.0.50; Assertion failure on macOS when resizing frame

From: Alan Third <[email-masked]>
Date: Sun, 1 Nov 2020 00:55:29 +0000

On Sat, Oct 31, 2020 at 04:57:54PM +0100, Philipp Stephani wrote:
> Am Sa., 31. Okt. 2020 um 16:53 Uhr schrieb Philipp <[email-masked]>:
> >
> >
> > 1. Compile Emacs with assertions enabled on macOS.
> > 2. Start it in graphical mode.
> > 3. Try to resize the frame by dragging the lower-right corner.
> >
> > This will trigger an assertion failure
> >
> > doprnt.c:493: Emacs fatal error: assertion failed: ASCII_CHAR_P (fmtchar)
> > Fatal error 6: Aborted
> > Abort trap: 6
> >
<snip>
>     frame #8: 0x00000001004a8bec emacs`die(msg="ASCII_CHAR_P
> (fmtchar)", file="doprnt.c", line=493) at alloc.c:7341:3
>     frame #9: 0x00000001003c9a9e emacs`doprnt(buffer="*scratch*  ",
> bufsize=9223372036854775797, format="%s  —  (%d x %d)",
> format_end=0x0000000000000000, ap=0x00007ffeefbfb750) at
> doprnt.c:493:4
>     frame #10: 0x00000001003ca54d emacs`esprintf(buf="*scratch*  ",
> format="%s  —  (%d x %d)") at doprnt.c:535:12
>     frame #11: 0x000000010044364f emacs`-[EmacsView
> windowWillResize:toSize:](self=0x0000000101463a70,
> _cmd="windowWillResize:toSize:", sender=0x0000000101464810,
> frameSize=(width = 598, height = 570)) at nsterm.m:7286:2

Hmm, it's this line:

    esprintf (size_title, "%s  —  (%d x %d)", old_title, cols, rows);

where old_title is UTF8. What is the right thing to do here?
-- 
Alan Third