GNU bug report logs - #21152
emacs make system blocked if "Xft/DPI = -1" in xsettings

Previous Next

Package: emacs;

Reported by: Xu Fasheng <fasheng.xu <at> gmail.com>

Date: Tue, 28 Jul 2015 15:33:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21152 in the body.
You can then email your comments to 21152 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#21152; Package emacs. (Tue, 28 Jul 2015 15:33:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Xu Fasheng <fasheng.xu <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 28 Jul 2015 15:33:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Xu Fasheng <fasheng.xu <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: emacs make system blocked if "Xft/DPI = -1" in xsettings
Date: Tue, 28 Jul 2015 13:58:28 +0800
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/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21152; Package emacs. (Sun, 09 Aug 2015 05:11:01 GMT) Full text and rfc822 format available.

Message #8 received at 21152 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Xu Fasheng <fasheng.xu <at> gmail.com>
Cc: 21152 <at> debbugs.gnu.org
Subject: Re:  emacs make system blocked if "Xft/DPI = -1" in xsettings
Date: Sat, 08 Aug 2015 22:10:40 -0700
[Message part 1 (text/plain, inline)]
Thanks for the bug report.  Does the attached patch fix the problem for you?
[xftdpi.diff (text/x-diff, attachment)]

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Mon, 10 Aug 2015 06:25:02 GMT) Full text and rfc822 format available.

Notification sent to Xu Fasheng <fasheng.xu <at> gmail.com>:
bug acknowledged by developer. (Mon, 10 Aug 2015 06:25:05 GMT) Full text and rfc822 format available.

Message #13 received at 21152-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Xu Fasheng <fasheng.xu <at> gmail.com>
Cc: 21152-done <at> debbugs.gnu.org
Subject: Re: bug#21152: emacs make system blocked if "Xft/DPI = -1" in
 xsettings
Date: Sun, 09 Aug 2015 23:24:52 -0700
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.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 07 Sep 2015 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 288 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.