Send a SIGSEGV instead of exiting, to trigger a core dump

This commit is contained in:
Zeev Suraski 1999-07-09 11:10:19 +00:00
parent 6abe9c34d9
commit cc26d0e609

View file

@ -116,7 +116,11 @@ ZEND_API void *_emalloc(size_t size)
if (!p) {
fprintf(stderr,"FATAL: emalloc(): Unable to allocate %ld bytes\n", (long) size);
#if !(WIN32||WINNT) && ZEND_DEBUG
kill(getpid(), SIGSEGV);
#else
exit(1);
#endif
HANDLE_UNBLOCK_INTERRUPTIONS();
return (void *)p;
}
@ -222,7 +226,11 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure)
if (!p) {
if (!allow_failure) {
fprintf(stderr,"FATAL: erealloc(): Unable to allocate %ld bytes\n", (long) size);
#if !(WIN32||WINNT) && ZEND_DEBUG
kill(getpid(), SIGSEGV);
#else
exit(1);
#endif
}
ADD_POINTER_TO_LIST(orig);
HANDLE_UNBLOCK_INTERRUPTIONS();