From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#42943: 28.0.50; Emacsclient crashes in ftcrfont_glyph_extents Date: Sat, 24 Oct 2020 13:24:42 +0200 Message-ID: References: <877dtuta6z.fsf@tcd.ie> <87y2m82ix4.fsf@gnus.org> <87zh4emnzm.fsf@gnus.org> <87lffxlxm5.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23029"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , 42943@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 24 13:25:39 2020 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 1kWHg3-0005sz-Ba for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Oct 2020 13:25:39 +0200 Original-Received: from localhost ([::1]:57232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWHg2-000358-4w for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Oct 2020 07:25:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWHfT-0002rj-94 for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2020 07:25:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49528) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kWHfT-0000zU-0Z for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2020 07:25:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kWHfS-000229-Th for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2020 07:25:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <877dtuta6z.fsf@tcd.ie> Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Oct 2020 11:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42943 X-GNU-PR-Package: emacs Original-Received: via spool by 42943-submit@debbugs.gnu.org id=B42943.16035386947784 (code B ref 42943); Sat, 24 Oct 2020 11:25:02 +0000 Original-Received: (at 42943) by debbugs.gnu.org; 24 Oct 2020 11:24:54 +0000 Original-Received: from localhost ([127.0.0.1]:32839 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWHfJ-00021T-Px for submit@debbugs.gnu.org; Sat, 24 Oct 2020 07:24:54 -0400 Original-Received: from mail-wr1-f67.google.com ([209.85.221.67]:44980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWHfF-00021C-Qm for 42943@debbugs.gnu.org; Sat, 24 Oct 2020 07:24:51 -0400 Original-Received: by mail-wr1-f67.google.com with SMTP id t9so5446792wrq.11 for <42943@debbugs.gnu.org>; Sat, 24 Oct 2020 04:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:message-id:mime-version :content-transfer-encoding; bh=M6mXdBKNokKCDFT2hObqWNSTv27NyGGfJ6HKUFo1GQ4=; b=OLAfHVfvOKQLqjkJLmAPwoeDXDvUYKuvvkfCptnDQkp3/edpHHEDatA3+ZqvhPI8Hm jMbtiB7tX4UUAnjO92lxtz2SySAY7OKh1ctJwMpXUxdQi9KGo70oHitO8P+Kk8zPZZVq sJE4qVyDVHsDRu5DDljKxX7Y4OgRPqH3NbzWvEI7zh1Q40E9KdOa88OssQjySQzXp33r j3tOVToOEJEK86di9252nRhtUFZcbpqMMsMrUb7bmpFkqEO8JJodaXSH+ZKGrzvjI3fc nPFKC2AgqM01MNafOoA8yJFe5QouaDzMn0vkgIcBA3nkguzSp1Q5Wc7BGb9BAU4wiIW8 6jMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:message-id :mime-version:content-transfer-encoding; bh=M6mXdBKNokKCDFT2hObqWNSTv27NyGGfJ6HKUFo1GQ4=; b=X29MFz5DGkK1oaVX50vp0pv5qiGnSt6pmTiM/wSGYA9EBYDGbjA7px0NX2eWSU9H4y om+zpvjHNjyNuuChhVpwW/wSSf6xu64fjtfSquX9oSJTgBI/vNW8PyY/Fpwk/c1GG9Xl +BWve2P2VjmKckRTKOnflMIPuXVO4I15CTqVWZ8artpwGmFC9jOhqrqcOMwbcifGOcLv 4uwgkHvo8iP09fPO4Z0Ybi+x+JmfAeHbihCWjjQAFwxtEQc7OaNoSSJtdGJwrUdXPQcM OuEG46M5jQK6ToadlUT/MTAuovJanhLyDa9+VtMANvE20QbeUL4vGVxSeVhBZYlmrz1S +U5A== X-Gm-Message-State: AOAM532FihVQ8XpyrcdJK/O7RpV9M+/GqTxw+H1zbchapS0jGHTUtCIQ 13se9QDoJIbVXTXBkIeoD+A= X-Google-Smtp-Source: ABdhPJy22fGXAlZjVcjgrLkBARaOuxwp4lxaOXo8m4JS4E99NsK8t8VbYzpwSfeWtVTWvhQfElpMpw== X-Received: by 2002:adf:f4ca:: with SMTP id h10mr6984730wrp.89.1603538683893; Sat, 24 Oct 2020 04:24:43 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:8d6e:d31:eb45:4a86]) by smtp.gmail.com with ESMTPSA id d30sm10318505wrc.19.2020.10.24.04.24.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Oct 2020 04:24:43 -0700 (PDT) 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" Xref: news.gmane.io gmane.emacs.bugs:191416 Archived-At: >>>>> On Thu, 22 Oct 2020 23:11:30 +0100, "Basil L. Contovounesios" said: Basil> Sadly, it doesn't seem to have - I still get a segfault, at leas= t in my Basil> optimised build of master. Hopefully I'll find some time over t= he Basil> weekend to look into it. I can reproduce this with a GTK3 + cairo build. Your recipe is very helpful, in fact just doing 'C-\ arabic RET' is enough to cause the second emacsclient invocation to crash. Running emacs under valgrind shows what's going on, but I don=CA=BCt know how to fix it: =3D=3D9766=3D=3D Invalid read of size 2 =3D=3D9766=3D=3D at 0x3F8FED: ftcrfont_glyph_extents (ftcrfont.c:81) =3D=3D9766=3D=3D by 0x3F93A0: ftcrfont_draw (ftcrfont.c:522) =3D=3D9766=3D=3D by 0x25C67F: x_draw_composite_glyph_string_foreground (= xterm.c:1969) =3D=3D9766=3D=3D by 0x25F9A4: x_draw_glyph_string (xterm.c:3780) =3D=3D9766=3D=3D by 0x1BFC4D: draw_glyphs (xdisp.c:28915) =3D=3D9766=3D=3D by 0x1C65EA: gui_write_glyphs (xdisp.c:30933) =3D=3D9766=3D=3D by 0x15227D: update_text_area (dispnew.c:3849) =3D=3D9766=3D=3D by 0x152C38: update_window_line (dispnew.c:4092) =3D=3D9766=3D=3D by 0x151858: update_window (dispnew.c:3573) =3D=3D9766=3D=3D by 0x151015: update_window_tree (dispnew.c:3344) =3D=3D9766=3D=3D by 0x150C48: update_frame (dispnew.c:3226) =3D=3D9766=3D=3D by 0x19766E: redisplay_internal (xdisp.c:16023) =3D=3D9766=3D=3D Address 0xf36a92e is 126 bytes inside a block of size 1,2= 80 free'd =3D=3D9766=3D=3D at 0x48369AB: free (vg_replace_malloc.c:530) =3D=3D9766=3D=3D by 0x327438: xfree (alloc.c:820) =3D=3D9766=3D=3D by 0x3F9EF4: ftcrfont_close (ftcrfont.c:307) =3D=3D9766=3D=3D by 0x3F9EF4: ftcrfont_close (ftcrfont.c:282) =3D=3D9766=3D=3D by 0x37B285: font_clear_cache (font.c:2648) =3D=3D9766=3D=3D by 0x37B096: font_finish_cache (font.c:2593) =3D=3D9766=3D=3D by 0x37E258: font_update_drivers (font.c:3588) =3D=3D9766=3D=3D by 0x15F56E: delete_frame (frame.c:2093) =3D=3D9766=3D=3D by 0x15FD21: Fdelete_frame (frame.c:2325) =3D=3D9766=3D=3D by 0x35F1FD: funcall_subr (eval.c:2884) =3D=3D9766=3D=3D by 0x35EDE9: Ffuncall (eval.c:2809) =3D=3D9766=3D=3D by 0x356002: Ffuncall_interactively (callint.c:253) =3D=3D9766=3D=3D by 0x35F0FC: funcall_subr (eval.c:2862) =3D=3D9766=3D=3D Block was alloc'd at =3D=3D9766=3D=3D at 0x483577F: malloc (vg_replace_malloc.c:299) =3D=3D9766=3D=3D by 0x327BEB: lmalloc (alloc.c:1359) =3D=3D9766=3D=3D by 0x3272FA: xmalloc (alloc.c:761) =3D=3D9766=3D=3D by 0x3F9093: ftcrfont_glyph_extents (ftcrfont.c:73) =3D=3D9766=3D=3D by 0x3F94B2: ftcrfont_text_extents (ftcrfont.c:371) =3D=3D9766=3D=3D by 0x3803DA: font_fill_lglyph_metrics (font.c:4430) =3D=3D9766=3D=3D by 0x3E1736: fill_gstring_body (composite.c:843) =3D=3D9766=3D=3D by 0x3E42C4: Fcomposition_get_gstring (composite.c:1792) =3D=3D9766=3D=3D by 0x3E1BC3: autocmp_chars (composite.c:912) =3D=3D9766=3D=3D by 0x3E2BCE: composition_reseat_it (composite.c:1269) =3D=3D9766=3D=3D by 0x1858B9: next_element_from_string (xdisp.c:8578) =3D=3D9766=3D=3D by 0x1854C6: next_element_from_string (xdisp.c:8504) The call to ftcrfont_glyph_extents is from here: static int ftcrfont_draw (struct glyph_string *s, int from, int to, int x, int y, bool with_background) { struct frame *f =3D s->f; struct face *face =3D s->face; struct font_info *ftcrfont_info =3D (struct font_info *) s->font; So this means that the struct glyph_string here still refers to the font from the previous frame, which has been closed. I=CA=BCm not sure how to get it to refer to the right font on the new frame. Robert --=20