delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/12/05/09:40:17

X-Spam-Check-By: sourceware.org
Date: Mon, 5 Dec 2005 09:40:01 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
Subject: cygcheck bug when listing services (Was Re: Parallel writes to a single FIFO do not queue, and deadlock cygwin)
In-Reply-To: <5a97ceb0512042223i404ebffeuff5546e2345df965@mail.gmail.com>
Message-ID: <Pine.GSO.4.63.0512050924150.13495@slinky.cs.nyu.edu>
References: <5a97ceb0512042223i404ebffeuff5546e2345df965 AT mail DOT gmail DOT com>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Sun, 4 Dec 2005, Mark Piper wrote:

> P.S.  Here is the full output from cygcheck
>
> $ /bin/cygcheck.exe -s
>
> Cygwin Configuration Diagnostics
> [snip]
>   1265k 2005/07/03 C:\cygwin\bin\cygwin1.dll
>     Cygwin DLL version info:
>         DLL version: 1.5.18
>         DLL epoch: 19
>         DLL bad signal mask: 19005
>         DLL old termios: 5
>         DLL malloc env: 28
>         API major: 0
>         API minor: 132
>         Shared data: 4
>         DLL identifier: cygwin1
>         Mount /usr/bin/cygrunsrv: Exactly one of --install, --remove,
> --start, --stop, --query, or --list is required
> Try `/usr/bin/cygrunsrv --help' for more information.
> registry: 2
>         Cygnus registry name: Cygnus Solutions
>         Cygwin registry name: Cygwin
>         Program options name: Program Options
>         Cygwin mount registry name: mounts v2
>         Cygdrive flags: cygdrive flags
>         Cygdrive prefix: cygdrive prefix
>         Cygdrive default prefix:
>         Build date: Sat Jul 2 20:30:04 EDT 2005
>         Shared id: cygwin1S4
>
>
> Service             : sshd
> Display name        : CYGWIN sshd
> Current State       : Running
> Controls Accepted   : Stop
> Command             : /usr/sbin/sshd -D

Note the cygrunsrv error message above.  I was able to reproduce it in
non-verbose mode.

Running cygcheck under strace shows that after listing all the available
services, it invokes "cygrunsrv --query grunsrv.exe --list", which results
in the above message.  I think this may be because the output of
"cygrunsrv --list" doesn't contain a trailing '\n', and so strtok gets
confused.  The following patch (against a slightly older cygcheck) fixes
it for me, but I haven't had the time to test it extensively:

Index: cygcheck.cc
===================================================================
RCS file: /cvs/src/src/winsup/utils/cygcheck.cc,v
retrieving revision 1.77
diff -u -p -r1.77 cygcheck.cc
--- cygcheck.cc 17 Aug 2005 00:52:43 -0000      1.77
+++ cygcheck.cc 5 Dec 2005 14:37:58 -0000
@@ -950,8 +950,8 @@ dump_sysinfo_services ()
   else
     {
       /* read the output of --list, and then run --query for each service */
-      size_t nchars = fread ((void *) buf, 1, sizeof (buf) - 1, f);
-      buf[nchars] = 0;
+      size_t nchars = fread ((void *) buf, 1, sizeof (buf) - 2, f);
+      buf[nchars] = buf[nchars+1] = 0;
       pclose (f);

       if (nchars > 0)

HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019