Giter Club home page Giter Club logo

thmap's People

Contributors

riastradh avatar rmind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

thmap's Issues

thmap_create tests wrong value for allocation failure

On allocation failure, the alloc operation returns zero, but thmap_create tests whether the THMAP_GETPTR-relocated pointer is null instead:

thmap/src/thmap.c

Lines 896 to 898 in 8149b27

root = thmap->ops->alloc(THMAP_ROOT_LEN);
thmap->root = THMAP_GETPTR(thmap, root);
if (!thmap->root) {

This is in contrast to all the other allocation failure tests, such as:

thmap/src/thmap.c

Lines 312 to 315 in 8149b27

p = thmap->ops->alloc(THMAP_INODE_LEN);
if (!p) {
return NULL;
}

However, t_thmap.c allocates starting from zero. So it can't actually represent failure:

thmap/src/t_thmap.c

Lines 19 to 20 in 8149b27

static unsigned space_allocated = 0;
static unsigned char space[42500];

thmap/src/t_thmap.c

Lines 240 to 245 in 8149b27

alloc_test_wrapper(size_t len)
{
uintptr_t p = space_allocated;
space_allocated += roundup2(len, sizeof(void *));
assert(space_allocated <= sizeof(space));
return p;

sanitize=undefined

$ make tests CC=clang
clang -std=c11 -O2 -g -Wall -Wextra -Werror -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wno-unknown-warning-option  -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings -Wold-style-definition -Wsuggest-attribute=noreturn -Wjump-misses-init -Wduplicated-cond -Wmisleading-indentation -Wnull-dereference -Wduplicated-branches -Wrestrict -Og -DDEBUG -fno-omit-frame-pointer -fsanitize=undefined   -c -o thmap.o thmap.c
clang -std=c11 -O2 -g -Wall -Wextra -Werror -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wno-unknown-warning-option  -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings -Wold-style-definition -Wsuggest-attribute=noreturn -Wjump-misses-init -Wduplicated-cond -Wmisleading-indentation -Wnull-dereference -Wduplicated-branches -Wrestrict -Og -DDEBUG -fno-omit-frame-pointer -fsanitize=undefined   -c -o murmurhash.o murmurhash.c
clang -std=c11 -O2 -g -Wall -Wextra -Werror -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wno-unknown-warning-option  -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings -Wold-style-definition -Wsuggest-attribute=noreturn -Wjump-misses-init -Wduplicated-cond -Wmisleading-indentation -Wnull-dereference -Wduplicated-branches -Wrestrict -Og -DDEBUG -fno-omit-frame-pointer -fsanitize=undefined   -c -o t_thmap.o t_thmap.c
clang -std=c11 -O2 -g -Wall -Wextra -Werror -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wno-unknown-warning-option  -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings -Wold-style-definition -Wsuggest-attribute=noreturn -Wjump-misses-init -Wduplicated-cond -Wmisleading-indentation -Wnull-dereference -Wduplicated-branches -Wrestrict -Og -DDEBUG -fno-omit-frame-pointer -fsanitize=undefined thmap.o murmurhash.o t_thmap.o -o t_thmap
MALLOC_CHECK_=3 ./t_thmap
thmap.c:204:16: runtime error: member access within misaligned address 0x55eb709da19c for type 'const thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:204:16 in 
thmap.c:204:16: runtime error: load of misaligned address 0x55eb709da19c for type 'const uint32_t' (aka 'const unsigned int'), which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:204:16 in 
thmap.c:334:2: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:334:2 in 
thmap.c:334:2: runtime error: load of misaligned address 0x55eb709da1a4 for type 'thmap_ptr_t' (aka 'unsigned long'), which requires 8 byte alignment
0x55eb709da1a4: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:334:2 in 
thmap.c:335:2: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:335:2 in 
thmap.c:335:2: runtime error: load of misaligned address 0x55eb709da19c for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:335:2 in 
thmap.c:336:2: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:336:2 in 
thmap.c:336:2: runtime error: load of misaligned address 0x55eb709da21c for type 'thmap_ptr_t' (aka 'unsigned long'), which requires 8 byte alignment
0x55eb709da21c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:336:2 in 
thmap.c:338:2: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:338:2 in 
thmap.c:338:2: runtime error: load of misaligned address 0x55eb709da19c for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:338:2 in 
thmap.c:340:8: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:340:8 in 
thmap.c:340:2: runtime error: store to misaligned address 0x55eb709da21c for type 'thmap_ptr_t' (aka 'unsigned long'), which requires 8 byte alignment
0x55eb709da21c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:340:2 in 
thmap.c:341:8: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:341:8 in 
thmap.c:385:9: runtime error: member access within misaligned address 0x55eb709da22c for type 'thmap_leaf_t', which requires 8 byte alignment
0x55eb709da22c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 01 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:385:9 in 
thmap.c:385:9: runtime error: store to misaligned address 0x55eb709da22c for type 'thmap_ptr_t' (aka 'unsigned long'), which requires 8 byte alignment
0x55eb709da22c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 01 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:385:9 in 
thmap.c:390:8: runtime error: member access within misaligned address 0x55eb709da22c for type 'thmap_leaf_t', which requires 8 byte alignment
0x55eb709da22c: note: pointer points here
  00 00 00 00 c4 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 01 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:390:8 in 
thmap.c:390:8: runtime error: store to misaligned address 0x55eb709da234 for type 'size_t' (aka 'unsigned long'), which requires 8 byte alignment
0x55eb709da234: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:390:8 in 
thmap.c:391:8: runtime error: member access within misaligned address 0x55eb709da22c for type 'thmap_leaf_t', which requires 8 byte alignment
0x55eb709da22c: note: pointer points here
  00 00 00 00 c4 02 00 00  00 00 00 00 04 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 01 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:391:8 in 
thmap.c:391:8: runtime error: store to misaligned address 0x55eb709da23c for type 'void *', which requires 8 byte alignment
0x55eb709da23c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:391:8 in 
thmap.c:482:39: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:482:39 in 
thmap.c:493:36: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:493:36 in 
thmap.c:214:34: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:214:34 in 
thmap.c:225:7: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:225:7 in 
thmap.c:527:6: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 01 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:527:6 in 
thmap.c:527:6: runtime error: load of misaligned address 0x55eb709da19c for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 01 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:527:6 in 
thmap.c:536:39: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 01 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:536:39 in 
thmap.c:616:41: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 01 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:616:41 in 
thmap.c:235:21: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 02 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:235:21 in 
thmap.c:235:21: runtime error: load of misaligned address 0x55eb709da19c for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 02 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:235:21 in 
thmap.c:239:31: runtime error: member access within misaligned address 0x55eb709da19c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da19c: note: pointer points here
  00 00 00 00 02 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:239:31 in 
thmap.c:302:24: runtime error: member access within misaligned address 0x55eb709dac5c for type 'const thmap_leaf_t', which requires 8 byte alignment
0x55eb709dac5c: note: pointer points here
  00 00 00 00 f4 0c 00 00  00 00 00 00 04 00 00 00  00 00 00 00 11 00 00 00  00 00 00 00 11 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:302:24 in 
thmap.c:302:24: runtime error: load of misaligned address 0x55eb709dac5c for type 'const thmap_ptr_t' (aka 'const unsigned long'), which requires 8 byte alignment
0x55eb709dac5c: note: pointer points here
  00 00 00 00 f4 0c 00 00  00 00 00 00 04 00 00 00  00 00 00 00 11 00 00 00  00 00 00 00 11 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:302:24 in 
thmap.c:303:22: runtime error: member access within misaligned address 0x55eb709dac5c for type 'const thmap_leaf_t', which requires 8 byte alignment
0x55eb709dac5c: note: pointer points here
  00 00 00 00 f4 0c 00 00  00 00 00 00 04 00 00 00  00 00 00 00 11 00 00 00  00 00 00 00 11 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:303:22 in 
thmap.c:303:22: runtime error: load of misaligned address 0x55eb709dac64 for type 'const size_t' (aka 'const unsigned long'), which requires 8 byte alignment
0x55eb709dac64: note: pointer points here
  00 00 00 00 04 00 00 00  00 00 00 00 11 00 00 00  00 00 00 00 11 00 00 00  01 00 00 80 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:303:22 in 
thmap.c:325:9: runtime error: member access within misaligned address 0x55eb709dbfac for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709dbfac: note: pointer points here
  40 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:325:9 in 
thmap.c:325:9: runtime error: store to misaligned address 0x55eb709dbfac for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment
0x55eb709dbfac: note: pointer points here
  40 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:325:9 in 
thmap.c:326:9: runtime error: member access within misaligned address 0x55eb709dbfac for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709dbfac: note: pointer points here
  40 00 00 00 00 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:326:9 in 
thmap.c:326:9: runtime error: store to misaligned address 0x55eb709dbfb4 for type 'thmap_ptr_t' (aka 'unsigned long'), which requires 8 byte alignment
0x55eb709dbfb4: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:326:9 in 
thmap.c:280:20: runtime error: member access within misaligned address 0x55eb709dac5c for type 'const thmap_leaf_t', which requires 8 byte alignment
0x55eb709dac5c: note: pointer points here
  00 00 00 00 f4 0c 00 00  00 00 00 00 04 00 00 00  00 00 00 00 11 00 00 00  00 00 00 00 11 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:280:20 in 
thmap.c:280:20: runtime error: load of misaligned address 0x55eb709dac5c for type 'const thmap_ptr_t' (aka 'const unsigned long'), which requires 8 byte alignment
0x55eb709dac5c: note: pointer points here
  00 00 00 00 f4 0c 00 00  00 00 00 00 04 00 00 00  00 00 00 00 11 00 00 00  00 00 00 00 11 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:280:20 in 
thmap.c:285:33: runtime error: member access within misaligned address 0x55eb709dac5c for type 'const thmap_leaf_t', which requires 8 byte alignment
0x55eb709dac5c: note: pointer points here
  00 00 00 00 f4 0c 00 00  00 00 00 00 04 00 00 00  00 00 00 00 11 00 00 00  00 00 00 00 11 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:285:33 in 
thmap.c:285:33: runtime error: load of misaligned address 0x55eb709dac64 for type 'const size_t' (aka 'const unsigned long'), which requires 8 byte alignment
0x55eb709dac64: note: pointer points here
  00 00 00 00 04 00 00 00  00 00 00 00 11 00 00 00  00 00 00 00 11 00 00 00  01 00 00 80 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:285:33 in 
thmap.c:670:33: runtime error: member access within misaligned address 0x55eb709da5a4 for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da5a4: note: pointer points here
  06 00 00 00 02 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:670:33 in 
thmap.c:409:39: runtime error: member access within misaligned address 0x55eb709df994 for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 02 00 00 00  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:409:39 in 
thmap.c:573:15: runtime error: member access within misaligned address 0x55eb709da22c for type 'thmap_leaf_t', which requires 8 byte alignment
0x55eb709da22c: note: pointer points here
  00 00 00 00 c4 02 00 00  00 00 00 00 04 00 00 00  00 00 00 00 01 00 00 00  00 00 00 00 01 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:573:15 in 
thmap.c:573:15: runtime error: load of misaligned address 0x55eb709da23c for type 'void *', which requires 8 byte alignment
0x55eb709da23c: note: pointer points here
  00 00 00 00 01 00 00 00  00 00 00 00 01 00 00 00  0a 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:573:15 in 
thmap.c:721:2: runtime error: member access within misaligned address 0x55eb709df994 for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 02 00 00 80  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:721:2 in 
thmap.c:348:2: runtime error: member access within misaligned address 0x55eb709df994 for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 02 00 00 80  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:348:2 in 
thmap.c:348:2: runtime error: load of misaligned address 0x55eb709df994 for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 02 00 00 80  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:348:2 in 
thmap.c:349:2: runtime error: member access within misaligned address 0x55eb709df994 for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 02 00 00 80  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:349:2 in 
thmap.c:349:2: runtime error: load of misaligned address 0x55eb709dfa0c for type 'thmap_ptr_t' (aka 'unsigned long'), which requires 8 byte alignment
0x55eb709dfa0c: note: pointer points here
  00 00 00 00 01 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 bc 5a 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:349:2 in 
thmap.c:351:2: runtime error: member access within misaligned address 0x55eb709df994 for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 02 00 00 80  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:351:2 in 
thmap.c:351:2: runtime error: load of misaligned address 0x55eb709df994 for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 02 00 00 80  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:351:2 in 
thmap.c:352:2: runtime error: member access within misaligned address 0x55eb709df994 for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 02 00 00 80  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:352:2 in 
thmap.c:352:2: runtime error: load of misaligned address 0x55eb709df994 for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 02 00 00 80  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:352:2 in 
thmap.c:354:8: runtime error: member access within misaligned address 0x55eb709df994 for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 02 00 00 80  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:354:8 in 
thmap.c:354:2: runtime error: store to misaligned address 0x55eb709dfa0c for type 'thmap_ptr_t' (aka 'unsigned long'), which requires 8 byte alignment
0x55eb709dfa0c: note: pointer points here
  00 00 00 00 01 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 bc 5a 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:354:2 in 
thmap.c:355:8: runtime error: member access within misaligned address 0x55eb709df994 for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 02 00 00 80  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:355:8 in 
thmap.c:728:24: runtime error: member access within misaligned address 0x55eb709df994 for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 01 00 00 80  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:728:24 in 
thmap.c:728:24: runtime error: load of misaligned address 0x55eb709df994 for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 01 00 00 80  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:728:24 in 
thmap.c:765:6: runtime error: member access within misaligned address 0x55eb709df994 for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 01 00 00 80  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:765:6 in 
thmap.c:765:6: runtime error: load of misaligned address 0x55eb709df994 for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment
0x55eb709df994: note: pointer points here
  22 01 00 00 01 00 00 80  00 00 00 00 1c 02 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:765:6 in 
thmap.c:787:14: runtime error: member access within misaligned address 0x55eb709da22c for type 'thmap_leaf_t', which requires 8 byte alignment
0x55eb709da22c: note: pointer points here
  00 00 00 00 c4 02 00 00  00 00 00 00 04 00 00 00  00 00 00 00 01 00 00 00  00 00 00 00 01 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:787:14 in 
thmap.c:787:14: runtime error: load of misaligned address 0x55eb709da23c for type 'void *', which requires 8 byte alignment
0x55eb709da23c: note: pointer points here
  00 00 00 00 01 00 00 00  00 00 00 00 01 00 00 00  09 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:787:14 in 
thmap.c:789:29: runtime error: member access within misaligned address 0x55eb709da22c for type 'thmap_leaf_t', which requires 8 byte alignment
0x55eb709da22c: note: pointer points here
  00 00 00 00 c4 02 00 00  00 00 00 00 04 00 00 00  00 00 00 00 01 00 00 00  00 00 00 00 01 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:789:29 in 
thmap.c:789:29: runtime error: load of misaligned address 0x55eb709da22c for type 'thmap_ptr_t' (aka 'unsigned long'), which requires 8 byte alignment
0x55eb709da22c: note: pointer points here
  00 00 00 00 c4 02 00 00  00 00 00 00 04 00 00 00  00 00 00 00 01 00 00 00  00 00 00 00 01 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:789:29 in 
thmap.c:789:40: runtime error: member access within misaligned address 0x55eb709da22c for type 'thmap_leaf_t', which requires 8 byte alignment
0x55eb709da22c: note: pointer points here
  00 00 00 00 c4 02 00 00  00 00 00 00 04 00 00 00  00 00 00 00 01 00 00 00  00 00 00 00 01 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:789:40 in 
thmap.c:789:40: runtime error: load of misaligned address 0x55eb709da234 for type 'size_t' (aka 'unsigned long'), which requires 8 byte alignment
0x55eb709da234: note: pointer points here
  00 00 00 00 04 00 00 00  00 00 00 00 01 00 00 00  00 00 00 00 01 00 00 00  09 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:789:40 in 
thmap.c:744:3: runtime error: member access within misaligned address 0x55eb709da5a4 for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da5a4: note: pointer points here
  06 00 00 00 07 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 51 27 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:744:3 in 
thmap.c:744:3: runtime error: load of misaligned address 0x55eb709da5a4 for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment
0x55eb709da5a4: note: pointer points here
  06 00 00 00 07 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 51 27 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:744:3 in 
thmap.c:749:3: runtime error: member access within misaligned address 0x55eb709da5a4 for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709da5a4: note: pointer points here
  06 00 00 00 07 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 51 27 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:749:3 in 
thmap.c:731:3: runtime error: member access within misaligned address 0x55eb709dc55c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709dc55c: note: pointer points here
  50 00 00 00 00 00 00 80  00 00 00 00 e8 15 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:731:3 in 
thmap.c:731:3: runtime error: load of misaligned address 0x55eb709dc55c for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment
0x55eb709dc55c: note: pointer points here
  50 00 00 00 00 00 00 80  00 00 00 00 e8 15 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:731:3 in 
thmap.c:740:12: runtime error: member access within misaligned address 0x55eb709dc55c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709dc55c: note: pointer points here
  50 00 00 00 00 00 00 80  00 00 00 00 e8 15 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:740:12 in 
thmap.c:740:12: runtime error: load of misaligned address 0x55eb709dc564 for type 'thmap_ptr_t' (aka 'unsigned long'), which requires 8 byte alignment
0x55eb709dc564: note: pointer points here
  00 00 00 00 e8 15 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:740:12 in 
thmap.c:746:9: runtime error: member access within misaligned address 0x55eb709dc55c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709dc55c: note: pointer points here
  50 00 00 00 00 00 00 80  00 00 00 00 e8 15 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:746:9 in 
thmap.c:746:9: runtime error: store to misaligned address 0x55eb709dc55c for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment
0x55eb709dc55c: note: pointer points here
  50 00 00 00 00 00 00 80  00 00 00 00 e8 15 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:746:9 in 
thmap.c:771:3: runtime error: member access within misaligned address 0x55eb709db29c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709db29c: note: pointer points here
  20 00 00 00 00 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:771:3 in 
thmap.c:771:3: runtime error: load of misaligned address 0x55eb709db2a4 for type 'thmap_ptr_t' (aka 'unsigned long'), which requires 8 byte alignment
0x55eb709db2a4: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:771:3 in 
thmap.c:775:11: runtime error: member access within misaligned address 0x55eb709db29c for type 'thmap_inode_t', which requires 8 byte alignment
0x55eb709db29c: note: pointer points here
  20 00 00 00 00 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:775:11 in 
thmap.c:775:11: runtime error: store to misaligned address 0x55eb709db29c for type 'uint32_t' (aka 'unsigned int'), which requires 8 byte alignment
0x55eb709db29c: note: pointer points here
  20 00 00 00 00 00 00 80  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior thmap.c:775:11 in 
ok

a question about thread_fence

	atomic_thread_fence(memory_order_stores); // this affects line below
	node->state = s; // atomic store
	node_insert(child, other_slot, target);

	/*
	 * Insert the intermediate node into the parent node.
	 * It becomes the new parent for the our new leaf.
	 *
	 * Ensure that stores to the child (and leaf) reach the
	 * global visibility before it gets inserted to the parent.
	 */
	atomic_thread_fence(memory_order_stores); // this seems to affect the line above
	parent->slots[slot] = THMAP_GETOFF(thmap, child);

how does memory_order_stores and memory_order_loads affect the code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.