From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.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#34394: 27.0.50; Emacs segfaults with SLY, company and C-g Date: Sat, 09 Feb 2019 20:08:28 +0000 Message-ID: <875zts208z.fsf@gmail.com> References: <87va1tye42.fsf@gmail.com> <83wom9o0hu.fsf@gnu.org> <87r2chxpli.fsf@gmail.com> <83k1i9nugh.fsf@gnu.org> <87mun5xko7.fsf@gmail.com> <83h8ddnouf.fsf@gnu.org> <83ftsxnnug.fsf@gnu.org> <87bm3lxgr4.fsf@gmail.com> <83ef8hnm38.fsf@gnu.org> <877ee9xfid.fsf@gmail.com> <83bm3lnkfh.fsf@gnu.org> <8736oxxdsg.fsf@gmail.com> <87va1tvz54.fsf@gmail.com> <87r2chvylb.fsf@gmail.com> <831s4hng19.fsf@gnu.org> <83wom9m02z.fsf@gnu.org> <87bm3lgd8q.fsf@gmail.com> <83va1tlyqy.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="66716"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 34394@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 09 21:09:10 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsYw1-000HFM-Ej for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Feb 2019 21:09:09 +0100 Original-Received: from localhost ([127.0.0.1]:49385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsYw0-0000ym-Es for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Feb 2019 15:09:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsYvu-0000ye-U5 for bug-gnu-emacs@gnu.org; Sat, 09 Feb 2019 15:09:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gsYvu-0005bD-8R for bug-gnu-emacs@gnu.org; Sat, 09 Feb 2019 15:09:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42272) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gsYvu-0005au-49 for bug-gnu-emacs@gnu.org; Sat, 09 Feb 2019 15:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gsYvt-0004py-OL for bug-gnu-emacs@gnu.org; Sat, 09 Feb 2019 15:09: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: Sat, 09 Feb 2019 20:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34394 X-GNU-PR-Package: emacs Original-Received: via spool by 34394-submit@debbugs.gnu.org id=B34394.154974292118564 (code B ref 34394); Sat, 09 Feb 2019 20:09:01 +0000 Original-Received: (at 34394) by debbugs.gnu.org; 9 Feb 2019 20:08:41 +0000 Original-Received: from localhost ([127.0.0.1]:41553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gsYvZ-0004pL-9v for submit@debbugs.gnu.org; Sat, 09 Feb 2019 15:08:41 -0500 Original-Received: from mail-wm1-f41.google.com ([209.85.128.41]:40550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gsYvW-0004p7-46 for 34394@debbugs.gnu.org; Sat, 09 Feb 2019 15:08:38 -0500 Original-Received: by mail-wm1-f41.google.com with SMTP id q21so9448456wmc.5 for <34394@debbugs.gnu.org>; Sat, 09 Feb 2019 12:08:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=+ABcMd/umXuGLamfw0vH9jlw7iyrXaXZlB2gMCLioIg=; b=OC40hIds20pVxsVaKmOfORY1v87p+gS6KtFujcpKJ1n6Jh3dAJlTuv5RA8+ryso8Sx +MAQyyVFBzXn4gILH424Xe59YU1BIU4Be/gj6V0YfXcRXgO26Un65NTfGi8tu0amIHcR 3Ew0TMWqgOijvRRGSE+Tg9p5excdl0rrwUzV29GlisaxU/yoERKkDpAiW8rccpw0y5jQ OJueSx50gex5j7HQl38bykIKELH6xFzDDH0h1vtFUKKKJCjndn0ZSX2WJ+5/0vx1Bo33 904ou1wFN0KIzK+YsO1qz+9Y/svVaRpCHdC1t6WT/pnnjfKcL/vmMJd2RSSrzbNaMl4X lZmA== 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:in-reply-to:references :user-agent:date:message-id:mime-version; bh=+ABcMd/umXuGLamfw0vH9jlw7iyrXaXZlB2gMCLioIg=; b=GQZiErO45XKZncaBcjDRWh8JoDGZWbEyz+I9Hj3NEu6BAwIUyVqEuI/QxtqdWpeWBf yitQn/a4MLQXBqBm1dcEwnrz3qsvS4zzebvg7OwU0QlnajOWmZjdILL2j8xJMjRsuI/D 59TZp2uFz81aoZFzf+e3Lb2/blAu93UbkVIXcu7uUDgHfaitISoci5Q2NspO5afRVLgx z6lKnC3GQ3abwAlhcU9QZ5bJJq9qeCcYpmxj/QpTWG+qkMZyHBmq88iTQ7ofZin7BfTE Ryqk1gxQ5BYfx9GSGR/Zr1NN4IMfhr9Qd4gP6k9KCrj0RyUEZOQe+GRAWUawvLLr9CQ0 MHkQ== X-Gm-Message-State: AHQUAuaguw5Xp+XhHIdpEWgWiiLnlYu1d+wqXZ4egKPeFesBLR3n+YEK yfxUEJDHRpiOcLSYvbi3PU9PqMCN X-Google-Smtp-Source: AHgI3IaWjEIb5H0dA2NPegyaUEKTQJHE7OR80r47iAHHDrrSOWqPP1I48IBVe8qLYpJQYDO325sj+Q== X-Received: by 2002:a1c:2358:: with SMTP id j85mr2400191wmj.130.1549742911971; Sat, 09 Feb 2019 12:08:31 -0800 (PST) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id u15sm13765916wrm.63.2019.02.09.12.08.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Feb 2019 12:08:30 -0800 (PST) In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Sat, 9 Feb 2019 16:26:33 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:155327 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Jo=C3=A3o T=C3=A1vora writes: > On Sat, Feb 9, 2019 at 4:21 PM Eli Zaretskii wrote: > More importantly perhaps, SLY uses a network process, > not stdout, like these examples. I don't know if that > matters. So, I enhaced foo.el to use network processes and now I can finally reproduce it. All you have to do is src/emacs -Q -L path/to/company-mode -l company -l foo.el -f foo-test-bug =20=20 A company tooltip should popup. Type C-g. The expected behaviour is to exit the tooltip. If it does, erase the "foo" and type "f o o" again until it appears. Previously, I needed to move down and up a quickly with my right hand on the arrow, quickly pressing C-g on the left hand. That doesn't seem to be needed now for some reason. Anyway, hopefully this should help you freeze Emacs. Jo=C3=A3o --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=foo.el Content-Transfer-Encoding: quoted-printable ;;; foo.el --- the one and only -*- lexical= -binding: t; -*- (defvar foo-handlers nil) (defvar foo-listen-server nil) (defvar foo-server nil) (defvar foo-thing #'ignore) (defun foo-server-start () (interactive) (mapc #'delete-process (delete nil (cons foo-listen-server foo-handlers))) (setq foo-handlers nil) (setq foo-listen-server (make-network-process :name "foo-server" :server t :host "localhost" :service 0 ; auto-port :log (lambda (_listen-server client _message) (set-process-filter client (lambda (&rest _ignored) (send-string client (mapconcat #'identity (let ((i 0) comps) (while (< i 30) (setq i (1+ i)) (push (format "foo-completion-for-%s" (random 100)) comps)) comps) "\n")))) (push client foo-handlers))))) (defun foo-start () (interactive) (when foo-server (delete-process foo-server)) (setq foo-server (open-network-stream "FOO tcp endpoint" nil "localhost" (process-contact foo-listen-server :service))) (set-process-filter foo-server (lambda (&rest args) (apply foo-thing (cons 'filter args)))) (set-process-sentinel foo-server (lambda (&rest args) (apply foo-thing (cons 'sentinel args))))) (defun foo-from-process () (let ((ret (catch 'foo (let* ((foo-cancelled nil) (foo-thing (lambda (&rest args) (unless foo-cancelled (throw 'foo args))))) (send-string foo-server "irrelevant") (while (sit-for 30)) (setq foo-cancelled t) nil)))) (when (eq 'filter (car ret)) (caddr ret)))) (defun foo-capf () (let* ((bounds (bounds-of-thing-at-point 'symbol))) (list (car bounds) (cdr bounds) (lambda (string pred action) (funcall (completion-table-dynamic (lambda (_ignored) (let ((ret (foo-from-process))) (when ret (split-string ret))))) string pred action)) :company-docsig (lambda (_ignored) (let ((ret (foo-from-process))) (when ret (car (last (split-string ret))))))))) (defun foo-test-bug () (interactive) (setq completion-at-point-functions '(foo-capf)) (foo-server-start) (foo-start) (company-mode 1) (insert "foo") (company-complete)) --=-=-=--