XCMSDB stdin handling broke in v 1.0.3 -> 1.0.4

Alan Coopersmith alan.coopersmith at oracle.com
Mon May 12 10:26:50 PDT 2014


It looks like that change came from Jeremy's fixes for static analysis:
http://cgit.freedesktop.org/xorg/app/xcmsdb/commit/?id=f872b47cb606d448766c1fa750709fd06a8a6904

Sorry, but I'm not going to have time to work on fixing this soon, so I'm
cc'ing the mailing list in case someone else has time to fix.   (Filing a
bug could help track it so it's not forgotten, but it may still take years
for anyone to find time to work on xcmsdb bugs, especially since few of
our current developers know what it does.)

	-alan-

On 05/12/14 05:05 AM, C. Alex. North-Keys wrote:
> Hi Alan,
>
> I noticed that my X environment was persistently lighter after upgrading
> from Ubuntu 12.04 to 14.04, and the problem seems to be that xcmsdb
> 1.0.4 no longer reads standard input by default - or at all, actually.
>
> The problem is that the changes to xcmsdb.c break the stdin default. The
> new code apparently assumes that load is always set, and that query or
> remove should disable it.  However, load was/is ONLY set if an arg is
> given, so the old code checked for not query && not remove.  The new
> code tries to check load directly, and it doesn't work.
>
> Deployed command that broke:   $HOME/.xcmsdb.sccd | xcmsdb
>
> At the point the following code is reached, query == False, remove ==
> False, and load == False (since no arguments were given).
>
> 1.0.3
>
>      if (load && query) {
>          load = 0;
>      }
>      if (load && remove) {
>          load = 0;
>      }
>
>      if (!query && !remove) {
>          LoadSCCData(dpy, DefaultScreen(dpy), filename, targetFormat);
>      }
>
> 1.0.4
>
>      if (query || remove) {
>          load = 0;
>      }
>
>      if (load) {
>          LoadSCCData(dpy, DefaultScreen(dpy), filename, targetFormat);
>      }
>
> Rewriting the handling to allow multiple actions (like  "<cmd> .... |
> xcmsdb -remove -  -query' to clear, load from stdin, and query) might be
> worthwhile, but otherwise, at least reverting it would bring it back to
> working as documented.  Fixing main() to return a useful error code
> instead of that weird "exit (0);" would have been another nice candidate.
>
> Despite all this, thanks to you and Nadon and Huddleson for caring about
> this program.
>
>
>
>
>


-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list