From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ioannis Kappas Newsgroups: gmane.emacs.bugs Subject: bug#46284: 27.1; emacs-27: windows-nt regression with process sentinel's change description argument Date: Wed, 3 Feb 2021 22:50:54 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000012a67105ba766c2d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40384"; mail-complaints-to="usenet@ciao.gmane.io" To: 46284@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 04 04:27:21 2021 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 1l7VIf-000AN8-3u for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Feb 2021 04:27:21 +0100 Original-Received: from localhost ([::1]:55066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7VId-0004YQ-HR for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Feb 2021 22:27:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7VIN-0004WV-FU for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 22:27:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56054) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7VIM-0001OT-Q3 for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 22:27:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l7VIM-0007fR-M0 for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 22:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ioannis Kappas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Feb 2021 03:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46284 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161240916829353 (code B ref -1); Thu, 04 Feb 2021 03:27:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Feb 2021 03:26:08 +0000 Original-Received: from localhost ([127.0.0.1]:39355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7VHT-0007dL-2E for submit@debbugs.gnu.org; Wed, 03 Feb 2021 22:26:07 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:40278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7QzR-0006tR-Dm for submit@debbugs.gnu.org; Wed, 03 Feb 2021 17:51:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7QzR-0001Kr-4v for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 17:51:13 -0500 Original-Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]:46395) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7QzM-0006WL-54 for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 17:51:12 -0500 Original-Received: by mail-oi1-x236.google.com with SMTP id k25so1631313oik.13 for ; Wed, 03 Feb 2021 14:51:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=IT64Zre32yk8WoRseunfRiDQNNm+6T0tJ8aH7d8Veg8=; b=bJmb/EsJcI7BADY8RYhmBsYPgtr/eSzzR+30759+Q2b1Z2Zdlb610Bz7Sc8bOrobUm +KckNFg7iNGca9rH4O8X5fbd/YuhNfruq9aQpC19XhwiwKvO4WCVYPnmf520giCICUij hVVjU7tiAjRBzuNE9LNNNxinTxGACRa6YciqkQHPAbPd6+QTrRLcM4GHRyUy3g0QSvGy G6LM+HFZ4EwWTQOixq4tHVGoyHLrccEYP9tuBDGCkSLZleAuTZ5WxhUCASSLhPNgJt/l iXLMjn2jbpYpzH37xR+EhT3mvLqSA5/yYZAPjJdB8WW9gyTn0FcsmBJhzVhyhGKMLaZa 3cdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=IT64Zre32yk8WoRseunfRiDQNNm+6T0tJ8aH7d8Veg8=; b=tR/c7hZeSSJOc4dczgWtLcYQmq4x29DNW6/s4e1x8+4llOjDSUvaAj8j1nRqBmLUVE wlpaYL2KIxnEq+1mqr3PL+HrHCj9eWPumBebGZIUgN1ttSBOKWE3HvY9rocPicNIIiQw in3W7W5riM0FD3a4iQgGsvd4UcWW0Q5p1jcaVN7X0jV5DW0ilL6dbBmPP7aonujws9yQ U1iGcTYwk4hp9xEwCI8+RJNM+8knh/o2oyCm8ec2sxOHOG7Ql3fEIUodVfclcP9fCJ/H zl2h24ZwQQv0skBYAQCwMBI5oHF7TxjSgnoSCEsUn0qNnEoLpscmGaGXsnCgDwzCwnxK bL9Q== X-Gm-Message-State: AOAM530hA0REK26H1722xWe0JVdLx3OiRkDwrRhk6soZOpIGaqzk3EDs oAh3bfAtaDqLlrchvE+Z7KREQ8fS7ov1A+zjEF224Scc/14qMw== X-Google-Smtp-Source: ABdhPJxC2FgkgLPtw2W4d2zb11x/ghTe2KXeqdBgvYArLsaCtg+myFThOnRnndN2rDCjlxEH2+k5lp5q0shoYIdbLc8= X-Received: by 2002:aca:7206:: with SMTP id p6mr3596275oic.78.1612392665615; Wed, 03 Feb 2021 14:51:05 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::236; envelope-from=ioannis.kappas@gmail.com; helo=mail-oi1-x236.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, HTML_MESSAGE=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-Mailman-Approved-At: Wed, 03 Feb 2021 22:26:05 -0500 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:199259 Archived-At: --00000000000012a67105ba766c2d Content-Type: multipart/alternative; boundary="00000000000012a66f05ba766c2b" --00000000000012a66f05ba766c2b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable There appears to be a bug in emacs-27 on windows-nt when a call is made to a process' sentinel in response to a kill- or interrupt-process call. The second argument to the sentinel (the "string describing the change") is set to a "unknown signal" rather than to "interrupt\n" as it was the case in the latest emacs-26 or in emacs-28 branches: | system-version | second argument passed to the sentinel | |----------------+----------------------------------------| | 26.3.50 | interrupted\n | | 27.1.91 | unknown signal\n | | 28.0.50 | interrupted\n | The expectation is that, under windows-nt, the process sentinel should pass in an "interrupted\n" value to the change description argument when interrupt-process has successfully interrupted a process. An ert test is included to showcase the issue that only fails in emacs-27 on windows-nt. The test starts an idle emacs process, sets-process-sentinel, calls interrupt-process on it, and then compares the sentinel's second argument whether it is the de facto expected "interrupted\n" text or otherwise. The test fails on the latest emasc-27 since the argument that emacs is passing in is "unknown signal". To execute, save the test file and execute the following command: emacs.exe -batch -l ert -l set-process-sentinel-test.el -f ert-run-tests-batch-and-exit The test will fail on emacs-27 but passes as expected in emacs-26 or the master branch. Initial analysis indicated this could be an emacs-27 regression caused by the move to pdumper, affecting any functionality that converts signal numbers to text description. Analysis to follow. --- set-process-sentinel is a built-in function in =E2=80=98src/process.c=E2=80= =99. (set-process-sentinel PROCESS SENTINEL) Give PROCESS the sentinel SENTINEL; nil for default. The sentinel is called as a function when the process changes state. It gets two arguments: the process, and a string describing the change. In GNU Emacs 27.1 (build 1, x86_64-w64-mingw32) of 2020-11-19 built on fv-az68-340 Repository revision: ec297125a76481c55390d0b329e541907879d6f3 Repository branch: master Windowing system distributor 'Microsoft Corp.', version 10.0 Configured using: 'configure --prefix=3D/mingw64 --build=3Dx86_64-w64-mingw32 --with-modules --without-dbus --without-compress-install 'CFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe' CPPFLAGS=3D-D__USE_MINGW_ANSI_STDIO=3D1 'LDFLAGS=3D-pipe -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high'' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2 HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER GMP Important settings: value of $LANG: ENG locale-coding-system: cp1252 --00000000000012a66f05ba766c2b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
T= here appears to be a bug in emacs-27 on windows-nt when a call is
made to a process' sentinel in respons= e to a kill- or
interrupt-process= call.

