We can diverged into the s3 and lib/fault panic action stuff once
we have printed the backtrace.
Our tests require we use the word PANIC, and some administrative scripts
might look for similar things, so keep those words.
The use of DEBUG(0, ... is deliberate to keep the output
of the PANIC line as consistent as possible with the historical smbd output.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 27 05:09:44 UTC 2020 on sn-devel-184
static void smb_panic_default(const char *why) _NORETURN_;
static void smb_panic_default(const char *why)
{
static void smb_panic_default(const char *why) _NORETURN_;
static void smb_panic_default(const char *why)
{
- DBG_ERR("PANIC (pid %llu): %s\n",
- (unsigned long long)getpid(), why);
- log_stack_trace();
-
#if defined(HAVE_PRCTL) && defined(PR_SET_PTRACER)
/*
* Make sure all children can attach a debugger.
#if defined(HAVE_PRCTL) && defined(PR_SET_PTRACER)
/*
* Make sure all children can attach a debugger.
-
-/**
- Something really nasty happened - panic !
-**/
-_PUBLIC_ void smb_panic(const char *why)
+_PUBLIC_ void smb_panic_log(const char *why)
- DEBUG(0,("INTERNAL ERROR: %s in pid %d (%s)",why,(int)getpid(),SAMBA_VERSION_STRING));
- DEBUG(0,("\nIf you are running a recent Samba version, and "
+ DEBUG(0,("INTERNAL ERROR: %s in pid %lld (%s)\n",
+ why,
+ (unsigned long long)getpid(),
+ SAMBA_VERSION_STRING));
+ DEBUG(0,("If you are running a recent Samba version, and "
"if you think this problem is not yet fixed in the "
"latest versions, please consider reporting this "
"bug, see "
"https://wiki.samba.org/index.php/Bug_Reporting\n"));
DEBUGSEP(0);
"if you think this problem is not yet fixed in the "
"latest versions, please consider reporting this "
"bug, see "
"https://wiki.samba.org/index.php/Bug_Reporting\n"));
DEBUGSEP(0);
+ DEBUG(0,("PANIC (pid %llu): %s in " SAMBA_VERSION_STRING "\n",
+ (unsigned long long)getpid(), why));
+
+ log_stack_trace();
+}
+
+/**
+ Something really nasty happened - panic !
+**/
+_PUBLIC_ void smb_panic(const char *why)
+{
+ smb_panic_log(why);
if (fault_state.panic_handler) {
fault_state.panic_handler(why);
if (fault_state.panic_handler) {
fault_state.panic_handler(why);
void fault_setup(void);
void fault_setup_disable(void);
_NORETURN_ void smb_panic(const char *reason);
void fault_setup(void);
void fault_setup_disable(void);
_NORETURN_ void smb_panic(const char *reason);
+void smb_panic_log(const char *reason);
void log_stack_trace(void);
void log_stack_trace(void);
- DEBUG(0,("PANIC (pid %llu): %s\n",
- (unsigned long long)getpid(), why));
- log_stack_trace();
-
#if defined(HAVE_PRCTL) && defined(PR_SET_PTRACER)
/*
* Make sure all children can attach a debugger.
#if defined(HAVE_PRCTL) && defined(PR_SET_PTRACER)
/*
* Make sure all children can attach a debugger.
static void regedit_panic_handler(const char *msg)
{
endwin();
static void regedit_panic_handler(const char *msg)
{
endwin();