From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70311: Crash when dnd-indicate-insertion-point is non-nil Date: Sat, 13 Apr 2024 19:58:25 +0800 Message-ID: <87il0l325a.fsf@yahoo.com> References: <86wmp1pqj3.fsf@gnu.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8152"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 70311@debbugs.gnu.org, Greg Sexton To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 13 13:59:10 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 1rvc2I-0001qM-BL for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Apr 2024 13:59:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rvc22-0003q7-8Q; Sat, 13 Apr 2024 07:58:54 -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 1rvc20-0003pT-2b for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2024 07:58:52 -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 1rvc1z-0006V8-Qa for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2024 07:58:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rvc29-0000ZU-VI for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2024 07:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Apr 2024 11:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70311 X-GNU-PR-Package: emacs Original-Received: via spool by 70311-submit@debbugs.gnu.org id=B70311.17130095362184 (code B ref 70311); Sat, 13 Apr 2024 11:59:01 +0000 Original-Received: (at 70311) by debbugs.gnu.org; 13 Apr 2024 11:58:56 +0000 Original-Received: from localhost ([127.0.0.1]:60245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvc23-0000Z9-Vr for submit@debbugs.gnu.org; Sat, 13 Apr 2024 07:58:56 -0400 Original-Received: from sonic306-20.consmr.mail.ne1.yahoo.com ([66.163.189.82]:42494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvc22-0000YH-GZ for 70311@debbugs.gnu.org; Sat, 13 Apr 2024 07:58:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1713009518; bh=dfi6Y+SU2vgjuT+cRVgC0hwp1JMrMWYpSE779Y0mNLw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=T/0eYrDqhCm9l1Ov3li4J3BFeJRd8quIKa0YWl6evaJp6tRslB0e/tVLDfa5k+IdAVnq+2LjhoJYMOicjgJsGFElbtLm1lSBeRLwR8lGDYxOHfCrza5N9P0sIecgTAkk1egOClrajLboAJjgY6SLzLvUGCbBKsirYDM06iq2RDwzsP4a/+YbedE1w4oDIrsR+IzWKKMq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25DX86crXpOkOnYfl rta3jbBbBvngMEpcnu4DCQuA9O4VgipkjzLm9uIeknrXOGTZrI9a68QzscSYBIhKPgD95ovxGQDr epMhhqQOhrw3GalnDm80knLle_zv1l3RgZweJn5eELysMflLy_CPMW2hJ7ohjEw7vsUI8FevNEUT cOt0gZsmDXGAGBvg_qQ_ecwvXJ0dh8TDcI7lRrxzhDJGnsxeE7ahv_zq.7YEoyNyOMy_fbnJBI0o bWzVvPznMzUy8pjVDtpIqixPAkYqfRxknnO97LAuYku0Ep90yzS5su1brxDhpZWn06MMpsMCV4Xc bs0cmpoNcq0f0GAk672ucUVJa7djx6tU7o3uetLg3yOmwnQNS9CA.sqeibEmewoeczvPSW1kNlbb mFjf48zWj5H4BJBrB7VYhnekPHxAQ46I17ujLCioLu X-Sonic-MF: X-Sonic-ID: 1d7e857e-7213-436f-9e58-9d4b17470889 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Sat, 13 Apr 2024 11:58:38 +0000 Original-Received: by hermes--production-sg3-6f9f87bd85-d9mmq (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID b20cb209323dbeebafebb5c2109b4f97; Sat, 13 Apr 2024 11:58:35 +0000 (UTC) In-Reply-To: <86wmp1pqj3.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 13 Apr 2024 12:20:48 +0300") X-Mailer: WebService/1.1.22205 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:283204 Archived-At: Eli Zaretskii writes: >> From: Greg Sexton >> Date: Tue, 9 Apr 2024 11:26:41 +0100 >> >> Emacs (29.1.90) can crash on Mac OS X when dnd-indicate-insertion-point >> is non-nil. >> >> I'm not able to deterministically reproduce this, but I have a high >> success rate dragging a file over the window and just randomly moving >> it around without releasing the click. >> >> This said, I attached a debugger and found the root cause. >> >> There is code that looks like this in dnd-handle-movement: >> >> (when dnd-indicate-insertion-point >> (ignore-errors >> (goto-char (posn-point posn)))) >> >> posn-point can return nil, which causes goto-char to call >> wrong_type_argument, this reaches signal_or_quit (eval.c), which calls >> emacs_abort as waiting_for_input is true. >> >> A quick fix might be to when-let the result of posn-point, but I'm >> unsure if waiting_for_input being true points to a deeper issue. > > Po Lu, any comments or suggestions? As regards suggestions, none at present. It's not clear to me why waiting_for_input should continue to exist, but neither am I especially satisfied with the present arrangements for calling drag-and-drop callbacks in nsterm.m: some means should be devised of returning to the event loop during a DND session, rather than calling Lisp and parts of redisplay from non-reentrant input handlers that the toolkit can call at will. Come to think of it, at the time this kludge was written, I never quite understood why DND events were never received on Mac OS, when the same was smooth sailing on GNUstep.