Skip to content

Method isTraced is implemented incorrectly #82

Description

@gipi

The implementation

class PTraceProcess:
  ...
    def isTraced(self):
        if not HAS_PROC:
            self.notImplementedError()
        stat = readProcessStat(self.pid)
        return (stat.state == 'T')

is checking for T, but that is for stopped by a signal; from man proc:

       /proc/[pid]/stat
              Status information about the process.  This is used by ps(1).  It is defined in the kernel source file fs/proc/array.c.
              ...
              (3) state  %c
                     One of the following characters, indicating process state:

                    ....
                     T  Stopped (on a signal) or (before Linux 2.6.33) trace stopped

                     t  Tracing stop (Linux 2.6.33 onward)

should be t. Probably class ProcessState needs reworking too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions