unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Font related crash?
@ 2015-11-04 22:32 Yuan MEI
  2015-11-05  3:37 ` Eli Zaretskii
  2015-11-06 11:25 ` martin rudalics
  0 siblings, 2 replies; 13+ messages in thread
From: Yuan MEI @ 2015-11-04 22:32 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 7563 bytes --]

Hello,

    I compiled an emacs version 25.0.50.1 from git repo recently (see the
end of this email for detailed revision info.  Compilation was done through
the Gentoo portage) and discovered a font related crash under certain
circumstances.

The symptom is: after starting an emacs frame (and a server) under
DISPLAY=:0, in a different DISPLAY environment, either in :0.1 (local) or
:10.0 (via ssh), when I run emacsclient -c to start a new frame, emacs
crashes due to a floating point exception.

The crash does not occur when running emacs -Q.  A minimal init.el is
attached to regenerate the crash.

This kind of crash did not occur in version 24 or an earlier version of 25
(I cannot remember when and I don't have the time to trace back).

Help needed!

Thanks,

Yuan

--------------------------------------------------------------------------------------------
(create-fontset-from-fontset-spec
 "-*-Bitstream Vera Sans Mono-*-*-*-*-14-*-*-*-*-*-fontset-xwin")
(dolist (charset '(han cjk-misc bopomofo gb18030))
  (set-fontset-font "fontset-xwin"
                    charset
                    (font-spec :family "Microsoft YaHei" :size 14)))
(dolist (charset '(symbol arabic bengali devanagari gujarati hebrew kannada
lao
                          malayalam oriya tamil telugu thai tibetan))
  (set-fontset-font "fontset-xwin"
                    charset
                    (font-spec :family "Arial Unicode MS") nil 'append))
;; This makes scaling right: c-x c-[+-0]
(defadvice frame-notice-user-settings (before my:rescale-alist)
  (message "set face-font-rescale-alist")
  (setq face-font-rescale-alist '((".*[Hh]ei.*" . 1.2)
                                  (".*雅黑*" . 1.2)
                                  (".*Myungjo.*" . 1.2)
                                  (".*Osaka.*" . 1.2))))

(ad-activate 'frame-notice-user-settings)
(setq initial-frame-alist '((top . 2) (left . 2)
                            (width . 100) (height . 63)
                            (menu-bar-lines . 1)
                            (tool-bar-lines . 0)))
(setq default-frame-alist '((foreground-color . "white")
                            (background-color . "black")
                            (cursor-color . "red")
                            (menu-bar-lines . 1)
                            (tool-bar-lines . 0)
                            (width . 100)
                            (height . 63)
                            (font . "fontset-xwin")))
(server-start)

--------------------------------------------------------------------------------------------
$ emacs
Fatal error 8: Floating point exception
Backtrace:
emacs[0x4f88b9]
emacs[0x4dfd2c]
emacs[0x4f75be]
emacs[0x4f7773]
emacs[0x4f7819]
/lib64/libpthread.so.0(+0x10680)[0x7ffa66960680]
emacs[0x413b18]
emacs[0x414b3f]
emacs[0x41ae45]
emacs[0x41f4c6]
emacs[0x4cdb8c]
emacs[0x5523a3]
emacs[0x587106]
emacs[0x551df2]
emacs[0x5521b3]
emacs[0x587106]
emacs[0x5521b3]
emacs[0x5531e3]
emacs[0x5522a9]
emacs[0x587106]
emacs[0x5521b3]
emacs[0x587106]
emacs[0x5521b3]
emacs[0x587106]
emacs[0x5521b3]
emacs[0x587106]
emacs[0x5521b3]
emacs[0x587106]
emacs[0x5521b3]
emacs[0x553078]
emacs[0x55325c]
emacs[0x550adb]
emacs[0x58afde]
emacs[0x58f82f]
emacs[0x41cc72]
emacs[0x4eb941]
emacs[0x4ec52a]
emacs[0x4ee0be]
emacs[0x5509c7]
emacs[0x4e031c]
emacs[0x5508bb]
...
Floating point exception
$

In GNU Emacs 25.0.50.1 (x86_64-pc-linux-gnu, cairo version 1.14.2)
 of 2015-10-31
Repository revision: b692d6aa4309360e5009e42a0cb1ba477775e333
Windowing system distributor 'The X.Org Foundation', version 11.0.11604000
System Description:    NAME=Gentoo

Configured using:
 'configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --disable-dependency-tracking
 --disable-silent-rules --libdir=/usr/lib64
 --program-suffix=-emacs-25-vcs --infodir=/usr/share/info/emacs-25-vcs
 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --with-gameuser=:gamestat --without-compress-install
 --with-file-notification=inotify --enable-acl --with-dbus --with-gnutls
 --with-gpm --with-hesiod --with-kerberos --with-kerberos5 --with-xml2
 --without-selinux --without-wide-int --with-zlib --with-sound=alsa
 --with-x --without-ns --without-gconf --without-gsettings
 --without-toolkit-scroll-bars --with-gif --with-jpeg --with-png
 --with-rsvg --with-tiff --with-xpm --with-imagemagick --with-xft
 --with-cairo --without-libotf --without-m17n-flt --with-x-toolkit=no
 GENTOO_PACKAGE=app-editors/emacs-vcs-25.0.9999-r1 EGIT_BRANCH=master
 EGIT_VERSION=b692d6aa4309360e5009e42a0cb1ba477775e333 'CFLAGS=-O2
 -march=native -pipe' CPPFLAGS= 'LDFLAGS=-Wl,-O1 -Wl,--as-needed''

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO IMAGEMAGICK SOUND GPM DBUS NOTIFY ACL
GNUTLS LIBXML2 FREETYPE XFT ZLIB X11

Important settings:
  value of $LC_CTYPE: zh_CN.UTF-8
  value of $LANG: en_US.iso88591
  value of $XMODIFIERS: @im=fcitx
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-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
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Loading dictionary-init...done
For information about GNU Emacs and the GNU system, type C-h C-a.
set face-font-rescale-alist
Mark set
Mark deactivated
Making completion list...
Quit

Load-path shadows:
/usr/share/emacs/site-lisp/cjk-latex/thai-word hides
/usr/share/emacs/25.0.50/lisp/language/thai-word

Features:
(shadow sort gnus-util mail-extr emacsbug message idna dired format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr
mail-utils server advice site-gentoo preview-latex bbdb-autoloads bbdb
timezone tex-site auto-loads time-date mule-util china-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame 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 charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
dbusbind inotify dynamic-setting font-render-setting cairo x multi-tty
make-network-process emacs)

Memory information:
((conses 16 87549 3351)
 (symbols 48 19982 0)
 (miscs 40 160 122)
 (strings 32 15293 4423)
 (string-bytes 1 464894)
 (vectors 16 13206)
 (vector-slots 8 552121 35334)
 (floats 8 140 123)
 (intervals 56 442 0)
 (buffers 976 15)
 (heap 1024 28358 931))

[-- Attachment #2: Type: text/html, Size: 8879 bytes --]

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

* Re: Font related crash?
  2015-11-04 22:32 Font related crash? Yuan MEI
@ 2015-11-05  3:37 ` Eli Zaretskii
  2015-11-05  6:55   ` Yuan MEI
  2015-11-06 11:25 ` martin rudalics
  1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2015-11-05  3:37 UTC (permalink / raw)
  To: Yuan MEI; +Cc: emacs-devel

> Date: Wed, 4 Nov 2015 14:32:19 -0800
> From: Yuan MEI <yuan.mei.list@gmail.com>
> 
> I compiled an emacs version 25.0.50.1 from git repo recently (see the end of
> this email for detailed revision info. Compilation was done through the Gentoo
> portage) and discovered a font related crash under certain circumstances.
> 
> The symptom is: after starting an emacs frame (and a server) under DISPLAY=:0,
> in a different DISPLAY environment, either in :0.1 (local) or :10.0 (via ssh),
> when I run emacsclient -c to start a new frame, emacs crashes due to a floating
> point exception.
> 
> The crash does not occur when running emacs -Q. A minimal init.el is attached
> to regenerate the crash.
> 
> This kind of crash did not occur in version 24 or an earlier version of 25 (I
> cannot remember when and I don't have the time to trace back).

Can you run Emacs under GDB and show a backtrace when it crashes?

Thanks.



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

* Re: Font related crash?
  2015-11-05  3:37 ` Eli Zaretskii
@ 2015-11-05  6:55   ` Yuan MEI
  2015-11-05  7:55     ` martin rudalics
  0 siblings, 1 reply; 13+ messages in thread
From: Yuan MEI @ 2015-11-05  6:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1801 bytes --]

Program received signal SIGFPE, Arithmetic exception.
0x0000000000413a88 in required_matrix_width (w=w@entry=0x21c4020) at
dispnew.c:1727
1727                   / ch_width) * w->ncols_scale_factor
(gdb) xbacktrace
"x-create-frame" (0xffff8590)
"x-create-frame-with-faces" (0xffff87a8)
0x1191880 PVEC_COMPILED
"apply" (0xffff8a50)
"frame-creation-function" (0xffff8c60)
"make-frame" (0xffff8e20)
"make-frame-on-display" (0xffff8ff8)
"server-create-window-system-frame" (0xffff9238)
"server-process-filter" (0xffff9428)
(gdb)

