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.
Did you create the measurements file using the provided program or from somewhere else? The last two bytes of the memory mapped file should be “\n\0”.But yeah, since this is not in the hot loop I should probably clean that up. :-)Op 18 apr. 2024 om 17:01 heeft bbqz007 @.***> het volgende geschreven: // 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.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>