Subject: 26.0.50; division by zero in x_draw_underwave
From: Yuri D'Elia <[email-masked]>
To: [email-masked]
Date: Mon, 21 Aug 2017 16:09:00 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Emacs 26 (lucid, from master) here, I get a division by zero when
activating flyspell underlining, happening at:

Thread 1 "emacs" received signal SIGFPE, Arithmetic exception.
0x00000000005181a3 in x_draw_underwave (s=0x7fffffffbe20) at xterm.c:3541
3541	  x1 = x0 - (x0 % dx);
(gdb) where
#0  0x00000000005181a3 in x_draw_underwave (s=0x7fffffffbe20) at xterm.c:3541
#1  0x0000000000518877 in x_draw_glyph_string (s=0x7fffffffbe20) at xterm.c:3685
#2 0x00000000004805d4 in draw_glyphs (w=0x148dc30 <bss_sbrk_buffer+8070032>,
x=233, row=0x2eda080, area=TEXT_AREA, start=7, end=26, hl=DRAW_NORMAL_TEXT,
overlaps=0) at xdisp.c:26595
(gdb) p dx
$1 = 0

I guess this was introduced in the recent HiDPI support for wave
underlines. Let me know if you need additional details about the monitor
configuration (laptop with an external display).

In GNU Emacs 26.0.50 (build 2, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars)
 of 2017-08-21 built on eab17048nb
Repository revision: 807b67faa403a2c2f65666c28f74ea1989451ad1
Windowing system distributor 'The X.Org Foundation', version 11.0.11903000
System Description:	Debian GNU/Linux unstable (sid)

Configured using:
 'configure --with-x-toolkit=lucid --with-modules --without-gsettings
 CC=gcc 'CFLAGS=-O3 -march=native -pipe ' LDFLAGS='

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND DBUS NOTIFY ACL LIBSELINUX GNUTLS
LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11
MODULES LIBSYSTEMD

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