summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/os_common/os_abort.c
blob: 85dcc7418551eb92ce1b9c5112ab008098f89bf4 (plain)
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
/*-
 * Copyright (c) 2014-2018 MongoDB, Inc.
 * Copyright (c) 2008-2014 WiredTiger, Inc.
 *	All rights reserved.
 *
 * See the file LICENSE for redistribution information.
 */

#include "wt_internal.h"

/*
 * __wt_abort --
 *	Abort the process, dropping core.
 */
void
__wt_abort(WT_SESSION_IMPL *session)
    WT_GCC_FUNC_ATTRIBUTE((noreturn))
{
#ifdef HAVE_ATTACH
	u_int i;

	__wt_errx(session, "process ID %" PRIdMAX
	    ": waiting for debugger...", (intmax_t)getpid());

	/* Sleep forever, the debugger will interrupt us when it attaches. */
	for (i = 0; i < WT_MILLION; ++i)
		__wt_sleep(100, 0);
#else
	__wt_errx(session, "aborting WiredTiger library");
#endif
	abort();
	/* NOTREACHED */
}