Skip to content
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

open_files() on BSD reports null paths #595

Closed
giampaolo opened this issue Feb 19, 2015 · 7 comments
Closed

open_files() on BSD reports null paths #595

giampaolo opened this issue Feb 19, 2015 · 7 comments

Comments

@giampaolo
Copy link
Owner

giampaolo commented Feb 19, 2015

======================================================================
FAIL: test_open_files (__main__.TestProcess)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_psutil.py", line 1656, in test_open_files
    self.assertIn(TESTFN, filenames)
AssertionError: '/usr/home/user/psutil/$testfile' not found in ['/usr/local/bin/python2.7', '']

======================================================================
FAIL: test_open_files2 (__main__.TestProcess)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_psutil.py", line 1684, in test_open_files2
    self.assertEqual(path, fileobj.name)
AssertionError: '' != '/usr/home/user/psutil/$testfile'

This comes straight from kinfo_getfile(). The open file is there (you can tell from the fd) but the path is an empty string. Also procstat utility (procstat -f {PID}) which internally uses kinfo_getfile() has the same problem (also when running as root). Apparently the only tool which doesn't have this problem is lsof (but the code is a mess).

@giampaolo
Copy link
Owner Author

giampaolo commented Feb 19, 2015

Test disabled as of b8f444d

@giampaolo
Copy link
Owner Author

giampaolo commented Nov 12, 2015

Note: OpenBSD has the same problem.

@giampaolo
Copy link
Owner Author

giampaolo commented May 18, 2017

@glebius is this something you may wanna look at?

@giampaolo
Copy link
Owner Author

giampaolo commented May 18, 2017

Actually I think this may be a kernel bug. Maybe we should report this to freebsd-dev.

@glebius
Copy link
Contributor

glebius commented May 18, 2017

test_open_files2 no longer exists. What is the modern name of this test?

@glebius
Copy link
Contributor

glebius commented May 18, 2017

Found it. It works :)

@giampaolo
Copy link
Owner Author

giampaolo commented Dec 17, 2020

Closing out as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants