File: ch_cond_core.c

package info (click to toggle)
fis-gtm 7.1-006-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 32,908 kB
  • sloc: ansic: 344,906; asm: 5,184; csh: 4,859; sh: 2,000; awk: 294; makefile: 73; sed: 13
file content (62 lines) | stat: -rwxr-xr-x 2,337 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/****************************************************************
 *								*
 *	Copyright 2001, 2011 Fidelity Information Services, Inc	*
 *								*
 *	This source code contains the intellectual property	*
 *	of its copyright holder(s), and is made available	*
 *	under a license.  If you do not know the terms of	*
 *	the license, please stop and do not read further.	*
 *								*
 ****************************************************************/

/* Generate a core if we need one and haven't done it yet */

#include "mdef.h"
#include "error.h"
#include "gtmdbglvl.h"

GBLREF boolean_t		created_core;
GBLREF boolean_t		dont_want_core;
GBLREF boolean_t		need_core;
GBLREF uint4			gtmDebugLevel;

/* Create our own version of the DUMP macro that does not include stack overflow. This
   error is handled better inside mdb_condition_handler which should be the top level
   handler whenever that error is raised. I would add an assert for that but this would
   force mdb_condition_handler to be included in all the images we build forcing them
   to be larger than they should be by pulling in the transfer table referenced in
   mdb_condition_handler. Not doing the dump here does not prevent the core from occuring,
   it just delays where it would occur should ERR_STACKOFLOW be signaled from a utility
   routine for some reason. Note that the DUMP macro below is defined in error.h and is
   expanded as part of the DUMPABLE macro below (10/2000 se).

   Since ERR_STACKOFLOW has the type of fatal, we must explicitly check that this error
   is NOT ERR_STACKOFLOW. 1/2001 se.
   The ERR_MEMORY error now gets same treatment as ERR_STACKOFLOW 2008-01-11 se.
*/
#undef DUMP
#define DUMP	(   SIGNAL == (int)ERR_ASSERT		\
		 || SIGNAL == (int)ERR_GTMASSERT	\
		 || SIGNAL == (int)ERR_GTMASSERT2	\
		    || SIGNAL == (int)ERR_GTMCHECK)	/* BYPASSOK */

error_def(ERR_ASSERT);
error_def(ERR_GTMASSERT);
error_def(ERR_GTMASSERT2);
error_def(ERR_GTMCHECK);
error_def(ERR_MEMORY);
error_def(ERR_OUTOFSPACE);
error_def(ERR_STACKOFLOW);

void ch_cond_core(void)
{
	boolean_t	cond_core_signal;

	cond_core_signal = (ERR_STACKOFLOW == SIGNAL) || (ERR_MEMORY == SIGNAL);
	if (DUMPABLE && ((cond_core_signal && (GDL_DumpOnStackOFlow & gtmDebugLevel)) || !cond_core_signal) && !SUPPRESS_DUMP)
	{
		need_core = TRUE;
		gtm_fork_n_core();
	}

}