Closed scop closed 8 years ago
The PR_SET_PTRACER
code should only be needed under yama (which is to say, ~recent Ubuntu kernels, effectively). Does https://github.com/nelhage/reptyr/pull/70 do anything good?
Yes, that fixes the compilation. The actual tests still end up failing:
$ make test
python test/basic.py
python test/tty-steal.py
Traceback (most recent call last):
File "test/tty-steal.py", line 12, in <module>
prctl.set_ptracer(PR_SET_PTRACER_ANY)
AttributeError: 'module' object has no attribute 'set_ptracer'
make: *** [test] Error 1
But I suppose that prctl stuff isn't needed either? If so, would be nice if the prctl python module would be required only wherever its set_ptracer would do any good.
Just pushed another commit on that branch – does that do any good?
It does, however of course the prctl python module is still required even if it doesn't end up being used.
Yeah – is that problematic in some way? I'm not sure of an easy way to check whether it's necessary. I could grub around for the yama sysctls, but that seems unsatisfactory.
python-prctl is not available (in packaged form) in Fedora or EPEL so I'm going to have to patch it out. Not a big problem. But if you still want to consider doing something about this and autodetection is messy/unsatisfactory, perhaps do the Python prctl stuff only if it's not disabled via an environment variable, like SKIP_PRCTL=1 make test
and
if not os.environ.get("SKIP_PRCTL"):
import prctl
# rest of that stuff
Got it. Just pushed a change that will just swallow the ImportError
with a warning message. That passes tests on my CentOS 5 VM, and I think should also work on Travis. I'll merge assuming it does.
On CentOS 6 (kernel-headers-2.6.32):
I suppose PR_SET_PTRACER was added in kernel 3.4. Not sure what can be done about this, but if nothing else, document it?