From d2d9dd65b3b9b13fda77aae18f35b71812a76e71 Mon Sep 17 00:00:00 2001 From: luwenpeng Date: Mon, 20 Apr 2020 13:34:42 +0800 Subject: [PATCH] =?UTF-8?q?TSG-1009=20=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9=20disable=5Fcoredump?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform/src/proxy.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp index 919426e..a4663a6 100644 --- a/platform/src/proxy.cpp +++ b/platform/src/proxy.cpp @@ -550,6 +550,18 @@ struct breakpad_instance * breakpad_init(const char * profile) assert(instance != nullptr); int ret = 0; + unsigned int disable_coredump; + MESA_load_profile_uint_def(profile, "system", "disable_coredump", &disable_coredump, 0); + if (disable_coredump > 0) + { + const struct rlimit __rlimit_vars = {.rlim_cur = 0, .rlim_max = 0}; + ret = setrlimit(RLIMIT_CORE, &__rlimit_vars); + if (ret < 0) + { + TFE_LOG_ERROR(g_default_logger, "setrlimit(RLIMIT_CORE, 0) failed: %s", strerror(errno)); + } + } + MESA_load_profile_uint_def(profile, "system", "enable_breakpad", &instance->en_breakpad, 1); if (instance->en_breakpad <= 0) {