pmem / pmemstream

Other
9 stars 13 forks source link

Assertion fault in span_get_region_runtime #99

Closed Karolina002 closed 2 years ago

Karolina002 commented 2 years ago

ISSUE:

assertion fault in span_get_region_runtime when passing invalid region offset

The bug reproduction:

struct pmemstream_region region = {.offset = ALIGN_DOWN(UINT64_MAX, sizeof(span_bytes))};
ret = pmemstream_reserve(stream, region, NULL, sizeof(data), &entry, &data_address);

How often bug is revealed:

always

Actual behavior:

 __GI___assert_fail (assertion=0x7ffff7f226f0 "span_get_type(span) == SPAN_REGION", 
span_get_region_runtime () at /PMDK/pmemstream/src/span.c:121
pmemstream_reserve () at /PMDK/pmemstream/src/libpmemstream.c:166
invalid_region_test () at /PMDK/pmemstream/tests/api_c/reserve_and_publish.c:85
main () at /PMDK/pmemstream/tests/api_c/reserve_and_publish.c:189
lukaszstolarczuk commented 2 years ago

@Karolina002, please re-check this issue, I'm not sure if this is still an issue (after some recent @igchor's change). Perhaps the error changed, but at least we're no longer getting an assert, I believe.

Karolina002 commented 2 years ago

No longer an issue after code changes.