Is this sufficient?  Also, sometimes when I switch to another virtual
desktop then come back to emacs, the entire frame shows only the background
color, no letter is visible.  This does not happen all the time though.

Thanks,

Yuan

On Wed, Nov 4, 2015 at 7:37 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Wed, 4 Nov 2015 14:32:19 -0800
> > From: Yuan MEI <yuan.mei.list@gmail.com>
> >
> > I compiled an emacs version 25.0.50.1 from git repo recently (see the
> end of
> > this email for detailed revision info. Compilation was done through the
> Gentoo
> > portage) and discovered a font related crash under certain circumstances.
> >
> > The symptom is: after starting an emacs frame (and a server) under
> DISPLAY=:0,
> > in a different DISPLAY environment, either in :0.1 (local) or :10.0 (via
> ssh),
> > when I run emacsclient -c to start a new frame, emacs crashes due to a
> floating
> > point exception.
> >
> > The crash does not occur when running emacs -Q. A minimal init.el is
> attached
> > to regenerate the crash.
> >
> > This kind of crash did not occur in version 24 or an earlier version of
> 25 (I
> > cannot remember when and I don't have the time to trace back).
>
> Can you run Emacs under GDB and show a backtrace when it crashes?
>
> Thanks.
>

[-- Attachment #2: Type: text/html, Size: 2537 bytes --]

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

* Re: Font related crash?
  2015-11-05  6:55   ` Yuan MEI
@ 2015-11-05  7:55     ` martin rudalics
  2015-11-05  8:45       ` Yuan MEI
  0 siblings, 1 reply; 13+ messages in thread
From: martin rudalics @ 2015-11-05  7:55 UTC (permalink / raw)
  To: Yuan MEI, Eli Zaretskii; +Cc: emacs-devel

 > Program received signal SIGFPE, Arithmetic exception.
 > 0x0000000000413a88 in required_matrix_width (w=w@entry=0x21c4020) at
 > dispnew.c:1727
 > 1727                   / ch_width) * w->ncols_scale_factor
 > (gdb) xbacktrace
 > "x-create-frame" (0xffff8590)
 > "x-create-frame-with-faces" (0xffff87a8)
 > 0x1191880 PVEC_COMPILED
 > "apply" (0xffff8a50)
 > "frame-creation-function" (0xffff8c60)
 > "make-frame" (0xffff8e20)
 > "make-frame-on-display" (0xffff8ff8)
 > "server-create-window-system-frame" (0xffff9238)
 > "server-process-filter" (0xffff9428)

Please show us the values of the involved variables.  Just type

p ch_width

p w->ncols_scale_factor

p WINDOW_PIXEL_WIDTH (w)

at the (gdb) prompt.

Thank you, martin



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

* Re: Font related crash?
  2015-11-05  7:55     ` martin rudalics
@ 2015-11-05  8:45       ` Yuan MEI
  2015-11-05 16:26         ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Yuan MEI @ 2015-11-05  8:45 UTC (permalink / raw)
  To: martin rudalics; +Cc: Eli Zaretskii, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]

Program received signal SIGFPE, Arithmetic exception.
0x0000000000413a88 in required_matrix_width (w=w@entry=0x21db2f8)
    at dispnew.c:1727
1727               / ch_width) * w->ncols_scale_factor
(gdb) p ch_width
$1 = 0
(gdb) p w->ncols_scale_factor
$2 = 1
(gdb) p WINDOW_PIXEL_WIDTH (w)
$3 = 96
(gdb)

On Wed, Nov 4, 2015 at 11:55 PM, martin rudalics <rudalics@gmx.at> wrote:

> > Program received signal SIGFPE, Arithmetic exception.
> > 0x0000000000413a88 in required_matrix_width (w=w@entry=0x21c4020) at
> > dispnew.c:1727
> > 1727                   / ch_width) * w->ncols_scale_factor
> > (gdb) xbacktrace
> > "x-create-frame" (0xffff8590)
> > "x-create-frame-with-faces" (0xffff87a8)
> > 0x1191880 PVEC_COMPILED
> > "apply" (0xffff8a50)
> > "frame-creation-function" (0xffff8c60)
> > "make-frame" (0xffff8e20)
> > "make-frame-on-display" (0xffff8ff8)
> > "server-create-window-system-frame" (0xffff9238)
> > "server-process-filter" (0xffff9428)
>
> Please show us the values of the involved variables.  Just type
>
> p ch_width
>
> p w->ncols_scale_factor
>
> p WINDOW_PIXEL_WIDTH (w)
>
> at the (gdb) prompt.
>
> Thank you, martin
>

[-- Attachment #2: Type: text/html, Size: 1718 bytes --]

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

* Re: Font related crash?
  2015-11-05  8:45       ` Yuan MEI
@ 2015-11-05 16:26         ` Eli Zaretskii
  2015-11-05 18:16           ` martin rudalics
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2015-11-05 16:26 UTC (permalink / raw)
  To: Yuan MEI; +Cc: rudalics, emacs-devel

> Date: Thu, 5 Nov 2015 00:45:51 -0800
> From: Yuan MEI <yuan.mei.list@gmail.com>
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel <emacs-devel@gnu.org>
> 
> Program received signal SIGFPE, Arithmetic exception.
> 0x0000000000413a88 in required_matrix_width (w=w@entry=0x21db2f8)
> at dispnew.c:1727
> 1727 / ch_width) * w->ncols_scale_factor
> (gdb) p ch_width
> $1 = 0
> (gdb) p w->ncols_scale_factor
> $2 = 1
> (gdb) p WINDOW_PIXEL_WIDTH (w)
> $3 = 96
> (gdb) 

Martin, this probably means the code in font_open_entity, which AFAICS
is the only place where we set FRAME_SMALLEST_CHAR_WIDTH, was not yet
called for this frame, or maybe it was called, but the logic there
that assigns a value to the above is flawed.

Such a small pixel width probably means the former, in which case I
think we need some simple protection in required_matrix_width against
FRAME_SMALLEST_CHAR_WIDTH being zero (and a similar protection in
required_matrix_height, to be called next).

Or maybe when we create a frame we should simply initialize
FRAME_SMALLEST_CHAR_WIDTH to 1 (and similarly with
FRAME_SMALLEST_FONT_HEIGHT).



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

* Re: Font related crash?
  2015-11-05 16:26         ` Eli Zaretskii
@ 2015-11-05 18:16           ` martin rudalics
  2015-11-05 18:42             ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: martin rudalics @ 2015-11-05 18:16 UTC (permalink / raw)
  To: Eli Zaretskii, Yuan MEI; +Cc: emacs-devel

 > Martin, this probably means the code in font_open_entity, which AFAICS
 > is the only place where we set FRAME_SMALLEST_CHAR_WIDTH, was not yet
 > called for this frame, or maybe it was called, but the logic there
 > that assigns a value to the above is flawed.

If I'm not too silly the following cannot assign zero to min_width:

   min_width = (font->min_width ? font->min_width
	       : font->average_width ? font->average_width
	       : font->space_width ? font->space_width
	       : 1);

I suppose that font_open_entity returns too early.  Does it pay to
pursue that?

 > Such a small pixel width probably means the former, in which case I
 > think we need some simple protection in required_matrix_width against
 > FRAME_SMALLEST_CHAR_WIDTH being zero (and a similar protection in
 > required_matrix_height, to be called next).

We should do that in any case.

 > Or maybe when we create a frame we should simply initialize
 > FRAME_SMALLEST_CHAR_WIDTH to 1 (and similarly with
 > FRAME_SMALLEST_FONT_HEIGHT).

Or have these macros never provide zero.  My only concern is that this
might hide some underlying problem.  Any ideas about the OP's:

 > Also, sometimes when I switch to another virtual
 > desktop then come back to emacs, the entire frame shows only the background
 > color, no letter is visible.

martin



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

* Re: Font related crash?
  2015-11-05 18:16           ` martin rudalics
@ 2015-11-05 18:42             ` Eli Zaretskii
  2015-11-06 10:31               ` Yuan MEI
  2015-11-06 11:26               ` martin rudalics
  0 siblings, 2 replies; 13+ messages in thread
From: Eli Zaretskii @ 2015-11-05 18:42 UTC (permalink / raw)
  To: martin rudalics; +Cc: yuan.mei.list, emacs-devel

> Date: Thu, 05 Nov 2015 19:16:57 +0100
> From: martin rudalics <rudalics@gmx.at>
> CC: emacs-devel@gnu.org
> 
>  > Martin, this probably means the code in font_open_entity, which AFAICS
>  > is the only place where we set FRAME_SMALLEST_CHAR_WIDTH, was not yet
>  > called for this frame, or maybe it was called, but the logic there
>  > that assigns a value to the above is flawed.
> 
> If I'm not too silly the following cannot assign zero to min_width:
> 
>    min_width = (font->min_width ? font->min_width
> 	       : font->average_width ? font->average_width
> 	       : font->space_width ? font->space_width
> 	       : 1);

It can't, but later we have this:

  FRAME_DISPLAY_INFO (f)->n_fonts++;
  if (FRAME_DISPLAY_INFO (f)->n_fonts == 1)
    {
      FRAME_SMALLEST_CHAR_WIDTH (f) = min_width;
      FRAME_SMALLEST_FONT_HEIGHT (f) = height;
      f->fonts_changed = 1;
    }
  else
    {
      if (FRAME_SMALLEST_CHAR_WIDTH (f) > min_width)
	FRAME_SMALLEST_CHAR_WIDTH (f) = min_width, f->fonts_changed = 1;
      if (FRAME_SMALLEST_FONT_HEIGHT (f) > height)
	FRAME_SMALLEST_FONT_HEIGHT (f) = height, f->fonts_changed = 1;
    }

If, for some reason, n_fonts is not zero, and
FRAME_SMALLEST_CHAR_WIDTH is zero, this will not do anything, and will
leave FRAME_SMALLEST_CHAR_WIDTH at zero.

But I'm not even sure this code runs so early in frame's life cycle.
It does here for the initial frame, but I don't know what happens when
make-frame-on-display is called after we already have one frame on
another display.  Perhaps we could ask the OP to put a breakpoint in
font_open_entity before invoking emacsclient.

There's also the font-related customizations that allegedly are
necessary for the crash to happen.

>  > Such a small pixel width probably means the former, in which case I
>  > think we need some simple protection in required_matrix_width against
>  > FRAME_SMALLEST_CHAR_WIDTH being zero (and a similar protection in
>  > required_matrix_height, to be called next).
> 
> We should do that in any case.
> 
>  > Or maybe when we create a frame we should simply initialize
>  > FRAME_SMALLEST_CHAR_WIDTH to 1 (and similarly with
>  > FRAME_SMALLEST_FONT_HEIGHT).
> 
> Or have these macros never provide zero.  My only concern is that this
> might hide some underlying problem.

Yes, but which one?  Did you try reproducing this on X?

> Any ideas about the OP's:
> 
>  > Also, sometimes when I switch to another virtual
>  > desktop then come back to emacs, the entire frame shows only the background
>  > color, no letter is visible.

Sounds like some redisplay problem, and if so, it's unrelated.



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

* Re: Font related crash?
  2015-11-05 18:42             ` Eli Zaretskii
@ 2015-11-06 10:31               ` Yuan MEI
  2015-11-06 10:50                 ` Eli Zaretskii
  2015-11-06 11:26               ` martin rudalics
  1 sibling, 1 reply; 13+ messages in thread
From: Yuan MEI @ 2015-11-06 10:31 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: martin rudalics, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

> The symptom is: after starting an emacs frame (and a server) under
DISPLAY=:0, in a different DISPLAY environment, either in :0.1 (local) or
:10.0 (via ssh), when I run emacsclient -c to start a new frame, emacs
crashes due to a floating point exception.
> The crash does not occur when running emacs -Q.  A minimal init.el is
attached to regenerate the crash.

Let me add one more piece of info:
If I run emacsclient -c under the same DISPLAY=:0, the crash does NOT occur
and a second frame shows up correctly.

[-- Attachment #2: Type: text/html, Size: 591 bytes --]

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

* Re: Font related crash?
  2015-11-06 10:31               ` Yuan MEI
@ 2015-11-06 10:50                 ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2015-11-06 10:50 UTC (permalink / raw)
  To: Yuan MEI; +Cc: rudalics, emacs-devel

> Date: Fri, 6 Nov 2015 02:31:48 -0800
> From: Yuan MEI <yuan.mei.list@gmail.com>
> Cc: martin rudalics <rudalics@gmx.at>, emacs-devel <emacs-devel@gnu.org>
> 
> If I run emacsclient -c under the same DISPLAY=:0, the crash does NOT occur and
> a second frame shows up correctly.

Thanks.

Btw, are _all_ of the customizations you posted needed for the
reproduction?  There seem to be several unrelated parts there, and I'm
not sure they are, or even can be, related.  For example:

> ;; This makes scaling right: c-x c-[+-0]
> (defadvice frame-notice-user-settings (before my:rescale-alist)
> (message "set face-font-rescale-alist")
> (setq face-font-rescale-alist '((".*[Hh]ei.*" . 1.2)
> (".*雅黑*" . 1.2)
> (".*Myungjo.*" . 1.2)
> (".*Osaka.*" . 1.2))))
> 
> (ad-activate 'frame-notice-user-settings)

What is this about?

Also, what about these customizations:

> (setq initial-frame-alist '((top . 2) (left . 2)
> (width . 100) (height . 63)
> (menu-bar-lines . 1)
> (tool-bar-lines . 0)))
> (setq default-frame-alist '((foreground-color . "white")
> (background-color . "black")
> (cursor-color . "red")
> (menu-bar-lines . 1)
> (tool-bar-lines . 0)
> (width . 100)
> (height . 63)

Are the colors and the frame dimensions really relevant to the crash?

Thanks.




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

* Re: Font related crash?
  2015-11-04 22:32 Font related crash? Yuan MEI
  2015-11-05  3:37 ` Eli Zaretskii
@ 2015-11-06 11:25 ` martin rudalics
  2015-11-07  5:52   ` Yuan MEI
  1 sibling, 1 reply; 13+ messages in thread
From: martin rudalics @ 2015-11-06 11:25 UTC (permalink / raw)
  To: Yuan MEI, emacs-devel

 > The symptom is: after starting an emacs frame (and a server) under
 > DISPLAY=:0, in a different DISPLAY environment, either in :0.1 (local) or
 > :10.0 (via ssh), when I run emacsclient -c to start a new frame, emacs
 > crashes due to a floating point exception.

I pushed some changes in 29c360e..40014fe  master -> master.  Please
try again.

Thanks, martin



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

* Re: Font related crash?
  2015-11-05 18:42             ` Eli Zaretskii
  2015-11-06 10:31               ` Yuan MEI
@ 2015-11-06 11:26               ` martin rudalics
  1 sibling, 0 replies; 13+ messages in thread
From: martin rudalics @ 2015-11-06 11:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: yuan.mei.list, emacs-devel

 > It can't, but later we have this:
 >
 >    FRAME_DISPLAY_INFO (f)->n_fonts++;
 >    if (FRAME_DISPLAY_INFO (f)->n_fonts == 1)
 >      {
 >        FRAME_SMALLEST_CHAR_WIDTH (f) = min_width;
 >        FRAME_SMALLEST_FONT_HEIGHT (f) = height;
 >        f->fonts_changed = 1;
 >      }
 >    else
 >      {
 >        if (FRAME_SMALLEST_CHAR_WIDTH (f) > min_width)
 > 	FRAME_SMALLEST_CHAR_WIDTH (f) = min_width, f->fonts_changed = 1;
 >        if (FRAME_SMALLEST_FONT_HEIGHT (f) > height)
 > 	FRAME_SMALLEST_FONT_HEIGHT (f) = height, f->fonts_changed = 1;
 >      }
 >
 > If, for some reason, n_fonts is not zero,

Indeed.  Though such behavior would be unforeseen and probably buggy
too.

 > and
 > FRAME_SMALLEST_CHAR_WIDTH is zero, this will not do anything, and will
 > leave FRAME_SMALLEST_CHAR_WIDTH at zero.
 >
[...]
 >>   > Or maybe when we create a frame we should simply initialize
 >>   > FRAME_SMALLEST_CHAR_WIDTH to 1 (and similarly with
 >>   > FRAME_SMALLEST_FONT_HEIGHT).
 >>
 >> Or have these macros never provide zero.  My only concern is that this
 >> might hide some underlying problem.
 >
 > Yes, but which one?  Did you try reproducing this on X?

I don't have these fontsets.

martin



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

* Re: Font related crash?
  2015-11-06 11:25 ` martin rudalics
@ 2015-11-07  5:52   ` Yuan MEI
  0 siblings, 0 replies; 13+ messages in thread
From: Yuan MEI @ 2015-11-07  5:52 UTC (permalink / raw)
  To: martin rudalics; +Cc: emacs-devel

> I pushed some changes in 29c360e..40014fe  master -> master.  Please
> try again.

OK, it is not crashing any more.

Thanks,

Yuan



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

end of thread, other threads:[~2015-11-07  5:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-04 22:32 Font related crash? Yuan MEI
2015-11-05  3:37 ` Eli Zaretskii
2015-11-05  6:55   ` Yuan MEI
2015-11-05  7:55     ` martin rudalics
2015-11-05  8:45       ` Yuan MEI
2015-11-05 16:26         ` Eli Zaretskii
2015-11-05 18:16           ` martin rudalics
2015-11-05 18:42             ` Eli Zaretskii
2015-11-06 10:31               ` Yuan MEI
2015-11-06 10:50                 ` Eli Zaretskii
2015-11-06 11:26               ` martin rudalics
2015-11-06 11:25 ` martin rudalics
2015-11-07  5:52   ` Yuan MEI

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