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
/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


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