GMP and assert()
GMP and assert()
Posted Feb 28, 2019 20:30 UTC (Thu) by HenrikH (subscriber, #31152)In reply to: GMP and assert() by sorokin
Parent article: GMP and assert()
Or when malloc() returns NULL on a kernel with overcommit (the default), even logging the error would require more memory to be allocation and thus also fail.
Posted Feb 28, 2019 22:42 UTC (Thu)
by devkev (subscriber, #74096)
[Link]
This is not true. First of all, maybe the condition which caused malloc() to fail was transient, and subsequent mallocs will succeed. But even if not, the proper behaviour in this case is to pre-allocate (or use static allocation) a reasonable sized buffer to use for this logging. This is why things like sigaltstack() exist, for example.
GMP and assert()
