Revert 251391 "Setuid sandbox: exit(2) on SIGABRT"

Failed on official build bots:

FAILED: /b/build/goma/gomacc cc -MMD -MF obj/sandbox/linux/suid/chrome_sandbox.sandbox.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DGOOGLE_CHROME_BUILD -DTOOLKIT_VIEWS=1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_CAIRO=1 -DUSE_GLIB=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_NSS=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_ONE_CLICK_SIGNIN -DUSE_XI2_MT=2 -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DUSE_PROPRIETARY_CODECS -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_INPUT_SPEECH -DENABLE_NOTIFICATIONS -DUSE_UDEV -DENABLE_EGLIMAGE=1 -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGIN_INSTALLATION=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_AUTOMATION=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DENABLE_FULL_PRINTING=1 -DENABLE_PRINTING=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_MANAGED_USERS=1 -DENABLE_MDNS=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DOFFICIAL_BUILD -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_FORTIFY_SOURCE=2 -I../.. -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-exceptions -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -g -std=gnu99 --sysroot=/b/build/slave/google-chrome-rel-linux_64/build/src/chrome/installer/linux/debian_wheezy_amd64-sysroot -O2 -fno-ident -fdata-sections -ffunction-sections -fno-unwind-tables -fno-asynchronous-unwind-tables   -c ../../sandbox/linux/suid/sandbox.c -o obj/sandbox/linux/suid/chrome_sandbox.sandbox.o
../../sandbox/linux/suid/sandbox.c: In function 'ExitWithErrorSignalHandler':
../../sandbox/linux/suid/sandbox.c:63:3: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result]
cc1: all warnings being treated as errors

http://build.chromium.org/p/chromium.chrome/builders/Google%20Chrome%20Linux%20x64/builds/48305/steps/compile/logs/stdio

> Setuid sandbox: exit(2) on SIGABRT
> 
> The setuid sandbox waits on its one child and then dies
> afterwards.
> 
> When receiving SIGABRT, instead of dumping core, simply exit the
> process. There is no interesting information to be gathered from
> knowing that the process is inside waitid(2), one should look at
> the child process instead.
> 
> This patch is in hope to reduce red herrings.
> 
> BUG=334345
> TBR=jorgelo
> 
> Review URL: https://codereview.chromium.org/167293004

TBR=jln@chromium.org

Review URL: https://codereview.chromium.org/167473003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251396 0039d316-1c4b-4281-b951-d872f2087c98
parent b61bf8bc
...@@ -58,12 +58,6 @@ static void FatalError(const char *msg, ...) { ...@@ -58,12 +58,6 @@ static void FatalError(const char *msg, ...) {
_exit(1); _exit(1);
} }
static void ExitWithErrorSignalHandler(int signal) {
const char msg[] = "\nThe setuid sandbox got signaled, exiting.\n";
(void) write(2, msg, sizeof(msg) - 1);
_exit(1);
}
// We will chroot() to the helper's /proc/self directory. Anything there will // We will chroot() to the helper's /proc/self directory. Anything there will
// not exist anymore if we make sure to wait() for the helper. // not exist anymore if we make sure to wait() for the helper.
// //
...@@ -201,15 +195,6 @@ static void WaitForChildAndExit(pid_t child_pid) { ...@@ -201,15 +195,6 @@ static void WaitForChildAndExit(pid_t child_pid) {
int exit_code = -1; int exit_code = -1;
siginfo_t reaped_child_info; siginfo_t reaped_child_info;
// Don't "Core" on SIGABRT. SIGABRT is sent by the Chrome OS session manager
// when things are hanging.
// Here, the current process is going to waitid() and _exit(), so there is no
// point in generating a crash report. The child process is the one
// blocking us.
if (signal(SIGABRT, ExitWithErrorSignalHandler) == SIG_ERR) {
FatalError("Failed to change signal handler");
}
int wait_ret = int wait_ret =
HANDLE_EINTR(waitid(P_PID, child_pid, &reaped_child_info, WEXITED)); HANDLE_EINTR(waitid(P_PID, child_pid, &reaped_child_info, WEXITED));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment