[Lldb-commits] [PATCH] D12138: On Linux, clear the signal mask of the launched inferior
Yacine Belkadi via lldb-commits
lldb-commits at lists.llvm.org
Wed Aug 19 03:29:59 PDT 2015
ybelkadi updated this revision to Diff 32529.
ybelkadi added a comment.
Yes, the test passes, but as PR19246 reported intermittent failures, I thought I'd wait for the results of the tests run by the bots.
Here is an updated patch also enabling the test. Could you please commit it if it's accepted?
http://reviews.llvm.org/D12138
Files:
source/Plugins/Process/Linux/NativeProcessLinux.cpp
test/expression_command/call-restarts/TestCallThatRestarts.py
Index: test/expression_command/call-restarts/TestCallThatRestarts.py
===================================================================
--- test/expression_command/call-restarts/TestCallThatRestarts.py
+++ 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: source/Plugins/Process/Linux/NativeProcessLinux.cpp
===================================================================
--- source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -554,7 +554,8 @@
eDupStderrFailed,
eChdirFailed,
eExecFailed,
- eSetGidFailed
+ eSetGidFailed,
+ eSetSigMaskFailed
};
// Child process.
@@ -629,6 +630,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),
@@ -686,6 +693,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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12138.32529.patch
Type: text/x-patch
Size: 1858 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150819/b1565fac/attachment.bin>
More information about the lldb-commits
mailing list