1brc
1brc copied to clipboard
bug: beyond the bound of chunk
// this assumes the file ends in a newline...
const char *end = (char *)memchr(&data[chunk_end], '\n', chunk_size) + 1;
data[chunk_end]
is over the limit, the end of the chunk is data[chunk_end-1]
when the last workthread access the data[chunk_end], make SIGSEGV. i try nthread of 2,4,8. the problem issues.