This revision was automatically updated to reflect the committed changes.
Closed by commit rL245436: On Linux, clear the signal mask of the launched
inferior (authored by labath).
Changed prior to commit:
http://reviews.llvm.org/D12138?vs=32529&id=32546#toc
Repository:
rL LLVM
http://reviews.llvm.org/D12138
Files:
lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
lldb/trunk/test/expression_command/call-restarts/TestCallThatRestarts.py
Index: lldb/trunk/test/expression_command/call-restarts/TestCallThatRestarts.py
===================================================================
--- lldb/trunk/test/expression_command/call-restarts/TestCallThatRestarts.py
+++ lldb/trunk/test/expression_command/call-restarts/TestCallThatRestarts.py
@@ -29,7 +29,6 @@
@dwarf_test
@skipIfFreeBSD # llvm.org/pr19246: intermittent failure
- @expectedFailureLinux("llvm.org/pr19246")
@skipIfDarwin # llvm.org/pr19246: intermittent failure
@skipIfWindows # Test relies on signals, unsupported on Windows
def test_with_dwarf(self):
Index: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -554,7 +554,8 @@
eDupStderrFailed,
eChdirFailed,
eExecFailed,
- eSetGidFailed
+ eSetGidFailed,
+ eSetSigMaskFailed
};
// Child process.
@@ -632,6 +633,12 @@
}
}
+ // Clear the signal mask to prevent the child from being affected by
+ // any masking done by the parent.
+ sigset_t set;
+ if (sigemptyset(&set) != 0 || pthread_sigmask(SIG_SETMASK, &set,
nullptr) != 0)
+ exit(eSetSigMaskFailed);
+
// Execute. We should never return...
execve(argv[0],
const_cast<char *const *>(argv),
@@ -689,6 +696,9 @@
case eSetGidFailed:
error.SetErrorString("Child setgid failed.");
break;
+ case eSetSigMaskFailed:
+ error.SetErrorString("Child failed to set signal mask.");
+ break;
default:
error.SetErrorString("Child returned unknown exit status.");
break;
Index: lldb/trunk/test/expression_command/call-restarts/TestCallThatRestarts.py
===================================================================
--- lldb/trunk/test/expression_command/call-restarts/TestCallThatRestarts.py
+++ lldb/trunk/test/expression_command/call-restarts/TestCallThatRestarts.py
@@ -29,7 +29,6 @@
@dwarf_test
@skipIfFreeBSD # llvm.org/pr19246: intermittent failure
- @expectedFailureLinux("llvm.org/pr19246")
@skipIfDarwin # llvm.org/pr19246: intermittent failure
@skipIfWindows # Test relies on signals, unsupported on Windows
def test_with_dwarf(self):
Index: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -554,7 +554,8 @@
eDupStderrFailed,
eChdirFailed,
eExecFailed,
- eSetGidFailed
+ eSetGidFailed,
+ eSetSigMaskFailed
};
// Child process.
@@ -632,6 +633,12 @@
}
}
+ // Clear the signal mask to prevent the child from being affected by
+ // any masking done by the parent.
+ sigset_t set;
+ if (sigemptyset(&set) != 0 || pthread_sigmask(SIG_SETMASK, &set, nullptr) != 0)
+ exit(eSetSigMaskFailed);
+
// Execute. We should never return...
execve(argv[0],
const_cast<char *const *>(argv),
@@ -689,6 +696,9 @@
case eSetGidFailed:
error.SetErrorString("Child setgid failed.");
break;
+ case eSetSigMaskFailed:
+ error.SetErrorString("Child failed to set signal mask.");
+ break;
default:
error.SetErrorString("Child returned unknown exit status.");
break;
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits