Manage system core dumps.
Provides access to core-file location after process exits and controlling the limits of core file sizes produced by the system. For systems that do not have resource modules, the functionality is essentially a no-op and performs empty functions in order to allow existing code to work.
Properties
sys
os0
contextlib0
functools0
location325%
location(pid)
Given a process identifier, return the location of the corefile based on the pattern.
constraint90%
constraint(image_size_limit)
Constrain core dumps during the execution of the context. Useful for managing tests that may dump core. Alternatively, enabled and disabled can be used as shorthands for clarity.
| WARNING | |
constraint is not thread safe. Concurrent execution will render inconsistent effects on the limit. |
When executed on systems where available is False, constraint does nothing.
Typical use:
with corefile.constraint(None):
...
Core dumps can disabled by designating zero size:
with corefile.constraint(0):
...
constraintParameters
enabled0
enabled = functools.partial(constraint, -1)
disabled0
disabled = functools.partial(constraint, 0)