pike.git
/
src
/
error.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/error.c:1:
/* || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: error.c,v 1.
97
2002/12/
07
15
:
44
:
15
grubba
Exp $
+
|| $Id: error.c,v 1.
98
2002/12/
16
12
:
12
:
37
mast
Exp $
*/ #define NO_PIKE_SHORTHAND #include "global.h" #include "svalue.h" #include "pike_macros.h" #include "pike_error.h" #include "interpret.h" #include "stralloc.h" #include "builtin_functions.h" #include "array.h" #include "object.h" #include "main.h" #include "builtin_functions.h" #include "backend.h" #include "operators.h" #include "module_support.h" #include "threads.h" #include "gc.h"
-
RCSID("$Id: error.c,v 1.
97
2002/12/
07
15
:
44
:
15
grubba
Exp $");
+
RCSID("$Id: error.c,v 1.
98
2002/12/
16
12
:
12
:
37
mast
Exp $");
#undef ATTRIBUTE #define ATTRIBUTE(X) PMOD_EXPORT const char msg_fatal_error[] = "%s:%d: Fatal error:\n"; #ifdef PIKE_DEBUG PMOD_EXPORT const char msg_unsetjmp_nosync_1[] = "UNSETJMP out of sync! (last SETJMP at %s)!\n"; PMOD_EXPORT const char msg_unsetjmp_nosync_2[] =
pike.git/src/error.c:386:
if(Pike_in_gc) fprintf(stderr,"Pike was in GC stage %d when this fatal occured:\n",Pike_in_gc); Pike_in_gc = GC_PASS_DISABLED; (void)VFPRINTF(stderr, fmt, args); d_flag=t_flag=0; if(Pike_sp && Pike_interpreter.evaluator_stack && master_object && master_object->prog) {
-
fprintf(stderr,"Attempting to dump backlog (may fail)...\n");
+
push_error("Backtrace at time of fatal:\n"); APPLY_MASTER("describe_backtrace",1); if(Pike_sp[-1].type==PIKE_T_STRING) write_to_stderr(Pike_sp[-1].u.string->str, Pike_sp[-1].u.string->len); }else{ fprintf(stderr,"No stack - no backtrace.\n"); } fflush(stderr); do_abort(); }
pike.git/src/error.c:651:
vsnprintf(buf, sizeof(buf)-1, fmt, foo); #else /* !HAVE_VSNPRINTF */ /* Sentinel that will be overwritten on buffer overflow. */ buf[sizeof(buf)-1] = '\0'; VSPRINTF(buf, fmt, foo); if(buf[sizeof(buf)-1]) Pike_fatal("Buffer overflow in error()\n"); #endif /* HAVE_VSNPRINTF */
+
+
if(in_error)
+
{
+
const char *tmp=in_error;
+
in_error=0;
+
Pike_fatal("Recursive error() calls, original error: %s",tmp);
+
}
in_error=buf; if (!master_program) { fprintf(stderr, "ERROR: %s\n", buf); } ERROR_STRUCT(generic,o)->desc=make_shared_string(buf); f_backtrace(0); if(func)