Re: [PATCH libXpm] After fdopen(), use fclose() instead of close() in error path

2018-10-01 Thread Peter Hutterer
On Sun, Sep 30, 2018 at 03:14:00PM -0700, Alan Coopersmith wrote:
> Found by Oracle's Parfait 2.2 static analyzer:
> 
> Error: File Leak
>File Leak [file-ptr-leak]:
>   Leaked File fp
> at line 94 of lib/libXpm/src/RdFToBuf.c in function 
> 'XpmReadFileToBuffer
> '.
>   fp initialized at line 86 with fdopen
>   fp leaks when len < 0 at line 92.
> 
> Introduced-by: commit 8b3024e6871ce50b34bf2dff924774bd654703bc
> 
> Signed-off-by: Alan Coopersmith 

Reviewed-by: Peter Hutterer 

Cheers,
   Peter

> ---
>  src/RdFToBuf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/RdFToBuf.c b/src/RdFToBuf.c
> index 69e3347..1b386f8 100644
> --- a/src/RdFToBuf.c
> +++ b/src/RdFToBuf.c
> @@ -86,15 +86,15 @@ XpmReadFileToBuffer(
>  fp = fdopen(fd, "r");
>  if (!fp) {
>   close(fd);
>   return XpmOpenFailed;
>  }
>  len = stats.st_size;
>  if (len < 0 || len >= SIZE_MAX) {
> - close(fd);
> + fclose(fp);
>   return XpmOpenFailed;
>  }
>  ptr = (char *) XpmMalloc(len + 1);
>  if (!ptr) {
>   fclose(fp);
>   return XpmNoMemory;
>  }
> -- 
> 2.15.2
> 
> ___
> xorg-devel@lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH app/xcursorgen] Update README for gitlab migration

2018-10-01 Thread Peter Hutterer
On Mon, Oct 01, 2018 at 10:11:07AM -0700, Alan Coopersmith wrote:
> Does anyone have feedback on changing our README's like this?   While I
> sent this out as a patch to a specific repo, I figured once we have
> an agreed upon template, we'd apply it to all of the repos.

oh well, if you ask... :)

> On 09/22/18 12:11 PM, Alan Coopersmith wrote:
> > Signed-off-by: Alan Coopersmith 
> > ---
> >   README | 12 ++--
> >   1 file changed, 2 insertions(+), 10 deletions(-)
> > 
> > diff --git a/README b/README
> > index 6e46f96..f830ada 100644
> > --- a/README
> > +++ b/README
> > @@ -1,25 +1,17 @@
> >   xcursorgen prepares X11 cursor sets for use with libXcursor.
> >   All questions regarding this software should be directed at the
> >   Xorg mailing list:
> >   http://lists.freedesktop.org/mailman/listinfo/xorg
> > -Please submit bug reports to the Xorg bugzilla:
> > -
> > -https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
> > -
> >   The master development code repository can be found at:
> > -git://anongit.freedesktop.org/git/xorg/app/xcursorgen
> > -
> > -http://cgit.freedesktop.org/xorg/app/xcursorgen
> > -
> > -For patch submission instructions, see:
> > +https://gitlab.freedesktop.org/xorg/app/xcursorgen
> > -   http://www.x.org/wiki/Development/Documentation/SubmittingPatches

IMO we (i.e. not me but someone else) should update that URL for the
glorious gitlab-enabled present and leave it in the README


> > +Please submit bug reports and requests to merge patches there.
> >   For more information on the git code manager, see:
> >   http://wiki.x.org/wiki/GitPage

this link needs to go and possibly merged into the SubmittingPatches page
(which could be renamed, because why not) 

Cheers,
   Peter
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

error x11

2018-10-01 Thread Dem Bat
On 2018-10-01 12:19 p.m., Dem Bat wrote:
> (==)Using system config directory "/usr/share/X11/xorg.conf.d"
> (EE)
> (EE) Backtrace:
> (EE) 0: /usr/lib/xorg/Xorg (xorg_backtrace+0x4d) [0x560589b14e3d]
> (EE) 1: /usr/lib/xorg/Xorg (0x56058995d000+bbbd9) [0x560589b18bd9]
> (EE) 2: /lib/x86_64-linux-gnu/libthread.so.0 (0x7fe585b7f000+0x11f50) 
> [0x7fe585b90f50]
> (EE)
> (EE) Segmentation fault at address 0x0
> (EE)
> (EE) 
> Fatal server error:
> (EE) Caught signal 11 (Segmentation fault). Server aborting
> (EE)
> (EE)
> Please consult the The X.Org Fondation support
>  at http://wiki.x.org
>   for help
> (EE) Please also check the log file at "/var/log/Xorg.0.log" for aditional 
> information.
> (EE)
> (EE) Server terminated with error (1). Closing log file.
> Aborted
> 
> P.S Please help. Thanks.
>
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH app/xcursorgen] Update README for gitlab migration

2018-10-01 Thread Alan Coopersmith

Does anyone have feedback on changing our README's like this?   While I
sent this out as a patch to a specific repo, I figured once we have
an agreed upon template, we'd apply it to all of the repos.

-alan-

On 09/22/18 12:11 PM, Alan Coopersmith wrote:

Signed-off-by: Alan Coopersmith 
---
  README | 12 ++--
  1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/README b/README
index 6e46f96..f830ada 100644
--- a/README
+++ b/README
@@ -1,25 +1,17 @@
  xcursorgen prepares X11 cursor sets for use with libXcursor.
  
  All questions regarding this software should be directed at the

  Xorg mailing list:
  
  http://lists.freedesktop.org/mailman/listinfo/xorg
  
