-
Notifications
You must be signed in to change notification settings - Fork 926
Issue #876: Fix integer overflow on slice_count #877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
If the slice count doesn't fit into uint32_t, consider that the memory allocation failed. On Linux s390x, allocating around 8,589,934,592 GiB with mmap() works thanks to overcommit on a machine with 8 GiB of memory: mmap(NULL, 0x8000000000400000, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0)
Hum, it doesn't seem to be related to my change:
|
Thanks so much for spotting this! I fixed it differently by defining a |
Do you have a link to the fix? 5050b63 only defines MI_MAX_ALLOC_SIZE as PTRDIFF_MAX. Is it the same fix? |
Ah, for |
Sorry, but it's quite complicated to set up the test :-/ Thanks for the fix anyway! |
If the slice count doesn't fit into uint32_t, consider that the memory allocation failed.
On Linux s390x, allocating around 8,589,934,592 GiB with mmap() works thanks to overcommit on a machine with 8 GiB of memory: