Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-25 Thread Enrico Forestieri
On Mon, Feb 24, 2020 at 04:37:00PM -0500, Scott Kostyshak wrote: > On Mon, Feb 24, 2020 at 09:56:41PM +0100, Enrico Forestieri wrote: > > On Mon, Feb 24, 2020 at 02:02:32PM -0500, Scott Kostyshak wrote: > > > On Mon, Feb 24, 2020 at 06:39:25PM +0100, Enrico Forestieri wrote: > > > > On Mon, Feb 24,

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-24 Thread Scott Kostyshak
On Mon, Feb 24, 2020 at 09:56:41PM +0100, Enrico Forestieri wrote: > On Mon, Feb 24, 2020 at 02:02:32PM -0500, Scott Kostyshak wrote: > > On Mon, Feb 24, 2020 at 06:39:25PM +0100, Enrico Forestieri wrote: > > > On Mon, Feb 24, 2020 at 11:05:51AM -0500, Scott Kostyshak wrote: > > > > > > > > Appare

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-24 Thread Enrico Forestieri
On Mon, Feb 24, 2020 at 02:02:32PM -0500, Scott Kostyshak wrote: > On Mon, Feb 24, 2020 at 06:39:25PM +0100, Enrico Forestieri wrote: > > On Mon, Feb 24, 2020 at 11:05:51AM -0500, Scott Kostyshak wrote: > > > > > > Apparently another approach would be to add the following: > > > > > > memset(&p

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-24 Thread Scott Kostyshak
On Mon, Feb 24, 2020 at 06:39:25PM +0100, Enrico Forestieri wrote: > On Mon, Feb 24, 2020 at 11:05:51AM -0500, Scott Kostyshak wrote: > > > > Apparently another approach would be to add the following: > > > > memset(&padded_event, 0, sizeof(padded_event)); > > > > Valgrind does not complain wh

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-24 Thread Enrico Forestieri
On Mon, Feb 24, 2020 at 11:05:51AM -0500, Scott Kostyshak wrote: > > Apparently another approach would be to add the following: > > memset(&padded_event, 0, sizeof(padded_event)); > > Valgrind does not complain when this line is added to the union patch. I am baffled. The last suggestion I ha

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-24 Thread Scott Kostyshak
On Mon, Feb 24, 2020 at 12:39:49PM +0100, Enrico Forestieri wrote: > On Sun, Feb 23, 2020 at 08:41:12PM -0500, Scott Kostyshak wrote: > > On Sun, Feb 23, 2020 at 10:40:32PM +0100, Enrico Forestieri wrote: > > > On Sun, Feb 23, 2020 at 12:04:20PM -0500, Scott Kostyshak wrote: > > > > On Sun, Feb 23,

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-24 Thread Enrico Forestieri
On Sun, Feb 23, 2020 at 08:41:12PM -0500, Scott Kostyshak wrote: > On Sun, Feb 23, 2020 at 10:40:32PM +0100, Enrico Forestieri wrote: > > On Sun, Feb 23, 2020 at 12:04:20PM -0500, Scott Kostyshak wrote: > > > On Sun, Feb 23, 2020 at 03:10:37PM +0100, Enrico Forestieri wrote: > > > > On Sun, Feb 23,

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-23 Thread Scott Kostyshak
On Sun, Feb 23, 2020 at 10:40:32PM +0100, Enrico Forestieri wrote: > On Sun, Feb 23, 2020 at 12:04:20PM -0500, Scott Kostyshak wrote: > > On Sun, Feb 23, 2020 at 03:10:37PM +0100, Enrico Forestieri wrote: > > > On Sun, Feb 23, 2020 at 08:22:55AM -0500, Scott Kostyshak wrote: > > > > On Wed, Feb 19,

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-23 Thread Enrico Forestieri
On Sun, Feb 23, 2020 at 12:04:20PM -0500, Scott Kostyshak wrote: > On Sun, Feb 23, 2020 at 03:10:37PM +0100, Enrico Forestieri wrote: > > On Sun, Feb 23, 2020 at 08:22:55AM -0500, Scott Kostyshak wrote: > > > On Wed, Feb 19, 2020 at 08:07:46PM +0100, Enrico Forestieri wrote: > > > > On Wed, Feb 19,

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-23 Thread Scott Kostyshak
On Sun, Feb 23, 2020 at 03:10:37PM +0100, Enrico Forestieri wrote: > On Sun, Feb 23, 2020 at 08:22:55AM -0500, Scott Kostyshak wrote: > > On Wed, Feb 19, 2020 at 08:07:46PM +0100, Enrico Forestieri wrote: > > > On Wed, Feb 19, 2020 at 01:19:54PM -0500, Scott Kostyshak wrote: > > > > > > > > It see

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-23 Thread Enrico Forestieri
On Sun, Feb 23, 2020 at 08:22:55AM -0500, Scott Kostyshak wrote: > On Wed, Feb 19, 2020 at 08:07:46PM +0100, Enrico Forestieri wrote: > > On Wed, Feb 19, 2020 at 01:19:54PM -0500, Scott Kostyshak wrote: > > > > > > It seems I committed too soon. Sorry for not waiting. Both the macro > > > approach

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-23 Thread Scott Kostyshak
On Wed, Feb 19, 2020 at 08:07:46PM +0100, Enrico Forestieri wrote: > On Wed, Feb 19, 2020 at 01:19:54PM -0500, Scott Kostyshak wrote: > > > > It seems I committed too soon. Sorry for not waiting. Both the macro > > approach and Enrico's proposal are cleaner than my approach. I was > > planning to

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-20 Thread Kornel Benko
Am Wed, 19 Feb 2020 22:45:12 +0100 schrieb Jean-Marc Lasgouttes : > Le 19 février 2020 22:25:31 GMT+01:00, Pavel Sanda a écrit : > >So the oldest distro on which I regularly compile lyx master has gcc > >4.8. > >Because I suspect no one around is using even older config we can't > >really > >guar

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-19 Thread Jean-Marc Lasgouttes
Le 19 février 2020 22:25:31 GMT+01:00, Pavel Sanda a écrit : >So the oldest distro on which I regularly compile lyx master has gcc >4.8. >Because I suspect no one around is using even older config we can't >really >guarantee 4.7 (stand up if I am wrong) so we should change INSTALL >instructions

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-19 Thread Pavel Sanda
On Wed, Feb 19, 2020 at 06:13:08PM +0100, Pavel Sanda wrote: > > We are requiring C++11 these days, right? > > Can't remember, notions of gcc 4.7 in INSTALL is not strongly indicative of > that ;) > Need to check whether one of my antique system still compiles with 4.7 or 4.8, > maybe we can bump

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-19 Thread Enrico Forestieri
On Wed, Feb 19, 2020 at 01:19:54PM -0500, Scott Kostyshak wrote: > > It seems I committed too soon. Sorry for not waiting. Both the macro > approach and Enrico's proposal are cleaner than my approach. I was > planning to pursue the macro approach in a follow-up commit. Apparently, the macro appro

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-19 Thread Scott Kostyshak
On Wed, Feb 19, 2020 at 07:22:36PM +0100, Pavel Sanda wrote: > On Wed, Feb 19, 2020 at 06:28:51PM +0100, Enrico Forestieri wrote: > > Uh? In the Requirements section I read: > > > > First of all, you will need a C++11 standard conforming compiler, like gcc > > (at least 4.7) or clang. > > My

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-19 Thread Pavel Sanda
On Wed, Feb 19, 2020 at 06:28:51PM +0100, Enrico Forestieri wrote: > Uh? In the Requirements section I read: > > First of all, you will need a C++11 standard conforming compiler, like gcc > (at least 4.7) or clang. My undesrtanding was that only 4.8 is C++11 complete, especially wrt alignment

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-19 Thread Scott Kostyshak
On Wed, Feb 19, 2020 at 06:28:51PM +0100, Enrico Forestieri wrote: > On Wed, Feb 19, 2020 at 06:13:08PM +0100, Pavel Sanda wrote: > > On Wed, Feb 19, 2020 at 05:24:46PM +0100, Enrico Forestieri wrote: > > > > Did not try, but I am afraid generally it won't, because > > > > xcb_selection_notify_eve

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-19 Thread Enrico Forestieri
On Wed, Feb 19, 2020 at 06:13:08PM +0100, Pavel Sanda wrote: > On Wed, Feb 19, 2020 at 05:24:46PM +0100, Enrico Forestieri wrote: > > > Did not try, but I am afraid generally it won't, because > > > xcb_selection_notify_event_t is not enforced to have 32 bits, > > > while that's requested by under

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-19 Thread Pavel Sanda
On Wed, Feb 19, 2020 at 05:24:46PM +0100, Enrico Forestieri wrote: > > Did not try, but I am afraid generally it won't, because > > xcb_selection_notify_event_t is not enforced to have 32 bits, > > while that's requested by underlying X routines. That's why > > the padding by 0s. > > Ok, then pro

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-19 Thread Enrico Forestieri
On Wed, Feb 19, 2020 at 08:42:57AM +0100, Pavel Sanda wrote: > On Wed, Feb 19, 2020 at 08:24:43AM +0100, Enrico Forestieri wrote: > > On Tue, Feb 18, 2020 at 09:49:08PM -0500, Scott Kostyshak wrote: > > > > > > Attached is a patch. I really don't know what I'm doing. The use of > > > calloc scares

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-19 Thread Pavel Sanda
On Wed, Feb 19, 2020 at 09:56:20AM -0500, Scott Kostyshak wrote: > If there is interest, I can work on a patch for using the macro. It would reduce the work of relearning the topic for someone stumbling upon this TODO in 5 years. > Should I condition on the Qt version and if it is less than 5.6.3

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-19 Thread Scott Kostyshak
On Wed, Feb 19, 2020 at 09:53:35AM -0500, Scott Kostyshak wrote: > On Wed, Feb 19, 2020 at 11:51:58AM +0100, Jean-Marc Lasgouttes wrote: > > Stealing the definition of the macro when we do not have it is the best > > solution IMO. > > I put in the patch with comments addressing both yours and Pav

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-19 Thread Scott Kostyshak
On Wed, Feb 19, 2020 at 11:51:58AM +0100, Jean-Marc Lasgouttes wrote: > Stealing the definition of the macro when we do not have it is the best > solution IMO. I put in the patch with comments addressing both yours and Pavel's ideas (to either wait until Qt 5.6.3 is required, or to copy the macro

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-19 Thread Jean-Marc Lasgouttes
Stealing the definition of the macro when we do not have it is the best solution IMO. JMarc Le 19 février 2020 08:39:35 GMT+01:00, Pavel Sanda a écrit : >On Tue, Feb 18, 2020 at 09:49:08PM -0500, Scott Kostyshak wrote: >> Could anyone take a close look at this? If there is a better fix, >please

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-18 Thread Pavel Sanda
On Wed, Feb 19, 2020 at 08:24:43AM +0100, Enrico Forestieri wrote: > On Tue, Feb 18, 2020 at 09:49:08PM -0500, Scott Kostyshak wrote: > > > > Attached is a patch. I really don't know what I'm doing. The use of > > calloc scares me. I just used the xcb_send_event man page and > > experimented until

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-18 Thread Pavel Sanda
On Tue, Feb 18, 2020 at 09:49:08PM -0500, Scott Kostyshak wrote: > Could anyone take a close look at this? If there is a better fix, please > go ahead. Looks OK to me. I would just put into comments TODO to switch to Q_DECLARE_XCB_EVENT(event, xcb_selection_notify_event_t); once we require qt >=

Re: [PATCH] Fix write to uninitialized bytes for XCB event

2020-02-18 Thread Enrico Forestieri
On Tue, Feb 18, 2020 at 09:49:08PM -0500, Scott Kostyshak wrote: > > Attached is a patch. I really don't know what I'm doing. The use of > calloc scares me. I just used the xcb_send_event man page and > experimented until compilation and valgrind did not complain. > > Could anyone take a close lo