Bug#895453: Disable check for NUL bytes in /proc/pid/cmdline

2018-04-11 Thread Sergio Durigan Junior
On Wednesday, April 11 2018, Paul-Antoine Arras wrote:

> Dear Maintainer,
>
> gdb incorrectly parses /proc/pid/cmdline, stopping at the first NUL
> byte encountered with a warning.
>
> * Steps to reproduce:
>
> $ gdb --args /bin/ls -l
> Reading symbols from /bin/ls...(no debugging symbols found)...done.
> (gdb) b _start
> Function "_start" not defined.
> Breakpoint 1 (_start) pending.
> (gdb) r
> Starting program: /bin/ls -l
>
> Breakpoint 1, 0x77dd9090 in _start () from
> /lib64/ld-linux-x86-64.so.2
> (gdb) info proc
> process 5618
> warning: target file /proc/5618/cmdline contained unexpected null characters
> cmdline = '/bin/ls'
> cwd = '/homes/parras'
> exe = '/bin/ls'
>
> This happens for all command lines with arguments.
>
> The bug has already been fixed quite some time ago:
> https://sourceware.org/ml/gdb-patches/2014-04/msg00204.html
> Not sure why the Debian version still has it...

This patch was posted upstream, but it wasn't incorporated into the
official repository until this year, when Andreas Arnez took it over and
pushed it:

  commit 26d6cec4a9291f154e549fb6f4318ace6cfaa2a5
  Author: Andreas Arnez 
  Date:   Thu Mar 22 10:02:18 2018 +0100

  Make "info proc cmdline" show args on GNU/Linux

The GDB version currently packaged in Debian is older and doesn't
include this commit.

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/


signature.asc
Description: PGP signature


Bug#895453: Disable check for NUL bytes in /proc/pid/cmdline

2018-04-11 Thread Paul-Antoine Arras

Package: gdb
Version: 7.12-6+b1
Severity: normal

Dear Maintainer,

gdb incorrectly parses /proc/pid/cmdline, stopping at the first NUL byte 
encountered with a warning.


* Steps to reproduce:

$ gdb --args /bin/ls -l
Reading symbols from /bin/ls...(no debugging symbols found)...done.
(gdb) b _start
Function "_start" not defined.
Breakpoint 1 (_start) pending.
(gdb) r
Starting program: /bin/ls -l

Breakpoint 1, 0x77dd9090 in _start () from 
/lib64/ld-linux-x86-64.so.2

(gdb) info proc
process 5618
warning: target file /proc/5618/cmdline contained unexpected null characters
cmdline = '/bin/ls'
cwd = '/homes/parras'
exe = '/bin/ls'

This happens for all command lines with arguments.

The bug has already been fixed quite some time ago: 
https://sourceware.org/ml/gdb-patches/2014-04/msg00204.html

Not sure why the Debian version still has it...

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.15.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8), 
LANGUAGE=en_GB:en (charmap=UTF-8)

Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages gdb depends on:
ii  libbabeltrace-ctf1  1.5.5-1
ii  libbabeltrace1  1.5.5-1
ii  libc6   2.27-3
ii  libexpat1   2.2.5-3
ii  liblzma55.2.2-1.3
ii  libncurses5 6.1-1
ii  libpython3.63.6.5-3
ii  libreadline77.0-3
ii  libtinfo5   6.1-1
ii  zlib1g  1:1.2.8.dfsg-5

Versions of packages gdb recommends:
ii  libc6-dbg [libc-dbg]  2.27-3

Versions of packages gdb suggests:
pn  gdb-doc
pn  gdbserver  

-- no debconf information
<>