Throwing an exception for the first time may lead to calling calloc to allocate memory for __cxa_eh_globals. If the memory pool is exhausted at that moment, it results in abnormal termination of the program.
This patch addresses the issue by using fallback_malloc in that case.