all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jan Djärv" <jan.h.d@swipnet.se>
To: Rupert Swarbrick <ruperts@broadcom.com>
Cc: 18586@debbugs.gnu.org
Subject: bug#18586: 24.4.50; "Not an in-range integer, float, or cons of integers" from x-focus-frame
Date: Wed, 1 Oct 2014 20:06:02 +0200	[thread overview]
Message-ID: <61F4C13D-A8B6-4952-829E-5DF9754A5F17@swipnet.se> (raw)
In-Reply-To: <542BF145.3090403@broadcom.com>

Hello.

1 okt 2014 kl. 14:19 skrev Rupert Swarbrick <ruperts@broadcom.com>:

> I've done some more investigating and I think I know what's wrong.
> 
> In x_ewmh_activate_frame (in xterm.c), we cons up a list containing 1 and dpyinfo->last_user_time. The latter number is a "Time", which is declared in X.h. The type will be at least 32 bits wide and it gets filled with an unsigned 32 bit number.

The problem seems to be that Time is unsigned 32 bits, but for XClientMessageEvent you can only send signed 32 bits.  So the signed 32 bits aren't strictly a signed number, just 32 bits.
I guess the apropriate thing to do is to use cons_to_signed if the value fits in 32 signed bits, and cons_to_unsigned if it fits in 32 unsigned bits.

	Jan D.

> 
> In x_fill_property_data in xselect.c, this number gets checked against X_LONG_MIN and X_LONG_MAX, which are the limits of a signed 32 bit number. This is incorrect, I think.
> 
> In my original bug report, I'd gone to the effort of bisecting and finding the patch that triggers this bug. I'd forgotten that a git sha hash is less than helpful though, so I'll be more explicit:
> 
> * This bug is triggered by an incorrect patch that was committed on 7/9/2014.
> * The subject line for the commit is
>     "Adjust drag-and-drop fix when window is above top."
> * The changelog message is:
> 
>  +2014-09-07  Paul Eggert  <eggert@cs.ucla.edu>
>  +
>  +       Adjust drag-and-drop fix when window is above top (Bug#18303).
>  +       * xselect.c (x_fill_property_data): Don't let sign bit of negative
>  +       XCDR bleed into XCAR's encoded value.  Improve checks for
>  +       out-of-range data while we're at it.
>  +
> 
> I think that this shows that the "improved" checks are incorrect and, with the API in xselect.c, you can only check that the 64-bit sign extended value is between X_LONG_MIN and X_ULONG_MAX.
> 
> 
> Rupert
> 
> 






  reply	other threads:[~2014-10-01 18:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29 14:04 bug#18586: 24.4.50; "Not an in-range integer, float, or cons of integers" from x-focus-frame Rupert Swarbrick
2014-09-30  4:03 ` Paul Eggert
2014-09-30  8:10   ` Leo Liu
2014-09-30  9:58     ` Leo Liu
2014-09-30 10:01       ` Rupert Swarbrick
2014-09-30 10:10         ` Leo Liu
2014-10-01 12:19         ` Rupert Swarbrick
2014-10-01 18:06           ` Jan Djärv [this message]
2014-09-30 13:24   ` Ted Zlatanov
2014-10-02  4:54 ` Paul Eggert
2014-10-02  5:50   ` Jan Djärv
2014-10-03  2:30   ` Paul Eggert
2014-10-03  8:22     ` Rupert Swarbrick
2014-10-04 21:27     ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61F4C13D-A8B6-4952-829E-5DF9754A5F17@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=18586@debbugs.gnu.org \
    --cc=ruperts@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.