From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18066 invoked by alias); 17 Oct 2011 08:34:33 -0000 Received: (qmail 17912 invoked by uid 22791); 17 Oct 2011 08:34:31 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from sam.nabble.com (HELO sam.nabble.com) (216.139.236.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 Oct 2011 08:34:17 +0000 Received: from isper.nabble.com ([192.168.236.156]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1RFieG-0004Xi-Q2 for cygwin@cygwin.com; Mon, 17 Oct 2011 01:34:16 -0700 Message-ID: <32665348.post@talk.nabble.com> Date: Mon, 17 Oct 2011 08:34:00 -0000 From: "jan.kolar" To: cygwin@cygwin.com Subject: Re: /proc/*/cmdline corrupted In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <32663265.post@talk.nabble.com> X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-10/txt/msg00309.txt.bz2 > I've checked and on Linux (at least) xterm's command line is not > corrupted. That means: unchanged ? Or, with -sl 2000 +tb removed ? A version (!) of xterm on Linux, which does not know +tb option, does not change cmdline. > From looking at the xterm code, it would appear that the X > libraries would have to be what is corrupting the command line. I > didn't look into the X library (XmParseCommand). Well, it depends whether it is xterm's intention to change the command line. (And this would be a topic for cygwin-apps list I think.) For example sendmail likes to do that (on Linux): root 3051 sendmail: accepting connections smmsp 3061 sendmail: Queue runner@00:01:00 for /var/spool/clientmqueue root 14631 sendmail: server [1.46.244.248] cmd read root 15254 sendmail: ./p9CDUban025571 mail3.cae3.com.: user open entries of sendmail are not nullterminated (!). Others have set (on Linux) a number of NULL pointers: 0000000 i n i t [ 3 ] \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 0000000 l p d W a i t i n g \0 \0 \0 Hence, XmParseCommand() would do better job if it would zero all unused argv[index], not just the first unused one. --- * On the side of cygwin, the question is 1. whether /proc should show the current content of command line, that is, what is the standard today. (I think at least $0 should have the current value, I do not know about others.) The "\0 \0 \0" above suggests that the Linux's behavior = cygwin's behavior. 2. How it should interpret NULL pointers in the array, either as "for (int i = 0; i < __argc_safe; i++)" or as "for (char **a = __argv; *a; a++)". Both are present in pinfo.cc. The "\0 \0 \0" above suggests that the Linux does it the first way. (Note that the implications of "\0 \0 \0" and other observations are no more than my speculations, that cannot replace a look at the code. :-) ) -- View this message in context: http://old.nabble.com/-proc-*-cmdline-corrupted-tp32639066p32665348.html Sent from the Cygwin list mailing list archive at Nabble.com. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple