This repository was archived by the owner on Nov 12, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 510
This repository was archived by the owner on Nov 12, 2025. It is now read-only.
'pmempool info/check' panic on CXL dax device #6160
Copy link
Copy link
Open
Labels
Type: BugA previously unknown bug in PMDKA previously unknown bug in PMDK
Description
ISSUE: 'pmempool info/check /dev/dax0.0' command will panic on CXL dax device
Environment Information
- PMDK package version(s): 1.13.1 and 2.1.1
- OS(es) version(s): Ubuntu 24.04
- ndctl version(s): 77
- kernel version(s): 6.14.0-29
- compiler, libraries, packaging and other related tools version(s): GCC11
Please provide a reproduction of the bug:
- On Ubuntu 24.04, download ndctl 77 and pmdk 1.3.1 packages;
- Build ndctl and pmdk
- Run pmempool on the other Ubuntu 24.04 machine with access to CXL device
How often bug is revealed: (always, often, rare): always
Actual behavior:
pmempool info/check command panic.
Expected behavior:
pmempool info/check command shall succeed.
Details
Old version (1.6.1) of pmdk can correctly get the CXL dax device size, but pmdk changed to use ndctl to get dax device size since 1.9 (probably), we always see panic when using pmempool info/check command built from pmdk v1.13.1/2.1.1 targeting CXL dax device.
Here's the call stack from the core dump,
(gdb) bt
#0 0x00007f384a5fe6c1 in ndctl_namespace_get_region (ndns=0x0) at ../ndctl/lib/libndctl.c:4220
#1 0x00007f384a5feada in ndctl_namespace_get_dax (ndns=0x0) at ../ndctl/lib/libndctl.c:4288
#2 0x000055dbf099c3cb in pmem2_device_dax_size ()
#3 0x000055dbf099b074 in pmem2_source_size ()
#4 0x000055dbf098f75e in util_fd_get_size ()
#5 0x000055dbf098f8b6 in util_file_map_whole ()
#6 0x000055dbf095aec0 in pmem_pool_parse_params ()
#7 0x000055dbf0952864 in pmempool_info_file ()
#8 0x000055dbf0953937 in pmempool_info_func ()
#9 0x000055dbf095216a in main ()
Checking on PMDK source code, it appears we failed to get ndctl namespace for the dax device in 'src/libpmem2/pmem2_utils_ndctl.c',
/*
* pmem2_device_dax_size -- checks the size of a given
* dax device from given source structure
*/
int
pmem2_device_dax_size(const struct pmem2_source *src, size_t *size)
{
int ret = 0;
struct ndctl_ctx *ctx;
struct ndctl_namespace *ndns;
errno = ndctl_new(&ctx) * (-1);
if (errno) {
ERR_W_ERRNO("ndctl_new");
return PMEM2_E_ERRNO;
}
ret = pmem2_region_namespace(ctx, src, NULL, &ndns);
if (ret) {
CORE_LOG_ERROR("getting region and namespace failed");
goto end;
}
struct ndctl_dax *dax = ndctl_namespace_get_dax(ndns);
if (dax) {
*size = ndctl_dax_get_size(dax);
} else {
ret = PMEM2_E_DAX_REGION_NOT_FOUND;
ERR_WO_ERRNO(
"Issue while reading Device Dax size - cannot find dax region");
}
end:
ndctl_unref(ctx);
LOG(4, "device size %zu", *size);
return ret;
}
Additional information about Priority and Help Requested:
Are you willing to submit a pull request with a proposed change? (Yes, No) No
Requested priority: (Showstopper, High, Medium, Low) Medium
Metadata
Metadata
Assignees
Labels
Type: BugA previously unknown bug in PMDKA previously unknown bug in PMDK