The second argument to the sentinel (the "string = describing the
change") is s= et to a "unknown signal" rather than to "interrupt\n" a= s
it was the case in the latest e= macs-26 or in emacs-28 branches:
=
| system-version | second ar= gument passed to the sentinel |
|= ----------------+----------------------------------------|
|=C2=A0 =C2=A0 =C2=A0 =C2=A0 26.3.50 | interrupte= d\n=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 |
|=C2=A0 = =C2=A0 =C2=A0 =C2=A0 27.1.91 | unknown signal\n=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|
<= font face=3D"monospace">|=C2=A0 =C2=A0 =C2=A0 =C2=A0 28.0.50 | interrupted\= n=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 |

The expectation=C2=A0is that, under = windows-nt, the process sentinel should
pass in an "interrupted\n" value to the change description=
argument when interrupt-process = has successfully=C2=A0interrupted a process.

An ert test is included to showcase the issue that only fails in<= br>
emacs-27 on windows-nt. The test sta= rts an idle emacs process, sets-process-sentinel,
calls=C2=A0in= terrupt-process on it, and then compares the sentinel's second
argument whether it is the de facto expec= ted "interrupted\n" text or
otherwise. The test fails on the latest emasc-27 since the argument th= at
emacs is passing in is "u= nknown signal".

<= /div>
To execute, save the test file and execu= te the following command:

emacs.exe -batch -l ert -l set-proc= ess-sentinel-test.el -f ert-run-tests-batch-and-exit
<= font face=3D"monospace">
The = test will fail on emacs-27 but passes as expected in emacs-26 or the master= branch.

Initial analysis indicated this could be an emacs-27= regression caused by the move to pdumper,=C2=A0
affecting any functionality that converts signal numbers to= text description. Analysis to follow.

---
<= font face=3D"monospace">
set-process-sentinel is a built-in function in= =E2=80=98src/process.c=E2=80=99.

(set-process-sen= tinel PROCESS SENTINEL)

Give PROCESS the sentinel = SENTINEL; nil for default.
The sentinel is called as a function w= hen the process changes state.
It gets two arguments: the process= , and a string describing the change.


In GNU Emacs 27.1 (build 1, x86_64-w64-mingw32)
=C2=A0of 2020-= 11-19 built on fv-az68-340
Repository revision: ec297125a76481c55= 390d0b329e541907879d6f3
Repository branch: master
Windo= wing system distributor 'Microsoft Corp.', version 10.0
<= div>
Configured using:
=C2=A0'configure --prefi= x=3D/mingw64 --build=3Dx86_64-w64-mingw32 --with-modules
=C2=A0--= without-dbus --without-compress-install 'CFLAGS=3D-march=3Dx86-64
=
=C2=A0-mtune=3Dgeneric -O2 -pipe' CPPFLAGS=3D-D__USE_MINGW_ANSI_ST= DIO=3D1
=C2=A0'LDFLAGS=3D-pipe
=C2=A0-Wl,--dynamicb= ase,--high-entropy-va,--nxcompat,--default-image-base-high''
<= div>
Configured features:
XPM JPEG TIFF GIF PNG RSV= G SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2
HARFBUZZ ZLIB TOOLKIT= _SCROLL_BARS MODULES THREADS JSON PDUMPER GMP

Impo= rtant settings:
=C2=A0 value of $LANG: ENG
=C2=A0 local= e-coding-system: cp1252

=
--00000000000012a66f05ba766c2b-- --00000000000012a67105ba766c2d Content-Type: application/octet-stream; name="set-process-sentinel-test.el" Content-Disposition: attachment; filename="set-process-sentinel-test.el" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kkq056t80 Ozs7IC0qLSBsZXhpY2FsLWJpbmRpbmc6IHQ7IC0qLQ0KKHJlcXVpcmUgJ2VydCkNCg0KKGVydC1k ZWZ0ZXN0IHByb2Nlc3Mtc2VudGluZWwtaW50ZXJydXB0LWV2ZW50ICgpDQogICJUZXN0IHRoYXQg aW50ZXJydXB0aW5nIGEgcHJvY2VzcyB1bmRlciB3aW5kb3dzIHNlbmRzIHRoZQ0KICBcImludGVy cnVwdFwiIGV2ZW50IHRvIHRoZ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