corefile2929%python.module
fault.system

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

available

Whether or not core-file controls is available.

sys
import

os0
import

contextlib0
import

functools0
import

location325%
function

location(pid)

Given a process identifier, return the location of the corefile based on the pattern.

constraint90%
function

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

image_size_limit

The limit of the core file's size emitted by the system. A size of 0 will disable core files from being generated.

getrlimit

Undocumented.

setrlimit

Undocumented.

rtype

Undocumented.

enabled0
data

enabled = functools.partial(constraint, -1)

disabled0
data

disabled = functools.partial(constraint, 0)