From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Kirill A. Korinsky Newsgroups: gmane.emacs.bugs Subject: bug#71712: 29.3; Crash on OpenBSD Date: Sat, 22 Jun 2024 10:28:43 +0100 Message-ID: References: <864j9lju9u.fsf@gnu.org> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25000"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) Cc: 71712@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 22 11:29:28 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 1sKx3m-0006Ii-6i for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Jun 2024 11:29:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKx3Q-0007V8-NI; Sat, 22 Jun 2024 05:29:04 -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 1sKx3O-0007UT-CY for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 05:29:02 -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 1sKx3O-0007CQ-4X for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 05:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sKx3N-0001Ls-PR for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 05:29:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kirill A. Korinsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Jun 2024 09:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71712 X-GNU-PR-Package: emacs Original-Received: via spool by 71712-submit@debbugs.gnu.org id=B71712.17190485375184 (code B ref 71712); Sat, 22 Jun 2024 09:29:01 +0000 Original-Received: (at 71712) by debbugs.gnu.org; 22 Jun 2024 09:28:57 +0000 Original-Received: from localhost ([127.0.0.1]:44440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKx3J-0001LY-6p for submit@debbugs.gnu.org; Sat, 22 Jun 2024 05:28:57 -0400 Original-Received: from mx1.catap.net ([162.55.82.72]:1818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKx3G-0001LO-0V for 71712@debbugs.gnu.org; Sat, 22 Jun 2024 05:28:56 -0400 ARC-Seal: i=1; a=rsa-sha256; s=20240125rsa; cv=none; d=mx.catap.net; b=SD+TLKx wTmfG7Ai6L04jniovLvCdg6rPsdT35zWLQTmv5EfrPAMW/K+nIX4UhTVzuhW10K3UZClRu JXMDzHIZvxVrrsrr5kyJOe3AIG/RHwCpD7HV0Zc1LUnsac+GunCXAHUqwrgBuj/ZsEWOgA LpuadCktZ42TKVKnk0iFan5Qr09TmVUwt1kSn5RMHwrbRDHn6t/ykw+dUs4nuFZ8Jy+D/Y MgIWJKdry6xzXCyt1FYUMxir0lOpb2AMsF61xhAbTPBxvkE3meo1/d4ig+TzmjsL2eG6ie U+XOEzlDQvGhZV78xnVrL6OLEquOBDG/NvlR4El9e8CApBElx2TYMrA== ARC-Message-Signature: i=1; a=rsa-sha256; s=20240125rsa; c=simple/simple; bh=W GkchcULWqXEGk1tppxO4gsyWlFHer9aj7bUCry1I48=; h=references:in-reply-to: subject:cc:to:from:date:dkim-signature:dkim-signature; d=mx.catap.net; b=TsIOUz45qdtx65O5tlLszYU1bwevxtoDJYUxPo8TL/H0uc4vJTj5xz/g65wflY63tDWi YU+oOHraiMsdkQAXpdUZPUp8KSm4ibjlteMzA3TWCRnHtnnS9d1EIsuWr3cQ36I0Cd+rL9 rLdfLNaOFreRwbBBkdi+ECEiPKLguFbPNUZDIACkfBeIpfk3VMgRqsPeAYBB9hDzH6LS3O YP+vSlIg0m9T+A49P0B/OVJULQuwV1p7p672qM0fvebMpqUsvxPU/OhLgolP6gOWzxnYG/ /ee/N79s87hrg2MuyfOrrmnjJc/3HMdP6iTpyPhB894Qbqb7MMThOx0oirtHDuUw== ARC-Authentication-Results: i=1; mx.catap.net; dkim=pass header.s=20240125rsa header.d=korins.ky header.a=rsa-sha256; dkim=pass header.s=20240125ed25519 header.d=korins.ky header.a=ed25519-sha256; arc=none; iprev=pass; spf=none smtp.helo=postmaster@matebook.local; spf=softfail smtp.mailfrom=kirill@korins.ky DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=20240125rsa; bh=WGkchcUL WqXEGk1tppxO4gsyWlFHer9aj7bUCry1I48=; h=references:in-reply-to: subject:cc:to:from:date; d=korins.ky; b=lOmX6EwXsMPZqaJR1vsrA5716h4M1d UH61WvoUTXxBCKl66AJpSvXik5FlLJv8N8dFQnh+OBxZrTzWyguYcP2SiNILhw5M1hshN4 vSzrQLPZ68hKIdHGIix0bJTWIKGJJoAco/ZG8g2Him8cinjd42yCOttTAzGXbjO2ZclFm3 BqlZY5+D3fy4XOyv1/Iul+pXJQhbZRAcqiWdeS5NcQcPToQE+Q/t6DMecZQQotY8mRAqJZ rvevdt0lYksPytBW7SM2e7dlo9YrYQBVpkAsuaIaYKqff/mrfuAsUFgifYv6Aeo253RkUL 5pOYoh9X0bzT4sT9CMB0HKtZsYvQ/jMw== DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=20240125ed25519; bh=WGkchcULWqXEGk1tppxO4gsyWlFHer9aj7bUCry1I48=; h=references: in-reply-to:subject:cc:to:from:date; d=korins.ky; b=EN/aJvzseQsYyVFiQv xUFoDcNf3QIlWTTSwUGEzXoYvPA63b98EDzF6TF5vajrtRkv/I/QX9sYD9rIt8VtXJAA== Original-Received: by mx1.catap.net (OpenSMTPD) with ESMTPSA id 9fcccc04 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 22 Jun 2024 11:28:46 +0200 (CEST) In-Reply-To: <864j9lju9u.fsf@gnu.org> Mail-Followup-To: Eli Zaretskii , 71712@debbugs.gnu.org, kirill@korins.ky Mail-Reply-To: kirill@korins.ky 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:287680 Archived-At: On Sat, 22 Jun 2024 08:45:01 +0100, Eli Zaretskii wrote: > > Thanks. Is this reproducible? If so, can you show a recipe, > preferably starting from "emacs -Q"? > It crashes some times but I'd like to say that this is the first crash in this month. So, I have no idea how to reproduce, frankly speaking I just hasn't found running emacs and discovered .core The only clue that I have that I was switched to different virtual screen and emacs was on not seen one. Additionally, inside .xsession-errors I do have: 0xbf72627f9a1 at emacs 0xbf72625a8ee at emacs 0xbf72627f6c7 at emacs Segmentation fault (core dumped) > FWIW, I looked at the code, and I cannot understand how this could > happen. The cause of the crash is that 'face' is NULL, so face->font > segfaults. But 'face' is obtained from 'face_id', which is zero, > i.e. it's the default face: > > > glyph = {ch = 36, face_id = 0} > > And init_iterator, which called produce_special_glyphs, makes sure the > basic faces, including the default face, are recomputed just before > the call to produce_special_glyphs: > > if (FRAME_FACE_CACHE (it->f) == NULL) > init_frame_faces (it->f); > if (FRAME_FACE_CACHE (it->f)->used == 0) > recompute_basic_faces (it->f); > > And recompute_basic_faces aborts if it is unsuccessful in recomputing > the basic faces, one of which is the default face. Which didn't > happen here. So how this could happen is a mystery to me; I'm > probably missing something. This is indeed NULL: (gdb) up 9 #9 0x00000bf72613ced7 in produce_special_glyphs (it=0x723f0516cf78, what=) at xdisp.c:31605 31605 xdisp.c: No such file or directory. (gdb) p it $1 = (struct it *) 0x723f0516cf78 (gdb) p it->f $2 = (struct frame *) 0xbf99e5ccba8 (gdb) p it->f->face_cache $3 = (struct face_cache *) 0xbf9945600f0 (gdb) p *it->f->face_cache $4 = {buckets = 0xbf9e196d000, f = 0xbf99e5ccba8, faces_by_id = 0xbf93c9b3000, size = 168, used = 0, menu_face_changed_p = false} (gdb) p it->f->face_cache->faces_by_id $5 = (struct face **) 0xbf93c9b3000 (gdb) p it->f->face_cache->faces_by_id[0] $7 = (struct face *) 0x0 (gdb) p it->face_id $8 = 0 (gdb) so, I also dig a bit. I see that faces_by_id is enlarged as: /* Maybe enlarge C->faces_by_id. */ if (i == c->used) { if (c->used == c->size) c->faces_by_id = xpalloc (c->faces_by_id, &c->size, 1, MAX_FACE_ID, sizeof *c->faces_by_id); c->used++; } here, it's trust value from xpalloc, and inside I see that it uses xrealloc which has this logc: if (!val) memory_full (size); MALLOC_PROBE (size); return val; so, if val is NULL it calls memory_full and if it doesn't crash, it returns NULL which not always fails as I understand it. Does it make sense? -- wbr, Kirill