-Please submit bug reports to the Xorg bugzilla:

-
-https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
-
  The master development code repository can be found at:
  
-git://anongit.freedesktop.org/git/xorg/app/xcursorgen

-
-http://cgit.freedesktop.org/xorg/app/xcursorgen
-
-For patch submission instructions, see:
+https://gitlab.freedesktop.org/xorg/app/xcursorgen
  
-	http://www.x.org/wiki/Development/Documentation/SubmittingPatches

+Please submit bug reports and requests to merge patches there.
  
  For more information on the git code manager, see:
  
  http://wiki.x.org/wiki/GitPage
  




--
-Alan Coopersmith-   alan.coopersm...@oracle.com
 Oracle Solaris Engineering - https://blogs.oracle.com/alanc
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver v8 05/14] modesetting: Use atomic modesetting API for pageflip if available

2018-10-01 Thread Adam Jackson
On Mon, 2018-10-01 at 11:31 -0400, Adam Jackson wrote:

> AFAICT the free(dst) is always wrong. The other places we use
> drmmode_prop_info_copy, we're initializing an array in the middle of a
> drmmode_{crtc,output}_private_rec.

https://gitlab.freedesktop.org/xorg/xserver/merge_requests/33

- ajax

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

XDC 2018 feedback and comments

2018-10-01 Thread Daniel Vetter
Hi all,

Once more huge thanks to the entire team from g.p.u.l. and Igalia,
personally I think this was an extremely well organized XDC!

As usual we're looking for feedback on both XDC itself, and the CFP
process and program selection. Both about what was great and should be
kept for next year's edition, and where there's room for improvement.
The board does keep some notes, for those interested in what we have
already:

- XDC notes for prospective organizers: https://www.x.org/wiki/Events/RFP/

- CFP notes: https://www.x.org/wiki/Events/PapersCommittee/

If you want to send in your comments in private, please send them to
both the x.org board and gpul - they want to know how to improve and
what to keep for the next conference they're going to organize too.

Cheers, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver v8 05/14] modesetting: Use atomic modesetting API for pageflip if available

2018-10-01 Thread Adam Jackson
On Wed, 2018-09-12 at 11:01 +1000, Dave Airlie wrote:
> On Wed, 28 Feb 2018 at 11:21, Daniel Stone  wrote:
> > 
> > +static Bool
> > +drmmode_prop_info_copy(drmmode_prop_info_ptr dst,
> > +  const drmmode_prop_info_rec *src,
> > +  unsigned int num_props,
> > +  Bool copy_prop_id)
> > +{
> > +unsigned int i;
> > +
> > +memcpy(dst, src, num_props * sizeof(*dst));
> > +
> > +for (i = 0; i < num_props; i++) {
> > +unsigned int j;
> > +
> > +if (copy_prop_id)
> > +dst[i].prop_id = src[i].prop_id;
> > +else
> > +dst[i].prop_id = 0;
> > +
> > +if (src[i].num_enum_values == 0)
> > +continue;
> > +
> > +dst[i].enum_values =
> > +malloc(src[i].num_enum_values *
> > +sizeof(*dst[i].enum_values));
> > +if (!dst[i].enum_values)
> > +goto err;
> > +
> > +memcpy(dst[i].enum_values, src[i].enum_values,
> > +src[i].num_enum_values * sizeof(*dst[i].enum_values));
> > +
> > +for (j = 0; j < dst[i].num_enum_values; j++)
> > +dst[i].enum_values[j].valid = FALSE;
> > +}
> > +
> > +return TRUE;
> > +
> > +err:
> > +while (i--)
> > +free(dst[i].enum_values);
> > +free(dst);
> > +return FALSE;
> > +}
> 
> On failure this frees dst, however...
> 
> > +drmmode_crtc_create_planes(xf86CrtcPtr crtc, int num)
> > +{
> > +drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
> > +drmmode_ptr drmmode = drmmode_crtc->drmmode;
> > +drmModePlaneRes *kplane_res;
> > +drmModePlane *kplane;
> > +drmModeObjectProperties *props;
> > +uint32_t i, type;
> > +int current_crtc, best_plane = 0;
> > +
> > +static drmmode_prop_enum_info_rec plane_type_enums[] = {
> > +[DRMMODE_PLANE_TYPE_PRIMARY] = {
> > +.name = "Primary",
> > +},
> > +[DRMMODE_PLANE_TYPE_OVERLAY] = {
> > +.name = "Overlay",
> > +},
> > +[DRMMODE_PLANE_TYPE_CURSOR] = {
> > +.name = "Cursor",
> > +},
> > +};
> > +static const drmmode_prop_info_rec plane_props[] = {
> > +[DRMMODE_PLANE_TYPE] = {
> > +.name = "type",
> > +.enum_values = plane_type_enums,
> > +.num_enum_values = DRMMODE_PLANE_TYPE__COUNT,
> > +},
> > +[DRMMODE_PLANE_FB_ID] = { .name = "FB_ID", },
> > +[DRMMODE_PLANE_CRTC_ID] = { .name = "CRTC_ID", },
> > +[DRMMODE_PLANE_SRC_X] = { .name = "SRC_X", },
> > +[DRMMODE_PLANE_SRC_Y] = { .name = "SRC_Y", },
> > +};
> > +drmmode_prop_info_rec tmp_props[DRMMODE_PLANE__COUNT];
> 
> We use a stack allocated tmp_props here.

AFAICT the free(dst) is always wrong. The other places we use
drmmode_prop_info_copy, we're initializing an array in the middle of a
drmmode_{crtc,output}_private_rec.

- ajax

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel