Subject: Re: bug#69762: X11 versions of Emacs 29 on sparc fail at startup

From: Po Lu <[email-masked]>
Date: Sat, 16 Mar 2024 14:32:07 +0800

Po Lu <[email-masked]> writes:

> I don't think such a drastic measure is necessary under the
> circumstances.  We should (please test) put this down as a bug in the
> X.Org server and install an error trap around SyncCreateFence requests,
> thus:
>
> diff --git a/src/xterm.c b/src/xterm.c
> index c8a43785564..26926bc4faa 100644
> --- a/src/xterm.c
> +++ b/src/xterm.c
> @@ -7292,6 +7292,7 @@ x_sync_init_fences (struct frame *f)
>  	  && dpyinfo->xsync_minor < 1))
>      return;
>  
> +  x_ignore_errors_for_next_request (dpyinfo, 0);
>    output->sync_fences[0]
>      = XSyncCreateFence (FRAME_X_DISPLAY (f),
>  			/* The drawable given below is only used to
> @@ -7303,6 +7304,7 @@ x_sync_init_fences (struct frame *f)
>      = XSyncCreateFence (FRAME_X_DISPLAY (f),
>  			FRAME_X_WINDOW (f),
>  			False);
> +  x_stop_ignoring_errors (dpyinfo, 0);
>  
>    XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
>  		   dpyinfo->Xatom_net_wm_sync_fences, XA_CARDINAL,

Scratch that,

diff --git a/src/xterm.c b/src/xterm.c
index c8a43785564..2358918ac5b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7292,6 +7292,7 @@ x_sync_init_fences (struct frame *f)
 	  && dpyinfo->xsync_minor < 1))
     return;
 
+  x_ignore_errors_for_next_request (dpyinfo, 0);
   output->sync_fences[0]
     = XSyncCreateFence (FRAME_X_DISPLAY (f),
 			/* The drawable given below is only used to
@@ -7303,6 +7304,7 @@ x_sync_init_fences (struct frame *f)
     = XSyncCreateFence (FRAME_X_DISPLAY (f),
 			FRAME_X_WINDOW (f),
 			False);
+  x_stop_ignoring_errors (dpyinfo);
 
   XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
 		   dpyinfo->Xatom_net_wm_sync_fences, XA_CARDINAL,