-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
podman top panics under certain conditions #169
Comments
The problem is that the CMD may contain space delimited data. i.e. http -D This throws the splitting of that line of data off by index. |
@rhatdan @mheon @TomSweeneyRedHat I've been noodling on this for a while... I havent stumbled on a great way to fix this. Do you guys have any ideas? Basically the issue is that we run a ps command inside the container and perform a strings.Field on the output which splits the string into a []string based on whitespace. Ideally ps could identify a field delimiter but that doesn't seem to be an option. I messed with OFS and awk but I don't think it is reliable. Moving 'cmd' output to the end of the output table could be an option, but it surely doesn't output then in the order the user asked for. However, there are alias shortcuts in ps that include cmd so we could not always control it. I also looked at the golang/psutil project and while good, it cannot support true ps options and would require a lot of wiring to make it work. |
@baude It would require some refactoring, but we could use the headers of the ps output to determine where the columns are in the output line and use that to split instead - get the index of the start of each word in the header, and then split at those indexes |
@mheon I looked into this a bit ... The problem I am seeing is that the column data line up is not reliable either. Consider the following:
Some line up to the header on the right, the left, and even in the middle! |
@baude Oh that's just lovely. And I take it we can't guarantee that CMD will always be the last entry, either? |
Nope ... think we might need to deep dive this a little deeper and see what others do |
Issue containers#169 describes a common failure when running podman top where if the commands inside the container container a space in them, podman will panic. This was occuring because we take the output from ps and attempt to format it nicely for output and things like JSON. Given that this cannot be predicted or dealt with programatically, the decision was made to deprecate the format switch and simply output what ps provides us. Migrated top integration tests to ginkgo. Resolves Issue: containers#169 Signed-off-by: baude <bbaude@redhat.com>
Issue #169 describes a common failure when running podman top where if the commands inside the container container a space in them, podman will panic. This was occuring because we take the output from ps and attempt to format it nicely for output and things like JSON. Given that this cannot be predicted or dealt with programatically, the decision was made to deprecate the format switch and simply output what ps provides us. Migrated top integration tests to ginkgo. Resolves Issue: #169 Signed-off-by: baude <bbaude@redhat.com> Closes: #291 Approved by: rhatdan
Fix tc-tbf burst value in bytes
Under certain conditions, podman top will panic with an index out of range error. To replicate:
And then:
It looks like the issue is around the default use of cmd in the ps options as removing that will allow it to work.
The text was updated successfully, but these errors were encountered: