GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
* Sign Up! *

Support
Customer Portal
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
UCOREDEV(4) FreeBSD Kernel Interfaces Manual UCOREDEV(4)

ucoredevuser coredump extraction interface

To load the driver as a module at boot time, place the following line in loader.conf(5):

ucoredev_load="YES"

Note that ucored(8) will attempt to autoload


ucoredev when it starts, if it has not been loaded.

The ucoredev device is used to extract user coredumps from the kernel. When ucoredev is loaded, it uses the coredumper_register(9) interface to claim all coredump collection. When a user process subsequently dumps core, ucoredev processes it and writes that into a shared memory object for later extraction.

A read(2) from ucoredev will then materialize that coredump into a shmfd, as if the process reading had called shm_open(2) itself to create an anonymous shared memory object. ucoredev does not retain any references to the coredump after it has been read(2) from the device, so a subsequent close(2) will discard the coredump entirely if it has not been persisted to disk by the reader.

Note that ucoredev will create and return as many file descriptors as will fit into the buffer provided. If it fails to create a file descriptor, ucoredev will retain the core until a subsequent read(2) in case the failure was a transient condition.

The ucoredev device will frame coredumps with its own header for various metadata that it collects about the process that was dumped. The data structures in <ucoredev.h> should be used to process the coredump. It is expected that a process would mmap(2) the shm fd that is returned and map out the header, data segments, and coredump data there.

Each shm object will begin with a struct ucore, which records all of the numeric properties that are necessary for every coredump. The ucore_datasegs member describes how many struct ucore_data segments will follow. The size of the coredump is encoded in ucore_size for convenience, so that one need not parse through all of the data segments to get to the data.

Data segments are mostly used for string properties of the jail. Each segment begins with a struct ucore_data_hdr that describes the type of data, and the size of the data that will follow. The uhdr_size does not include the size of the header itself.

Note that the header may be padded more than expected to align the ud_data element sufficiently for any data that we may want to extract and ud_data is a VLA, so (struct ucore_data) describes the position of the data relative to the struct before it more accurately than sizeof(struct ucore_data_hdr) would.

Metadata ends at the last data segment, only the coredump itself follows.

July 27, 2025 FreeBSD 15.1-RELEASE

Search for    or go to Top of page |  Section 4 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.