Subject: bug#21152: closed (Re: bug#21152: emacs make system blocked if "Xft/DPI = -1" in xsettings)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 10 Aug 2015 06:25:05 +0000

Your bug report

#21152: emacs make system blocked if "Xft/DPI = -1" in xsettings

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
21152: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21152
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#21152: emacs make system blocked if "Xft/DPI = -1" in xsettings
From: Paul Eggert <[email-masked]>
To: Xu Fasheng <[email-masked]>
Cc: [email-masked]
Date: Sun, 09 Aug 2015 23:24:52 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Xu Fasheng wrote:
> tha patch works. I rebuild emacs and tested ok.

Thanks, I installed it in the Emacs master and am marking this as done.

Subject: emacs make system blocked if "Xft/DPI = -1" in xsettings
From: Xu Fasheng <[email-masked]>
To: [email-masked]
Date: Tue, 28 Jul 2015 13:58:28 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi, everyone.

I found that emacs could not compute a right dpi value if "Xft/DPI =
-1" in xsettings. The document said "Xft/DPI" is an integer, and "-1"
is the default value [1].

And in the code of src/xsettings.c:parse_settings(), all the interger
value in xsettings are converted to CARD32(unsigned int). So if
Xft/DPI is "-1", emacs will convert it to uint(4294967295), and owns a
huge dpi(4294967295/1024=4194303). Its so huge that will make system
blocked.

Here is the code snippets in
emacs24-24.5+1/src/xsettings.c:parse_settings() from debian/sid:
    ....
    420: CARD32 vlen, ival = 0;
    ....
    544: else if (strcmp (name, "Xft/DPI") == 0)
    545:  {
    546:    settings->seen |= SEEN_DPI;
    547:    settings->dpi = (double)ival/1024.0;
    548:  }

[1] http://www.freedesktop.org/wiki/Specifications/XSettingsRegistry/