i_error("Raw backtrace: %s", backtrace);
}
- if (type == LOG_TYPE_PANIC)
+ if (type == LOG_TYPE_PANIC ||
+ (status == FATAL_OUTOFMEM && getenv("DEBUG_OUTOFMEM") != NULL))
abort();
else
failure_exit(status);
.state_dir = PKG_STATEDIR,
.libexec_dir = PKG_LIBEXECDIR,
.instance_name = PACKAGE,
- .import_environment = "TZ" ENV_SYSTEMD ENV_GDB,
+ .import_environment = "TZ DEBUG_OUTOFMEM" ENV_SYSTEMD ENV_GDB,
.protocols = "imap pop3 lmtp",
.listen = "*, ::",
.ssl = "yes:no:required",
static const char *
get_exit_status_message(struct service *service, enum fatal_exit_status status)
{
+ string_t *str;
+
switch (status) {
case FATAL_LOGOPEN:
return "Can't open log file";
case FATAL_LOGERROR:
return "Internal logging error";
case FATAL_OUTOFMEM:
- if (service->vsz_limit == 0)
- return "Out of memory";
- return t_strdup_printf("Out of memory (service %s { vsz_limit=%u MB }, "
- "you may need to increase it)",
- service->set->name,
- (unsigned int)(service->vsz_limit/1024/1024));
+ str = t_str_new(128);
+ str_append(str, "Out of memory");
+ if (service->vsz_limit != 0) {
+ str_printfa(str, " (service %s { vsz_limit=%u MB }, "
+ "you may need to increase it)",
+ service->set->name,
+ (unsigned int)(service->vsz_limit/1024/1024));
+ }
+ if (getenv("DEBUG_OUTOFMEM") == NULL)
+ str_append(str, " - set DEBUG_OUTOFMEM=1 environment to get core dump");
+ return str_c(str);
case FATAL_EXEC:
return "exec() failed";