-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
Bug
Exposed by crashing after freeing the hash table in clht_gc_free.
Lines 239 to 242 in fc508dd
| PMEMoid table_oid = {pool_uuid, hashtable->table_off}; | |
| pmemobj_free(&table_oid); | |
| PMEMoid ht_oid = pmemobj_oid((void *)hashtable); | |
| pmemobj_free(&ht_oid); |
pmemobj_freesets the PMEMoid object to NULL when freeing objects.- With the current design of storing the offset in
hashtable->table_off, the offset is never set to null, and so a crash can cause a double-free to occur.
Steps to reproduce
gdb --args ./example 20 20
> break clht_gc.c:241
> run
> quit
# Then, re-run
./example 20 0Will output something like:
Simple Example of P-CLHT
operation,n,ops/s
Throughput: load, inf ,ops/us
Throughput: run, inf ,ops/us
<libpmemobj>: <1> [palloc.c:295 palloc_heap_action_exec] assertion failure: 0
Metadata
Metadata
Assignees
Labels
No labels