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#63589: [PATCH] 29.0.91; crash after creating graphical frames via emacsclient when compiled with cairo-xcb Date: Fri, 26 May 2023 08:59:53 +0800 Message-ID: <87ilcfrjp2.fsf@yahoo.com> References: <837cszp9cc.fsf@gnu.org> <87cz2rw8pz.fsf@yahoo.com> <83y1lfnqwb.fsf@gnu.org> <87y1lfuqyb.fsf@yahoo.com> <83wn0znn7j.fsf@gnu.org> <87lehevaqz.fsf@yahoo.com> <83r0r6o3zk.fsf@gnu.org> <87edn6v2v3.fsf@yahoo.com> <83h6s2ng1p.fsf@gnu.org> <87v8gisz6u.fsf@yahoo.com> <83bki9ohsc.fsf@gnu.org> <87o7m9tga9.fsf@yahoo.com> <83sfblm66s.fsf@gnu.org> <87h6s1t01w.fsf@yahoo.com> <83jzwwnatg.fsf@gnu.org> <878rdcu2el.fsf@yahoo.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="18330"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 63589@debbugs.gnu.org, Eli Zaretskii To: Thiago Melo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 26 03:01:24 2023 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 1q2Lpc-0004fe-56 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 May 2023 03:01:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2LpK-0006rt-J8; Thu, 25 May 2023 21:01:06 -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 1q2LpH-0006pi-1q for bug-gnu-emacs@gnu.org; Thu, 25 May 2023 21:01:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2LpG-0000JS-Qd for bug-gnu-emacs@gnu.org; Thu, 25 May 2023 21:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q2LpG-0005Mn-5F for bug-gnu-emacs@gnu.org; Thu, 25 May 2023 21:01: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: Fri, 26 May 2023 01:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63589 X-GNU-PR-Package: emacs Original-Received: via spool by 63589-submit@debbugs.gnu.org id=B63589.168506280820552 (code B ref 63589); Fri, 26 May 2023 01:01:02 +0000 Original-Received: (at 63589) by debbugs.gnu.org; 26 May 2023 01:00:08 +0000 Original-Received: from localhost ([127.0.0.1]:48444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2LoO-0005LP-C8 for submit@debbugs.gnu.org; Thu, 25 May 2023 21:00:08 -0400 Original-Received: from sonic311-25.consmr.mail.ne1.yahoo.com ([66.163.188.206]:40418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2LoN-0005Jo-Dg for 63589@debbugs.gnu.org; Thu, 25 May 2023 21:00:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1685062801; bh=ug7cM7o5XRxrr5nKMN9RXBgfv3XLJ0Ham8b5UWS1tq0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=Sxd6kiHanijOqZkwIyyggBcdq1d323hXppdYafNnoJun7NQzVmPRL4gRk4PmBQhXb6P9Akjn4h7SLgnx+MzgdTVITR9DZ4QOTdmHc9ZRNLtY76pmKphd1VbCAuyPReCHL89b8t8EIuFh4PkLzhw04pNxFKRFG6lY5WrmeLmreb4MWUhmj/bUUob8i2ufGZ/cgdOiX3v1B7CENN7kp6/DnBHwfYZV9mOHpav9JUmCtemNzG8sF/KXuWb/QwSDZ3i8isUk4xtkS3Ttjamh7glpOJlGiqT593zrJK/A7vJfjtXAtxDi579NzeV5DDezm1+15gp95BlDbcejlYtZQjcmPQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1685062801; bh=ag4wz0iiBNoPPoO1JSrMeyqT5ki0H4HAKfaDemoCQa9=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=QVDyXwG6S3HYbdnsn/4mvQbOz8b1ljr34rZ/fw84KqULwtVkCIYrMnKPHtuo8fg/nZHpp0FspMqYGrJ6NvvJOhGVUB1MctzOqpk0MNuV0/1YAyTniW1U6Z2ZCBIUPVcmE6Gp/MnY2E7xaARRIYNm3agTuxM8Fa9ktfj3jBj5VYjhoQM5E8o4lhke5S0GziH7O6D+hObbiW4E6og/WbwrphPG5vjsKj8wGrrzl+Etw+ZZF+MQ65y2rYBAvmuK6HYLkcE/mN/HaHJjbmROkGDxC1SxzmJI+it+9V8uq53CvRWU4uww62+yxzop+UbXKWIXRnBTZiPVEmOT8X3rtm9gWg== X-YMail-OSG: st8LlCQVM1lntkpIQ5Ynd.yd3avXlysQBqac2_vNeESgaN3KNtUPRt1Cq1ZyN77 k05wcq7hjXJBsIG2ZfvyGbVQjzYarMbjnNhn_h5NfsHniU3R.5dOe_lFXCYEeiZPmugCD8wEZh71 LawBsjbhq7got9c6eP3Uxl0RmJ8tjZ58kTEkRq9PWHKtLow0x3HWbANoEmhMLa3EFGWARniPOaAM 9cdvqCSFIjVTvvaEOm1KeoSXp1v.4N68o0Msld4yLt6VogmbwdMSajnRb5hp449kPtT6sveChTpe hnX3NqsW51KFHfZlNvGgqKYdBxBGzZakGFwagjAFqv_HnE4KmsaN1CXmWxPtMQuY3Skek1wTe8si nN8H5Jfc5EAMR8bnzMDkUhGeKwsF0Lo9kaFpvGZGSgYjzUtgBNqbWTd6LUy6ciLDwvUWG3jPN4iq iZPeUPMZQpmfoj.d3_h1Mg4gJYDI_FAFjQcap9fBabHhh19j2auYP2R6vCrBpc06dhzKvcDVEXqA UsIxoD3lJFJi3u4I4J.NykecXiJgjLBPpsSEHvPryw3gMHlr_WMw1VansCEcH9K.7NGCKEyB6qFE LyzoDi2VBlv._nKF9yJxWCRRWA6VDMCUXO0vXeMvmqWFdjy9XuXz6Q8u99Bu_zEbG89puijNyRVx sQKiQchJJkHu2odXXeCck91Ck2apxUePW1GGWB1ZX8AJbAZCVG7zvw6RQ0ewKq6RXMmRTzCTtxBE Ha1j.h.5zGoejUufDMiXzKT10IUjD_P7U7ca3VjeY5aN2ogfs_PuD.D5ZxXYlAA5jXU2EaqzF2l5 .dib0DcXcmIdO03dM0h_t8WVTXoVxRJ0FpEUoYNxLs X-Sonic-MF: X-Sonic-ID: a345c91e-b4a6-4867-a9e7-9df0de744942 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ne1.yahoo.com with HTTP; Fri, 26 May 2023 01:00:01 +0000 Original-Received: by hermes--production-sg3-748897c457-524hn (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 49089c42d3c5ae1a5e2ef1b3059df785; Fri, 26 May 2023 00:59:59 +0000 (UTC) In-Reply-To: (Thiago Melo's message of "Thu, 25 May 2023 14:06:24 +0000") X-Mailer: WebService/1.1.21495 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:262396 Archived-At: Thiago Melo writes: > I'm not sure if you tested the last patch I sent as it is, or if you > previously did assert tests on your own with the device returned by > `cairo_xcb_surface_create' at `x_begin_cr_clip'. Assuming it's the > latter, then please pay close attention at this change I made to the > code: > > > if (cairo_surface_status (surface) == CAIRO_STATUS_SUCCESS) > eassert (FRAME_DISPLAY_INFO (f)->cairo_device > == cairo_surface_get_device (surface)); > > > Notice that, before I do the assert, I first check if the surface > returned by `cairo_xcb_surface_create' is good. One thing that I > observed when debugging is that, every time a new frame is created, > this part of the code is hit 3 times. The first time, the surface it > returns is always a bad one, which might even have some random garbage > value for the device. The other 2 times, it's a proper xcb surface, > and they always have the same device in common. Same thing with > subsequent calls, it's always the same cairo-xcb device. Similar > behavior when I make tooltips appear. I've attached a gdb session log > showing it. What version of Cairo did you test? >> If we are going down this route, I think we should save each distinct >> device returned by `cairo_surface_get_device', and delete each of them >> upon the terminal being deleted. >> As I explained, I saw that function return different devices for the >> same XCB connection, which is definitely a problem with Cairo. > > Considering my observation above, it doesn't seem that different > _valid_ devices are being created. But if that is really the case and > I'm missing it, then yes, we make a dynamic list of devices instead. > Consider also that, with the changes I proposed, a device reference is > kept from the beginning, which might influence the results here. Or let's just disable this by default, which is really the better solution until some people get their act together and fix this misdesign.