From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eval Exec Newsgroups: gmane.emacs.devel Subject: Re: [MPS-test] scratch/igc branch (commit: 42731228d24) crashed Date: Tue, 6 Aug 2024 00:50:58 +0800 Message-ID: References: <87plqnuekc.fsf@protonmail.com> <9d5pSofW1FhcAKO7fyf_c8hAwDE8aiuiDGWFglQZI-1FwaDY3KBS5zPkKt0nKUkzs0McRm9kHq47qZjzTz0rgfde5QfLH0v0KdgUxVXI6GA=@protonmail.com> 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="25295"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 05 19:37:49 2024 Return-path: Envelope-to: ged-emacs-devel@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 1sb1eW-0006N1-86 for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Aug 2024 19:37:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sb1dn-00052a-PX; Mon, 05 Aug 2024 13:37:03 -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 1sb0vR-000522-1l for emacs-devel@gnu.org; Mon, 05 Aug 2024 12:51:13 -0400 Original-Received: from mail-oa1-x42.google.com ([2001:4860:4864:20::42]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sb0vP-0004nL-A2 for emacs-devel@gnu.org; Mon, 05 Aug 2024 12:51:12 -0400 Original-Received: by mail-oa1-x42.google.com with SMTP id 586e51a60fabf-268eec6c7c1so262743fac.3 for ; Mon, 05 Aug 2024 09:51:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722876669; x=1723481469; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=egDG3byQV7M7Jf/LwJZBcWSxze90ZqmiLBsbEQVBpmc=; b=GmCVLuX+FHIL0RaReiuDg4YGM6WFGE7oee2kGJuc0DlICNu0JlYAU9wrKgpqkYl4Jh NiJMNPvqo2/KfXN2X0woZMPhMptPf/yuYag02wkAxq+QPZZ3dSp8vxOVj8C+PHoYg52r UBZOmfo8rzmwlmwX7Uv6PTIQ3ojz06afsAiJkJT/JqxaQRyfLuzAaT8NMkhUCzlHbDlr q1u2JtGwW8KpORFJdMLbfHA01coVAAmO2UehyAvK/Y023MVKMmruQDyE74JCLCEW1cPp x2L192z80G12fFiDjJGOd1cLCFBJPTZG1JDdwDzwID/RhlIS7M8imcchVnHMjuyGSmYq Xorw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722876669; x=1723481469; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=egDG3byQV7M7Jf/LwJZBcWSxze90ZqmiLBsbEQVBpmc=; b=O5FKFLo9BpfzlVCXC0U4CdooG2rOV5uK6BN6UprPoyt1wp2TM8oQzGGddP9rkCkwEB IhsaD30QRwRdIR/e161NgCh+Rb6M1dT62+9pPLzxmErGC6GSJrq+1t28vosECMPSrVpt SRXFLJmogq8+ZpCyIb1gyKKFjlkIPXZrFr9JUhExNNAsO3VsYFAxpUPUkZWXPrw//KNb LooDxQ4OSYWiYFe8R8MZwvPSRzYtLJUFY6zir3mDfns7XKn8EDQrDvETHk6rv5aRExDH CTXWkv57cdbowFutw8Mm/Dic5t5ByR5MgbpOzQcBeUHGLyKbtX0IFJtV1Ay7s6ll/5Bt MEpg== X-Gm-Message-State: AOJu0YzW9OVa8chc1qQlbHGlVp5Q/wz6PtVv3DDTSL7Q0RSPSLMWxSf0 LsXCZn7vAiEic2yPQ50LyQU1/mf809zkv00uK+hJ5L+u000lrnfAC/c7F2xSDXYjlL3dBn6a87X pfcAsk26L4WIB+qETr1KnKkU4A2U= X-Google-Smtp-Source: AGHT+IGl12Io6y7L52FfulGprB0UZv7/Z0PIM8D8zPebO0K+78rmXWy7f1UDXZChVQkPq65DoLMklzkSyuLVM2bf1P0= X-Received: by 2002:a05:6871:5c6:b0:260:e429:2498 with SMTP id 586e51a60fabf-26891d9aa4dmr15094190fac.26.1722876669114; Mon, 05 Aug 2024 09:51:09 -0700 (PDT) In-Reply-To: <9d5pSofW1FhcAKO7fyf_c8hAwDE8aiuiDGWFglQZI-1FwaDY3KBS5zPkKt0nKUkzs0McRm9kHq47qZjzTz0rgfde5QfLH0v0KdgUxVXI6GA=@protonmail.com> Received-SPF: pass client-ip=2001:4860:4864:20::42; envelope-from=execvy@gmail.com; helo=mail-oa1-x42.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 05 Aug 2024 13:37:01 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322400 Archived-At: Thank you! I'll try this PATCH. :heart: On Tue, Aug 6, 2024 at 12:41=E2=80=AFAM Pip Cet wro= te: > > On Monday, August 5th, 2024 at 16:20, Pip Cet wro= te: > > "Eval Exec" execvy@gmail.com writes: > > > > > I wanted to help test the scratch/igc branch, so I compiled it from > > > commit 42731228d24. > > > > Thank you for doing that! > > > > > Then I build it by > > > ```bash > > > make extraclean > > > ./autogen.sh \ > > > && ./configure \ > > > --prefix=3D$(realpath ../emacs-build)\ > > > --with-mps \ > > > --with-imagemagick \ > > > --with-modules --with-x-toolkit=3Dlucid --without-compress-install \ > > > --without-toolkit-scroll-bars --with-native-compilation --with-mailut= ils\ > > > --with-tree-sitter --with-xinput2 \ > > > --with-dbus --with-native-compilation=3Daot \ > > > --with-file-notification=3Dinotify\ > > > && make -j20 install > > > > > > Like Eli, I'm suspecting the Lucid widget code... > > > > > It works perfectly for the first hour, but then it crashes, and I > > > don't know how to reproduce the issue. > > > > > > I think the crash is caused by "window size adjustments" > > > ``` > > > (gdb) bt > > > #0 0x00007f47afea2efc in __pthread_kill_implementation () from > > > /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so= .6 > > > #1 0x00007f47afe52e86 in raise () from > > > /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so= .6 > > > #2 0x00000000004243a4 in terminate_due_to_signal (sig=3Dsig@entry=3D8= , > > > backtrace_limit=3Dbacktrace_limit@entry=3D40) at emacs.c:470 > > > #3 0x00000000004248fc in handle_fatal_signal (sig=3Dsig@entry=3D8) at= sysdep.c:1800 > > > #4 0x000000000056f568 in deliver_thread_signal (sig=3D8, > > > handler=3D0x4248f1 ) at sysdep.c:1792 > > > #5 0x000000000056f669 in deliver_fatal_thread_signal (sig=3D > > out>) at sysdep.c:1812 > > > #6 > > > #7 0x000000000069e35e in pixel_to_char_size > > > (pixel_width=3Dpixel_width@entry=3D482, > > > pixel_height=3Dpixel_height@entry=3D76, > > > char_width=3Dchar_width@entry=3D0x7ffced20da38, > > > char_height=3Dchar_height@entry=3D0x7ffced20da3c, > > > ew=3D) at widget.c:172 > > > > > > That code reads: > > > > static void > > pixel_to_char_size (EmacsFrame ew, Dimension pixel_width, > > Dimension pixel_height, int *char_width, int *char_height) > > { > > struct frame *f =3D ew->emacs_frame.frame; > > > > > > *char_width =3D FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, (int) pixel_width); > > *char_height =3D FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, (int) pixel_heigh= t); > > } > > > > Which gets a frame pointer from a structure (ew) that MPS doesn't know > > about; but frames can move, so that explains the bug, because MPS > > doesn't know to update the pointer in the EmacsFrame structure. > > > > Unfortunately, the structure is allocated by XtCreateWidget, which call= s > > malloc(), IIUC. So it's not immediately obvious (to me) how to fix it. > > My best idea so far is to create an ambiguous root covering the frame > > pointer and store that in the structure instead. > > So I've done that, can you try the attached patch? This is a first stab (= thus the ambiguous alloc), but it should prevent the crash we've seen. > > TODO list for this: > - use precise alloc > - check framep, not *framep, in EmacsFrameInitialize > > Pip