Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #77702

Bug#1024811: linux: /proc/[pid]/stat unparsable

From Donald Buczek <buczek@molgen.mpg.de>
Newsgroups linux.debian.bugs.dist, linux.debian.kernel
Subject Bug#1024811: linux: /proc/[pid]/stat unparsable
Date 2022-12-23 10:20 +0100
Message-ID <FFMnD-cEHD-5@gated-at.bofh.it> (permalink)
References (4 earlier) <FFAwa-ctCA-7@gated-at.bofh.it> <FFLUB-cEgU-1@gated-at.bofh.it> <FFM4h-cEkg-1@gated-at.bofh.it> <FvKwN-6gwg-9@gated-at.bofh.it> <FFM4h-cEkg-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


On 12/23/22 09:49, Thorsten Glaser wrote:
> Donald Buczek dixit:
> 
>> To be fair, this daemon doesn't use /proc/pid/stat for that, but /proc/pid/comm
> 
> Yes, and that’s proper. The field in /proc/pid/stat is size-limited
> and so not necessarily distinct.

No, it is the process name itself, which is size limited, so in this regard it doesn't make a difference if you read it from /proc/pid/stat or /proc/pid/comm.

>> As /proc/pid/stat is also used in many places, it could as well use
>> that to avoid code duplication or reuse data already read from the
>> other source.
> 
> No, because the data in /stat is incomplete *and* anything using
> it that would be affected by escaping was already broken.

"Incomplete" because if truncation?

The usage in my example is not already broken. Truncation doesn't happen, because the process name used is the fixed string "mxqd reaper".

A process name is limited to 15 characters. The limit is already in force when you use PR_SET_NAME, so there is no truncation when you read it back from procfs.

D.

> 
> bye,
> //mirabilos

-- 
Donald Buczek
buczek@molgen.mpg.de
Tel: +49 30 8413 1433

Back to linux.debian.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Bug#1024811: linux: /proc/[pid]/stat unparsable Thorsten Glaser <tg@mirbsd.de> - 2022-11-25 18:20 +0100
  Bug#1024811: linux: /proc/[pid]/stat unparsable Thorsten Glaser <tg@debian.org> - 2022-11-25 18:40 +0100
  Bug#1024811: linux: /proc/[pid]/stat unparsable Thorsten Glaser <tg@mirbsd.de> - 2022-12-22 02:10 +0100
    Bug#1024811: Re: Bug#1024811: linux: /proc/[pid]/stat unparsable Donald Buczek <buczek@molgen.mpg.de> - 2022-12-22 15:00 +0100
      Bug#1024811: Re: Bug#1024811: linux: /proc/[pid]/stat unparsable Thorsten Glaser <tg@mirbsd.de> - 2022-12-22 21:40 +0100
        Bug#1024811: linux: /proc/[pid]/stat unparsable Donald Buczek <buczek@molgen.mpg.de> - 2022-12-23 09:50 +0100
          Bug#1024811: linux: /proc/[pid]/stat unparsable Thorsten Glaser <tg@mirbsd.de> - 2022-12-23 10:00 +0100
            Bug#1024811: linux: /proc/[pid]/stat unparsable Donald Buczek <buczek@molgen.mpg.de> - 2022-12-23 10:20 +0100

csiph-web