From: Pedro Alves <palves@redhat.com>
To: Vladimir Nikulichev <nvs@tbricks.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Disable check for NUL bytes in /proc/pid/cmdline
Date: Fri, 11 Apr 2014 18:18:00 -0000 [thread overview]
Message-ID: <534831EC.1050703@redhat.com> (raw)
In-Reply-To: <web-7508899@mx2.tbricks.com>
On 04/11/2014 03:28 PM, Vladimir Nikulichev wrote:
> When I execute gcore on a process, it prints warning that
> /proc/pid/cmdline
> contains null characters:
>
> $ gcore 18706
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib64/libthread_db.so.1".
> 0x00007fa23be3c5c3 in __select_nocancel () from /lib64/libc.so.6
> warning: target file /proc/18706/cmdline contained unexpected null
> characters
> Saved corefile core.18706
>
> There's nothing wrong, null characters separate command line arguments
> from
> each other. This fix disables the check when reading cmdline.
This also affects "info proc cmdline", which ignores all arguments
but the first. Seems to me we should stop thinking of cmdline
as a single string at all, thus read it with
target_fileio_read_alloc as one block, and then "parsing" the
result, extracting/printing all arguments.
--
Pedro Alves
prev parent reply other threads:[~2014-04-11 18:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-11 14:29 Vladimir Nikulichev
2014-04-11 16:36 ` Sergio Durigan Junior
2014-04-11 18:18 ` Pedro Alves [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=534831EC.1050703@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=nvs@tbricks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox