From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer Date: Tue, 08 Dec 2020 15:56:49 +0000 Message-ID: <877dps47ge.fsf@gmail.com> References: <87h7ow4j4o.fsf@gmail.com> <83mtyo71dh.fsf@gnu.org> 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="22943"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 45117@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 08 16:58:18 2020 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 1kmfNZ-0005r4-PJ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Dec 2020 16:58:17 +0100 Original-Received: from localhost ([::1]:33410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kmfNY-0006jb-Oz for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Dec 2020 10:58:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmfML-0005sh-Sf for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2020 10:57:01 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kmfML-000661-Ju for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2020 10:57:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kmfML-0005Ne-Iw for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2020 10:57:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Dec 2020 15:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45117 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160744302020670 (code B ref -1); Tue, 08 Dec 2020 15:57:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Dec 2020 15:57:00 +0000 Original-Received: from localhost ([127.0.0.1]:59282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmfMJ-0005NI-5R for submit@debbugs.gnu.org; Tue, 08 Dec 2020 10:56:59 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:53556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmfMH-0005N9-2o for submit@debbugs.gnu.org; Tue, 08 Dec 2020 10:56:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmfMG-0005kq-QJ for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2020 10:56:56 -0500 Original-Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:50708) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kmfMF-00062c-2q; Tue, 08 Dec 2020 10:56:56 -0500 Original-Received: by mail-wm1-x330.google.com with SMTP id c198so2467372wmd.0; Tue, 08 Dec 2020 07:56:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=O1RYlGCSQ3Dv8410JSm1slTANB/3laWOugi1EZlaWOk=; b=YJrkd6JzxTj5DmlXdBmFrgz0TAj/5R1uhh7WODQor7L97MNS7n5tzRzRrGwWqKE4vm /xjmcWOGkyQh7nILURB9ByShJwQQ4/54x4WZPOuNS0peSmbZsx/Rcip5rHcWbCU6Hm52 rw1urj/4TmvYjdhw4ihWfI11OiI/qRIMSD9h8ZKGVt9krFj6FiA3zugFMnpf/VcBcx7r o4xa7fw77YiSXBTe5ZrG49V/OREmxK8eTx1l3LZecQnuwdalKCcqFr47FEVJU1EnfnEP 11W/zGBM3gvhx1GgVn/w9NVlIC7nds8P/a104DIqM+0sL4pR1NBhvHqrJbWSnsGDokXP KQvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=O1RYlGCSQ3Dv8410JSm1slTANB/3laWOugi1EZlaWOk=; b=Z77L3JSnTY5oWyJQr5sE7fKwhtsDp0BCfTwNOYUcXjls+Qdy8yrWdjQmkzSJlLjWOQ Qmt1rWSCpM+l1M1oh5J3v1uwVJ//ji3o7xV8q7E8+QCd+jaGhVifoMz1HJ9PJYoV/BUe 3awqr8Ym0XRb1IwLe//rzrw+5/d/3E4gf7maWLDHreP10tfLZPyPSR9OMLkNbsIfC/tz NG6SCaVawoLQJ6PmnjH2ASYm5qzRiJXzP0Z2n7PnE+UHTU6cmF0I+vHFo2V9wgo8E5mF edM/Sd15jgyNxbLHwdMH7jn1SOsrrLrEpe8OMMQT9Htgt+b3eXB8DupNOBlK/WTjvz09 DfOg== X-Gm-Message-State: AOAM5338xBcV91J7ZmCBl65SarGpxp/gdZvDPh++SvLdMf131tgt9v8P HhuapRlTchbmMHdhdlBXJ0+IFASO4wc= X-Google-Smtp-Source: ABdhPJzep1MaD4KwPfRgt5R+CuqKidT63GxZl2Hb6BKRfKzwHRakoQgBoIHChw0zha8Qq2lSo8Hulg== X-Received: by 2002:a7b:c773:: with SMTP id x19mr4315921wmk.127.1607443011741; Tue, 08 Dec 2020 07:56:51 -0800 (PST) Original-Received: from krug ([87.196.174.9]) by smtp.gmail.com with ESMTPSA id i8sm4151275wma.32.2020.12.08.07.56.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Dec 2020 07:56:51 -0800 (PST) In-Reply-To: <83mtyo71dh.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 08 Dec 2020 17:39:54 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=joaotavora@gmail.com; helo=mail-wm1-x330.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-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" Xref: news.gmane.io gmane.emacs.bugs:195373 Archived-At: Eli Zaretskii writes: >> From: Jo=C3=A3o T=C3=A1vora >> Date: Tue, 08 Dec 2020 11:44:39 +0000 >>=20 >> When using SLY Common Lisp IDE package for Emacs, a user has recently >> reported a strange intermittent error in SLY's asynchronous ElDoc >> function. That function produces documenttion by querying a network >> process, a common technique in many such IDEs. The user found that when >> reducing eldoc-idle-delay to 0.1 he could trigger the problem more >> often. >>=20 >> The original report lives at >> https://github.com/joaotavora/sly/issues/385. >>=20 >> It was triggered with Emacs 27.1, but I have also reproduced it with a >> recent master build. >>=20 >> After analysing the problem, I came to the conclusion that given certain >> mysterious conditions, process-send-string, which is called from SLY's >> `eldoc-documentation-function` will abruptly return non-locally even >> though no error or quit seems to have been signalled. > > Can you elaborate on the evidence you found of this non-local exit? It was evidenced by M-x trace-function process-send-string RET and also by substituting the snippet I posted earlier with: (unwind-protect (progn (sly-send `(:emacs-rex ,form ,package ,thread ,id ,@extra-options)) (setq send-success t)) (if send-success (push (cons id continuation) (sly-rex-continuations)) (sly-message "[issue#385] likely `process-send-string' exited non-locally from t= imer.") (sly-log-event `(:issue-385-sly-send-fishiness :id ,id :form ,form ) sly-dispatching-connection))) Once in a while, the else branch of the if triggered. Anyway, here's an observation: 1 -> (process-send-string # "00044d(:emacs-rex (slynk:autodoc (quote (\"defpackage\" \":slynk\" (\":use\" \":cl\" \":slynk-backend\" \":slynk-match\" \":slynk-rpc\") (\":export\" \"#:startup-multiprocessing\" \"#:start-server\" \"#:create-server\" \"#:stop-server\" \"#:restart-server\" \"#:ed-in-emacs\" \"#:inspect-in-emacs\" \"#:print-indentation-lossage\" \"#:invoke-sly-debugger\" \"#:slynk-debugger-hook\" \"#:emacs-inspect\" \"#:authenticate-client\" \"#:*loopback-interface*\" \"#:*buffer-readtable*\" \"#:process-requests\") (\":export\" \"#:*communication-style*\" \"#:*dont-close*\" \"#:*fasl-pathname-function*\" \"#:*log-events*\" \"#:*log-output*\" \"#:*configure-emacs-indentation*\" \"#:*readtable-alist*\" \"#:*global-debugger*\" \"#:*sly-db-quit-restart*\" \"#:*backtrace-printer-bindings*\" \"#:*default-worker-thread-bindings*\" \"#:*macroexpand-printer-bindings*\" \"#:*slynk-pprint-bindings*\" \"#:*string-elision-length*\" \"#:*inspector-verbose*\" \"#:*require-module*\" \"#:*eval-for-emacs-wrappers*\" \"#:*debugger-extra-options*\" \"#:*globally-redirect-io*\" \"#:*use-dedicated-output-stream*\" \"#:*dedicated-output-stream-port*\" slynk::%cursor-marker%))) :print-right-margin 80) \":slynk\" t 100) ") 1 <- process-send-string: !non-local\ exit! This was was pretty long, but it can be slower. Also it was after 100 successful similar calls. > And does "no error or quit" mean there's no trace of anything abnormal > in the *Messages* buffer? Yes, exactly. > One possible reason for non-local exit, besides signaling an error, is > stack overflow, although your description doesn't seem to indicate > that this is probable. Indeed. > One other piece of information that could be relevant is that when > Emacs calls the timer function, it sets inhibit-quit non-nil. Right, and I added a formatting of quit-flag to the message call I showed earlier and it came out nil. [sly] [issue#385] likely `process-send-string' exited non-locally from t= imer, also quit-flag =3D nil. Jo=C3=A3o