Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Truncated output if process being tracked ends before data gathered

Ouverte
#250 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
c, linux
Domaine
observability

Piste de recherche

Start with pidstat's average-output path, especially how it handles a tracked process that exits before the first data sample. Reproduce the issue with a PID that disappears before collection and inspect the output for that process. Done means pidstat prints the remaining average output instead of truncating it.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

sysstat version 10.1.5

I am running a script that will find several processes that I want to track, and then track them for a while with a pidstat command. I run the script in a loop because any of the processes may exit and restart, and I want to start tracking the new ones reasonably quickly.
Anyway... I am getting truncate output like this sometimes from pidstat:

Average:      UID       PID  minflt/s  majflt/s     VSZ    RSS   %MEM  Command
Average:      997     24053     15.14      0.00 9347066 4783839  30.52  java
Average:      990     25271      1.54      0.00 6930412 1205929   7.69  java
Average:        0     28779      0.00      0.00

Any output that should follow is lost.

I am reasonably sure what is happening is that my process picker was getting a short lived process that wasn't intended. When pidstat started, that process exists, but by the first round of data gathering it is gone. So it doesn't appear in any of the regular output lines above the average section. When pidstat gets to the point of printing the average, it knows it should print for that process, but has no data, and bombs out.
Fixing is probably just a matter of ensuring a default value for VSZ and any other stats to cover this possible situation.

While you would think it would be rare, it actually happens a lot over the course of a day... I am running pidstat every 5 minutes with an updated pid list, and it happens at least 10 times a day.

For me, I just fixed my picker to solve the problem. But thought I would let you know what I was seeing. Thanks for the effort on this great tool.

Langage dominant
C
Étoiles
3.4k
Forks
490
Merge moyen
4 j 37 min
PR mergées (30 j)
4

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de sysstat/sysstat

Toutes les issues de sysstat/sysstat

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.