From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: bug#60144: 30.0.50; PGTK Emacs crashes after signal Date: Thu, 22 Dec 2022 09:28:58 +0800 Message-ID: <871qosb50l.fsf@yahoo.com> References: <87edsxfop0.fsf@yahoo.com> <83359dgt7v.fsf@gnu.org> <87a63lfcz7.fsf@yahoo.com> <83y1r5f6lh.fsf@gnu.org> <875ye9f385.fsf@yahoo.com> <83fsddey48.fsf@gnu.org> <871qowgbay.fsf@yahoo.com> <83bko0gact.fsf@gnu.org> <87wn6oesfx.fsf@yahoo.com> <835ye8fweu.fsf@gnu.org> <87sfhcdulj.fsf@yahoo.com> <838rj3ea07.fsf@gnu.org> <87cz8eetvi.fsf@yahoo.com> <835ye6cdh9.fsf@gnu.org> <87o7rxd0z6.fsf@yahoo.com> <831qosc3ev.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20731"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 22 02:30:07 2022 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 1p8APP-0005AN-Ax for ged-emacs-devel@m.gmane-mx.org; Thu, 22 Dec 2022 02:30:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p8AOe-0004SJ-EW; Wed, 21 Dec 2022 20:29:20 -0500 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 1p8AOa-0004Ru-PA for emacs-devel@gnu.org; Wed, 21 Dec 2022 20:29:16 -0500 Original-Received: from sonic314-21.consmr.mail.ne1.yahoo.com ([66.163.189.147]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p8AOY-0006AL-Tu for emacs-devel@gnu.org; Wed, 21 Dec 2022 20:29:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1671672549; bh=yCdTUA7c+hAi21ZHHQ9+JOK2RLA4K4cGR436QhV5Ocs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=iz8pH7LOusChChT5jHehuMbgQycIoMXrjE/w6VBS7mIhYDwN1y/9DPbpQ9vVR15VmOXaVenbYjDr2BsVP6NVrTB/pIoGgS4HdR42ZmeV490vqz3gi0x62SjiZ/kyQO9eD/B/42uTz9tXFItS0Zr0ZIk3YYv1em+7gqZ6gt5x43Jl5zJuRhJdAYI0oEEB9WOwQuIaezRWLzxeu6A2N7lKClMFz/5MT9wvSGxDrfs7gqsTn8au9NNOQsDPW/Wk0BG3ehN4wajrSaCstHpshewsOSGDZHm3AAjEpDtDIPrXqUjZfHIcJWHSX3JRdZrmmO3RpAMKzeKwLOv/pxVkTdgmFA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1671672549; bh=NsSScBTlxlhQausHe3YZ7DDNOYnk2zpRM6gGbivCeB/=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=XQ1UdD2i9UPY+12uosmC5LV+Hhn9cpLr+FuiqWGhTBiCyZ9/0vZSFj2U+CXkNnl/cQfbiuWqsVRvKfQCugDQZz1OYTf3NKinybZ6HAerpEmCAXuqtRfRjan22ympv3Ky++zcr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onic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Thu, 22 Dec 2022 01:29:09 +0000 Original-Received: by hermes--production-sg3-b666c6484-7wpvn (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 7ab208a9fd5e1a3af0f616bea399cec7; Thu, 22 Dec 2022 01:29:05 +0000 (UTC) In-Reply-To: <831qosc3ev.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 21 Dec 2022 15:06:00 +0200") X-Mailer: WebService/1.1.20982 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.189.147; envelope-from=luangruo@yahoo.com; helo=sonic314-21.consmr.mail.ne1.yahoo.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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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:301775 Archived-At: Eli Zaretskii writes: >> From: Po Lu >> Cc: emacs-devel@gnu.org >> Date: Wed, 21 Dec 2022 09:01:01 +0800 >> >> There is some kind of misunderstanding here. You seem to be talking >> about calling Lisp from another thread, which is a big no-no in my book >> as well. However, the problem is nowhere near as drastic. >> >> Under the GTK builds, there is only a single thread. The event loop >> runs from the main thread. Those calls to note_mouse_highlight *are* >> being done from the main thread. The problem is that it is unsafe to >> signal in the main thread when handle_one_xevent is being called by >> GLib, because GLib does the equivalent of this: >> >> static bool inside_callback; >> >> assert (!inside_callback); >> inside_callback = true; >> [call handle_one_xevent] >> inside_callback = false; >> >> If handle_one_xevent signals, then inside_callback will never be set to >> false. As a result, the next time GLib enters its own event dispatch >> code, it will abort, leading to the crash seen here. > > OK, so then I ask again: why not have the function called by GTK just > enqueue events and return, and then let read_socket_hook read the > enqueued events and process them as they are read, in keyboard.c? After the function returns, it is not guaranteed that Emacs will be able to enter read_socket_hook soon. (Sorry if this mail reaches you multiple times: the mail server is having issues.)