summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2016-09-10 21:08:01 -0700
committerAdam Jackson <ajax@redhat.com>2016-09-13 16:16:40 -0400
commit75c1d04650f63464263c159d2e95364482be724f (patch)
tree0a44e5c6040fd7e9eeb001e8d263dae269ea322d /os
parent065eb6612492bacf4d7caaad90e35dafc2cbf7ea (diff)
os: OsSigHandler should not show rtld errors for unrelated signals
If RTLD_DI_SETSIGNAL is set to let us turn runtime linker/loader errors into catchable signals, then we should only show the errors when catching that signal, instead of tossing out red herrings to distract people with unrelated crashes long after their last failed symbol lookup (especially when using drivers built to support multiple API's by checking which symbols are available before calling them). Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Diffstat (limited to 'os')
-rw-r--r--os/osinit.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/os/osinit.c b/os/osinit.c
index 47061bb2b..5b2f6b546 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -114,10 +114,14 @@ OsSigHandler(int signo)
#endif
{
#ifdef RTLD_DI_SETSIGNAL
- const char *dlerr = dlerror();
+# define SIGNAL_FOR_RTLD_ERROR SIGQUIT
+ if (signo == SIGNAL_FOR_RTLD_ERROR) {
+ const char *dlerr = dlerror();
- if (dlerr) {
- LogMessageVerbSigSafe(X_ERROR, 1, "Dynamic loader error: %s\n", dlerr);
+ if (dlerr) {
+ LogMessageVerbSigSafe(X_ERROR, 1,
+ "Dynamic loader error: %s\n", dlerr);
+ }
}
#endif /* RTLD_DI_SETSIGNAL */
@@ -217,7 +221,7 @@ OsInit(void)
* after ourselves.
*/
{
- int failure_signal = SIGQUIT;
+ int failure_signal = SIGNAL_FOR_RTLD_ERROR;
dlinfo(RTLD_SELF, RTLD_DI_SETSIGNAL, &failure_signal);
}