This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: /proc/*/cmdline corrupted

> 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
       root     14631 sendmail: server [] cmd read
       root     15254 sendmail: ./p9CDUban025571 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 
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
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
  The "\0 \0 \0" above suggests that the Linux's behavior = cygwin's

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 
  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:*-cmdline-corrupted-tp32639066p32665348.html
Sent from the Cygwin list mailing list archive at

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]