Re: [PATCH:xserver] OsSigHandler should not show rtld errors for unrelated signals

2016-09-13 Thread Adam Jackson
On Sat, 2016-09-10 at 21:08 -0700, Alan Coopersmith wrote:
> 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 

Merged (with a minor touchup to the commit message):

remote: I: patch #109927 updated using rev 
75c1d04650f63464263c159d2e95364482be724f.
remote: I: 1 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   065eb66..75c1d04  master -> master

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:xserver] OsSigHandler should not show rtld errors for unrelated signals

2016-09-12 Thread Aaron Plattner
On 09/10/2016 09:08 PM, Alan Coopersmith wrote:
> 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).

Nice.

Presumably you can also SIGQUIT the server with Ctrl-\ in the terminal
it was run on, but it doesn't seem worth trying to suppress the dlsym
error in that case too.

Reviewed-by: Aaron Plattner 

> Signed-off-by: Alan Coopersmith 
> ---
>  os/osinit.c | 12 
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/os/osinit.c b/os/osinit.c
> index 47061bb..5b2f6b5 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);
>  }
> 

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:xserver] OsSigHandler should not show rtld errors for unrelated signals

2016-09-10 Thread Keith Packard
Alan Coopersmith  writes:

> Signed-off-by: Alan Coopersmith 

Reviewed-by: Keith Packard 

-- 
-keith


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH:xserver] OsSigHandler should not show rtld errors for unrelated signals

2016-09-10 Thread Alan Coopersmith
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 
---
 os/osinit.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/os/osinit.c b/os/osinit.c
index 47061bb..5b2f6b5 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);
 }
-- 
2.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel