From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#69762: X11 versions of Emacs 29 on sparc fail at startup Date: Sat, 16 Mar 2024 14:28:07 +0800 Message-ID: <87plvusnbc.fsf@yahoo.com> References: <1e95c2c8-f7fc-456c-a8aa-d2ada44b7d13@emvision.com> <87a5n3vujp.fsf@yahoo.com> <244fddd2-2de4-4e16-945e-4927fab4af12@emvision.com> <87jzm5vf8y.fsf@yahoo.com> <2de8afe1-6410-4729-abc1-cfd541b1b4d1@emvision.com> <87frwtuymr.fsf@yahoo.com> <877ci4us9b.fsf@yahoo.com> <8e8a39c6-1272-4f2b-b749-56722bd394d7@emvision.com> <87wmq4t2rp.fsf@yahoo.com> <8790adce-e863-46f8-bbaf-25660a917e04@emvision.com> <871q8bt4au.fsf@yahoo.com> <344699e3-8dad-4cde-adcd-35ebec4900e7@emvision.com> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5674"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 69762@debbugs.gnu.org To: Ali Bahrami Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 16 07:29:54 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rlNYI-0001HK-FW for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Mar 2024 07:29:54 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rlNY1-00084W-WA; Sat, 16 Mar 2024 02:29:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlNXq-00083r-4W for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2024 02:29:30 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rlNXp-0006Te-SD for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2024 02:29:25 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rlNYQ-0007XF-Ab for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2024 02:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Mar 2024 06:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69762 X-GNU-PR-Package: emacs Original-Received: via spool by 69762-submit@debbugs.gnu.org id=B69762.171057054528868 (code B ref 69762); Sat, 16 Mar 2024 06:30:02 +0000 Original-Received: (at 69762) by debbugs.gnu.org; 16 Mar 2024 06:29:05 +0000 Original-Received: from localhost ([127.0.0.1]:54743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlNXV-0007VY-39 for submit@debbugs.gnu.org; Sat, 16 Mar 2024 02:29:05 -0400 Original-Received: from sonic317-34.consmr.mail.ne1.yahoo.com ([66.163.184.45]:37408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlNXR-0007Ux-Du for 69762@debbugs.gnu.org; Sat, 16 Mar 2024 02:29:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1710570498; bh=vl6m/5oiHr+jXHAKIj9sLXWw2bLVyGiUSb6IADkbRl0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=A6V5lVDxvVez8pNWnrmBuwAVgsMCxd+0cngpna+qii8ZcvEMKmkkQ3ff3s56Hchnwy968wg8kVuKe7hT72OHueNW515V9IZ16ZGL30qJt4y1CkoUB/nLD6nWPu7IXF86/9C8fmGT+pSEOSwcryfXGPHSl2Rig+ngIH6bHgi9gh2JueWXgeGybC+Kzilz+I4wq/3nFymoO5fpUsWyp90PxcKPxl/g02BiCkvqk3ifCmiz3OMnLPBD0ywzsgYaIWeE5sTbrItvLe/YclScUthChQ1hX5owKMkyz3hmRJbC74BMD9eIj+mLyzAPQvH55G+xXt77R2CTW7ISqoDNQ5LfGA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1710570498; bh=wo8JoSmaN7l4T+C4HQa9WhIzofDow/f33unatoEJDPu=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=R2v3WcuBlvufcONnwBNf1wjxdM7OXSRc6rTu55gufd8kckss4pqzNvMcUi7liIJvxq8WpHDyiW762W2dgsU8tEaGUv+LfaEoq6Kcyj5lbAh6DYTF56/QgS5Pq6BvQYC1clZScdvPXSxwkgX9N8AA8j9yQNQfII42i2xKVZkNUXo5RMn1iKb2RGlYhHRlrEBU2X37buNXYv1NeWvyGm8/ApIkkumb+4C8yGgR3bKskHIuwTJNSFpPMQxbdVf/hC8dOp3ZvQWrkGudqYVUUl93JjoHEdvTy/gJdF1OsYl+eCv4T+Doy+0TiAH94BRWYy1sKCkSzK1kzm0UY7fv6eKWyA== X-YMail-OSG: AW5lfBIVM1lS0IV21BM2gd.AypoXZ_JASO0ZPCSG.WSJfaB8ywQjb5KMpyeoquC tMmacXY3pLP_SP.sxKMLLyAwkgP2cSRl1XCWkE3NGEUUMfKzGjKVwLaNoUVmmzeaYQesG8N.8Msq 38TUK2kmYYy_S5htgsg5V52JQ8i4_5buYyfVQAnstg0m5qNqonsCuav.rnfK4KUemLEu.c4lZBdz NhD0yz1IHFXSEbKorCnKttUvFkFS9h_IZAg_Yw6M1_RensWX25zCFz37OKZFsAPsIfRcdqaED2TR gHr3hSR0m87Aw_LUGAxkxfvLBMtVGhDxC4RmDWL.nECRZCKdPB_VTvs0p92E65yOl3_owi1.dMgQ aQyBH6oFcAA.X9JftXyo4TEcxOitXa.3Hskarf5jCk8SrvS6o8Sk1F2_Se4MVmVjkjsFgZRNtAFj WH1HAluKGvyDkLpyW8pv9HIdNtHftOxA4zsl_l04uEq38q7L0ePh6u6PnsXbfORsOR1HE2lGE2XW uiwOmFUf9rcMJFmDijohyGxSjmkCOLKR8c4j5k4rOLSBnA6uO0KGCdYfz5m_F7.pWWBMHp1QmxKM T9u_QxsG6CMiY4pm9RlXQjp0LqdpQWC.TBErIBE3lTU0mLpZx94MLX8lKj51sinFDZA0ICKZwsmN wT9r0XvphClDIFgyhUTMwO0vmWoMaXo88jJE7EQ7rpBA7lKUIsdOVnRl2Wh682Jw2A6f8aLyQGgr 2P.9v.5Tl9X5kW8F_LF4t0Yl6SqVAmQVOL0IRA2OrzYov4fLwUqFckFRlH6BZXjKQSLy5X6QsKx_ a_kqZB0hndrQNXnaxUZrcRJ6r7It0vyXrrErIBr17Z X-Sonic-MF: X-Sonic-ID: 1d38f460-5ec5-48c4-9f4d-7bd89747cbe8 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Sat, 16 Mar 2024 06:28:18 +0000 Original-Received: by hermes--production-sg3-6dc75bc8fb-bcm5n (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 04440b86662b32a17dfcf9fb5ffb9da9; Sat, 16 Mar 2024 06:28:13 +0000 (UTC) In-Reply-To: <344699e3-8dad-4cde-adcd-35ebec4900e7@emvision.com> (Ali Bahrami's message of "Fri, 15 Mar 2024 22:58:44 -0600") X-Mailer: WebService/1.1.22129 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281706 Archived-At: Ali Bahrami writes: > I'm afraid that it still fails with the same error: > > % src/emacs > X protocol error: BadDrawable (invalid Pixmap or Window parameter) on protocol request 134 > Serial no: 1318 > Failing resource ID (if any): 0x43020000 > Minor code: 14 > This is a bug! Please report this to bug-gnu-emacs@gnu.org! Too bad, but see below. > The following isn't a fix, but I've come up with > a workaround. > > I was looking at the code for x_sync_init_fences() that > we've been doing these experiments on. I noticed that > that this code is not always used: > > /* Sync fences aren't supported by the X server. */ > if (dpyinfo->xsync_major < 3 > || (dpyinfo->xsync_major == 3 > && dpyinfo->xsync_minor < 1)) > return; > > Hence, the sync fence support is optional, and emacs is > willing to run without it. > > It's also only compiled in when built on systems that know > the extension, guarded by a '#ifdef HAVE_XSYNCTRIGGERFENCE'. > > And lastly, it's only called for non-GTK X11, which essentially > means, only for Lucid: > > xfns.c > > #if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK \ > && defined HAVE_CLOCK_GETTIME > x_sync_init_fences (f); > #endif > > So this works on Solaris 10 sparc, because those > old X11 bits lack the sync fence extension. And it > "works" on current Solaris GTK, because it's not used. > > Hence, the workaround, which is to put this at the top > of x_sync_init_fences(): > > /* This feature does not work properly on sparc */ > #ifdef __sparc > return; > #endif > > With that in place, Lucid emacs starts, and runs normally. > This is clearly not a proper fix, but it is an effective > workaround, and presumably, no worse that using emacs 28.2, > which completely lacks sync fence support. > > I wonder if we might be looking at a problem with the > sync fence extension on sparc? That's more than likely, yes, though one wonders why Emacs is the first program to call attention to this problem. The only role of the drawable parameter to SyncCreateFence is as a reference to its screen, which is completely defeated if not even the screen's root window is deemed valid. > Although I now have usable way around the issue, I'm willing > to continue with any experiments you want to try. Let me > know... 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,