From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: [MPS-test] scratch/igc branch (commit: 42731228d24) crashed Date: Mon, 05 Aug 2024 16:20:21 +0000 Message-ID: <87plqnuekc.fsf@protonmail.com> References: 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="19055"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eval Exec Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 05 18:27:09 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 1sb0Y9-0004gn-0d for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Aug 2024 18:27:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sb0Xq-0003p6-I9; Mon, 05 Aug 2024 12:26:50 -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 1sb0Rq-00077G-HW for emacs-devel@gnu.org; Mon, 05 Aug 2024 12:20:38 -0400 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sb0Rn-00008Y-3R for emacs-devel@gnu.org; Mon, 05 Aug 2024 12:20:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1722874827; x=1723134027; bh=ib/qD8u2r5u7CVPUz5OPy9SCPgxVxZ58cX0yy9YHZSY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=d1kkfxNv5bNIDqmM/XQIbjrWCJC91/nCmfeZBXGlDo55wS4rYGAVy0KfY88ccgw8A dtQuhMOTPH2KO23xObyKMkWGiPVqG+fPzGWuxGkH2Ys10nVhJvqjW7U5jqc+dIsr+a ilmflcuZG5TJy+Maq3+7KqqhF91hY8lv9C5d+pzS1u33Hcli48oq8qZhFYGBGBp7ic AT8oeW2BDg/9EvQ1J4pP19RVShSJInUD/ZEp9lKs3sPOfVr9tKR9i+X4BOdWHrLYXm 1tjv7Fkj9EWPwv+FV91Ihdo5m2d8a1zX9qo8QLUIzpBaJPWilQn20YjMXOEJGfcm0N rOZDKXqjlHoqA== In-Reply-To: Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 9bf16dc975be08ff96c32dee104c103c79e6218a Received-SPF: pass client-ip=185.70.43.16; envelope-from=pipcet@protonmail.com; helo=mail-4316.protonmail.ch 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, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 05 Aug 2024 12:26:49 -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:322392 Archived-At: "Eval Exec" 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-mailuti= ls\ > --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 sy= sdep.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, =09=09 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_height)= ; } 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 calls 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. Pip