DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 47UBvmQL3845411 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=WkYuMnT5 X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 46B7F385DDD0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1725019066; bh=KZ0CgGMiwzh0dL4HRxtfZCBh6QmrT8giOkVoEd/s6Fg=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=WkYuMnT5N/qTkBym5jBJy+gLtU7XScOmXQZOdiRjGDu8R2wS8t+Ber3n/X5nLFff/ emhNNXaLaE974F4uv4TQXuqojf9d4xkfJxRH4zmXDDupnwGnZoszE/Lbit6ml3ufNS 68BSKAqRjf4lNO4lXVjvK8ofOZnc+iHIlS9jap/I= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 24AAD3858C50 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 24AAD3858C50 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725019010; cv=none; b=nXg9KIAQgL8+qaxp8EO0bmGcgoTlJYX8Bm5OgTs7IzmjYukvAW/WA2Eisf1aWaohzyAYFXnE7xwzofqHz9EIOrzFdiME8u1yJc2j2G058+fkxKPcwVmCGiBboOZXr7c4gf1p9iJibuY/IelMTCv0FHvjuDpgLE6mdAy6wC1fi8s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725019010; c=relaxed/simple; bh=ya0xuwCNLVmz1j8WA7BnFvKCs74mS2eARhhzyEpB7YM=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=iy4qYKVz7xOxulYf/p3JZuxsDx7k0IKJx7XQqhTwDf0XyI1Yq7tmkIaAJYIIgYIZcGu4P0XPDF01Alw8wslvw6VeqtjaEJGl1U7Qy2Nw+N5PdZsh8bZ0whru/dWr8fLc1Bav+43JtdSVS+WkMjp5WYrJ+bYsCZzjwTgkCgaXbjA= ARC-Authentication-Results: i=1; server2.sourceware.org X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725019006; x=1725623806; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=WWmALdZmd1+R9ozh182uzx56PDTASF6cYf3Xy+sOjgw=; b=pJKnsUJZhpm8n5tufwroeZ42l30fWjeHHm+Jhes6twqaxK6WuRe6sGD+pkOfpt8fwy 7ByPt3bepM5080862ObRUQcRvbtW/0qKtQa0voiy21Z9nlkUqCW2agkc/YdbBE12NGRF t58XMdHThOaMrYPLMNHhpICxqx8mEE1TKKENXozOjg8yT+DxOq0KQVhREAuG0oHGYj4I 0uvUWQMlqF2qBuPNHiy4BZF1jaAVhtftLZ6AAQEnUeXhYWL+7J9K+gbJ6ddWHX7cFuYW 9xVKrSLQp9lO8RVqVVSOIkZ41fuMJbHRgdVwzKA0W0OWQuguOfq+/uQNgpj8d1Dhcy3f ApTg== X-Gm-Message-State: AOJu0YwIlCY3BgAlPw+/Ne941S2clSPLovVJxUQRFtBnIQp/fUm4j+OT sr2uYRkONy2KHnrmo9SU3qMgoVr1sjTtwO0rtAbuYwvwn4Sbl1WDPo0stw7HMHqOkA93uZlubQe 0+7/viHeu7/Gw2WCtjBOsMDBBOZBB+D71 X-Google-Smtp-Source: AGHT+IGYe+fJsq8tZ2qXboALWtEx2XBSm8fR09puWIOZLZ7qAw4tHdyc7LpfWEhfC5p+Q6Ow582Tpwd7tYLLY831Ons= X-Received: by 2002:a05:6000:1085:b0:368:6596:edba with SMTP id ffacd0b85a97d-3749b57ae21mr4749543f8f.39.1725019006225; Fri, 30 Aug 2024 04:56:46 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 30 Aug 2024 19:56:34 +0800 Message-ID: Subject: cygwin application on MsTerminal, enabling win32-raw-mode results in runway memory/CPU usage. To: cygwin AT cygwin DOT com Content-Type: multipart/mixed; boundary="0000000000001967480620e54979" X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-Content-Filtered-By: Mailman/MimeDel 2.1.30 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Adamyg Mob via Cygwin Reply-To: Adamyg Mob Sender: "Cygwin" --0000000000001967480620e54979 Content-Type: text/plain; charset="UTF-8" Cygwin: CYGWIN_NT-10.0-19045 WEED3 3.5.4-1.x86_64 2024-08-25 16:52 UTC x86_64 Cygwin Windows Terminal version: 1.20.11781.0 Windows build number: 10.0.19045.4780 When running a cygwin64 based terminal application under a MsTerminal session, with win32-raw-mode "\033[?9001h" enabled, after brief input in the application becoming unresponsive and the session rapidly consumes all available memory/cpu.. Test application attached, plus ticket https://github.com/microsoft/terminal/issues/17824 contains additional information. Regards --0000000000001967480620e54979 Content-Type: text/plain; charset="US-ASCII"; name="rawkey.c" Content-Disposition: attachment; filename="rawkey.c" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_m0gnl69w0 LyoKICogIHdpbjMyLWlucHV0LW1vZGUga2V5IHRlc3QKICoKICogIEJ1aWxkOiBnY2MgLW8gcmF3 a2V5IHJhd2tleS5jCiAqICBVc2FnZTogcmF3a2V5IFstLW5vcmF3XSBbLS1tb3VzZV0KICovCgoj aW5jbHVkZSA8dGVybWlvcy5oPgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPHN0ZGxpYi5o PgojaW5jbHVkZSA8c3RyaW5nLmg+CiNpbmNsdWRlIDx1bmlzdGQuaD4KI2luY2x1ZGUgPGdldG9w dC5oPgojaW5jbHVkZSA8bGliZ2VuLmg+Cgp0eXBlZGVmIHN0cnVjdCBfTVNURVJNSU5BTF9JTlBV VF9SRUNPUkQgewogICAgICAgIHVuc2lnbmVkIGJLZXlEb3duOwogICAgICAgIHVuc2lnbmVkIHdS ZXBlYXRDb3VudDsKICAgICAgICB1bnNpZ25lZCB3VmlydHVhbEtleUNvZGU7CiAgICAgICAgdW5z aWduZWQgd1ZpcnR1YWxTY2FuQ29kZTsKICAgICAgICB1bmlvbiB7CiAgICAgICAgICAgICAgICB1 bnNpZ25lZCBVbmljb2RlQ2hhcjsKICAgICAgICAgICAgICAgIGNoYXIgQXNjaWlDaGFyOwogICAg ICAgIH0gdUNoYXI7CiAgICAgICAgdW5zaWduZWQgZHdDb250cm9sS2V5U3RhdGU7CiNkZWZpbmUg RU5IQU5DRURfS0VZIDB4MDEwMAojZGVmaW5lIExFRlRfQUxUX1BSRVNTRUQgMHgwMDAyCiNkZWZp bmUgTEVGVF9DVFJMX1BSRVNTRUQgMHgwMDA4CiNkZWZpbmUgUklHSFRfQUxUX1BSRVNTRUQgMHgw MDAxCiNkZWZpbmUgUklHSFRfQ1RSTF9QUkVTU0VEIDB4MDAwNAojZGVmaW5lIFNISUZUX1BSRVNT RUQgMHgwMDEwCn0gTVNURVJNSU5BTF9JTlBVVF9SRUNPUkQ7CgpzdGF0aWMgdm9pZCB1c2FnZSh2 b2lkKTsKc3RhdGljIHZvaWQgdGVzdChpbnQgd2luMzJfaW5wdXRfbW9kZSwgaW50IG1vdXNlX21v ZGUpOwpzdGF0aWMgdm9pZCBoZXgoY29uc3Qgdm9pZCAqYnVmLCB1bnNpZ25lZCBsZW4pOwpzdGF0 aWMgY29uc3QgY2hhciAqbXNrZXkoTVNURVJNSU5BTF9JTlBVVF9SRUNPUkQgKmtlLCBjb25zdCBj aGFyICpidWYsIGNvbnN0IGNoYXIgKmVuZCk7CgpzdGF0aWMgY29uc3QgY2hhciAqcHJvZ25hbWUg PSAiIjsKc3RhdGljIGNvbnN0IGNoYXIgKnNob3J0X29wdGlvbnMgPSAicm1oIjsKc3RhdGljIHN0 cnVjdCBvcHRpb24gbG9uZ19vcHRpb25zW10gPSB7CiAgICAgICAgeyJub3JhdyIsIG5vX2FyZ3Vt ZW50LCBOVUxMLCAncid9LAogICAgICAgIHsibW91c2UiLCBub19hcmd1bWVudCwgTlVMTCwgJ20n fSwKICAgICAgICB7ImhlbHAiLCBub19hcmd1bWVudCwgMCwgJ2gnfSwKICAgICAgICB7MH0KfTsK CgppbnQKbWFpbihpbnQgYXJnYywgY2hhciAqKmFyZ3YpCnsKICAgICAgICBpbnQgd2luMzJfaW5w dXRfbW9kZSA9IDEsIG1vdXNlX21vZGUgPSAwOwogICAgICAgIGludCBvcHRpZHggPSAwLCBjOwoK ICAgICAgICBwcm9nbmFtZSA9IGJhc2VuYW1lKGFyZ3ZbMF0pOwogICAgICAgIHdoaWxlICgoYyA9 IGdldG9wdF9sb25nKGFyZ2MsIGFyZ3YsIHNob3J0X29wdGlvbnMsIGxvbmdfb3B0aW9ucywgJm9w dGlkeCkpICE9IEVPRikgewogICAgICAgICAgICAgICAgc3dpdGNoIChjKSB7CiAgICAgICAgICAg ICAgICBjYXNlICdyJzogICAvLyAtciwtLW5vcmF3CiAgICAgICAgICAgICAgICAgICAgICAgIHdp bjMyX2lucHV0X21vZGUgPSAwOwogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAg ICAgICAgICAgIGNhc2UgJ20nOiAgIC8vIC1tLC0tbW91c2UKICAgICAgICAgICAgICAgICAgICAg ICAgbW91c2VfbW9kZSA9IDE7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAg ICAgICAgICAgY2FzZSAnaCc6ICAgLy8gLWgsLS1oZWxwCiAgICAgICAgICAgICAgICAgICAgICAg IHVzYWdlKCk7CiAgICAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgICAgICAg ICByZXR1cm4gRVhJVF9GQUlMVVJFOwogICAgICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAg ICBhcmd2ICs9IG9wdGluZDsKICAgICAgICBpZiAoKGFyZ2MgLT0gb3B0aW5kKSAhPSAwKSB7CiAg ICAgICAgICAgICAgICBwcmludGYoIiVzOiB1bmV4cGVjdGVkIGFyZ3VtZW50KHMpICVzXG4iLCBw cm9nbmFtZSwgYXJndlswXSk7CiAgICAgICAgICAgICAgICB1c2FnZSgpOwogICAgICAgIH0KICAg ICAgICB0ZXN0KHdpbjMyX2lucHV0X21vZGUsIG1vdXNlX21vZGUpOwogICAgICAgIHJldHVybiAw Owp9CgoKc3RhdGljIHZvaWQKdXNhZ2Uodm9pZCkKewogICAgICAgIHByaW50ZigiXG5Vc2FnZSAl czogcmF3a2V5IFstLW5vcmF3XSBbLS1tb3VzZV1cbiIsIHByb2duYW1lKTsKICAgICAgICBleGl0 KEVYSVRfRkFJTFVSRSk7Cn0KCgpzdGF0aWMgdm9pZApwcmludHMoY29uc3QgY2hhciAqc3RyKQp7 CiAgICAgICAgZnB1dHMoc3RyLCBzdGRvdXQpOwp9CgoKc3RhdGljIHZvaWQKdGVzdChpbnQgd2lu MzJfaW5wdXRfbW9kZSwgaW50IG1vdXNlX21vZGUpCnsKICAgICAgICBzdHJ1Y3QgdGVybWlvcyBi YWssIGNmZzsKICAgICAgICBNU1RFUk1JTkFMX0lOUFVUX1JFQ09SRCBrZXk7CiAgICAgICAgY2hh ciBidWZbMTI4XTsKICAgICAgICBpbnQgY250LCBxOwoKICAgICAgICB0Y2dldGF0dHIoU1RESU5f RklMRU5PLCAmY2ZnKTsKICAgICAgICBiYWsgPSBjZmc7CiAgICAgICAgY2ZtYWtlcmF3KCZjZmcp OwogICAgICAgIGNmZy5jX2xmbGFnICY9IH5FQ0hPOwogICAgICAgIHRjc2V0YXR0cihTVERJTl9G SUxFTk8sIFRDU0FEUkFJTiwgJmNmZyk7CgogICAgICAgIGlmICh3aW4zMl9pbnB1dF9tb2RlKSB7 ICAgICAgICAgICAgICAgICAvLyBlbmFibGUgd2luMzItaW5wdXQtbW9kZS4KICAgICAgICAgICAg ICAgIHByaW50cygiXDAzM1s/OTAwMWgiKTsKICAgICAgICB9CiAgICAgICAgaWYgKG1vdXNlX21v ZGUpIHsKICAgICAgICAgICAgICAgIHByaW50cygiXHgxYls/MTAwMmgiKTsgICAgICAgICAgLy8g ZW5hYmxlIGNlbGwtbW90aW9uIHRyYWNraW5nLgogICAgICAgICAgICAgICAgcHJpbnRzKCJceDFi Wz8xMDA2aCIpOyAgICAgICAgICAvLyBlbmFibGUgU0dSIGV4dGVuZGVkIG1vdXNlIG1vZGUuCiAg ICAgICAgfQogICAgICAgIHByaW50ZigiXG5ccnJhdy1tb2RlIChwcmVzcyAncScgdHdpY2UgdG8g ZXhpdCwgcmF3PSVkLCBtb3VzZT0lZCk6XG5cciIsIHdpbjMyX2lucHV0X21vZGUsIG1vdXNlX21v ZGUpOwogICAgICAgIGZmbHVzaChzdGRvdXQpOwoKICAgICAgICBmb3IgKHEgPSAwOyAoY250ID0g cmVhZChTVERJTl9GSUxFTk8sIGJ1Ziwgc2l6ZW9mKGJ1ZikpKSA+IDA7KSB7CiAgICAgICAgICAg ICAgICBoZXgoYnVmLCBjbnQpOwoKCQlpZiAobXNrZXkoJmtleSwgYnVmLCBidWYgKyBjbnQpKSB7 CiAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiICAgS2V5OiAlcy0lcyVzJXMlcyVzJXNW Sz0weCUwMngvJXUsIFVDPTB4JTA0eC8ldS8lYywgU0M9MHgleC8ldVxuXHIiLAogICAgICAgICAg ICAgICAgICAgICAgICAgICAgKGtleS5iS2V5RG93biA/ICJETiIgOiAiVVAiKSwKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKGtleS5kd0NvbnRyb2xLZXlTdGF0ZSAmIEVOSEFOQ0VE X0tFWSkgPyAiRW5oLSIgOiAiIiksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IChrZXkuZHdDb250cm9sS2V5U3RhdGUgJiBMRUZUX0FMVF9QUkVTU0VEKSA/ICJMQWx0LSIgOiAi IiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGtleS5kd0NvbnRyb2xLZXlT dGF0ZSAmIFJJR0hUX0FMVF9QUkVTU0VEKSA/ICJSQWx0LSIgOiAiIiwKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKGtleS5kd0NvbnRyb2xLZXlTdGF0ZSAmIExFRlRfQ1RSTF9Q UkVTU0VEKSA/ICJMQ3RybC0iIDogIiIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChrZXkuZHdDb250cm9sS2V5U3RhdGUgJiBSSUdIVF9DVFJMX1BSRVNTRUQpID8gIlJDdHJs LSIgOiAiIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGtleS5kd0NvbnRy b2xLZXlTdGF0ZSAmIFNISUZUX1BSRVNTRUQpID8gIlNoaWZ0LSIgOiAiIiwKICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGtleS53VmlydHVhbEtleUNvZGUsIGtleS53VmlydHVhbEtleUNvZGUs CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5LnVDaGFyLlVuaWNvZGVDaGFyLCBr ZXkudUNoYXIuVW5pY29kZUNoYXIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IChrZXkudUNoYXIuVW5pY29kZUNoYXIgJiYga2V5LnVDaGFyLlVuaWNvZGVDaGFyIDwgMjU1ID8g a2V5LnVDaGFyLlVuaWNvZGVDaGFyIDogJyAnKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAg IGtleS53VmlydHVhbFNjYW5Db2RlLCBrZXkud1ZpcnR1YWxTY2FuQ29kZSk7CiAgICAgICAgICAg ICAgICAgICAgICAgIGlmIChrZXkuYktleURvd24pIHsKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBpZiAoa2V5LnVDaGFyLlVuaWNvZGVDaGFyID09ICdxJykgewogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCsrcSA9PSAyKSB7CiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxID0gMDsK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAg IH0KCQl9IGVsc2UJewkJCS8vIGFzY2lpCiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChidWZb MF0gPT0gJ3EnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCsrcSA9PSAy KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxz ZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcSA9IDA7CiAgICAgICAgICAgICAg ICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBmZmx1c2goc3Rk b3V0KTsKICAgICAgICB9CgogICAgICAgIGlmIChtb3VzZV9tb2RlKSB7CiAgICAgICAgICAgICAg ICBwcmludHMoIlx4MWJbPzEwMDZsIik7ICAgICAgICAgIC8vIGRpc2FibGUgU0dSIGV4dGVuZGVk IG1vdXNlIG1vZGUuCiAgICAgICAgICAgICAgICBwcmludHMoIlx4MWJbPzEwMDJsIik7ICAgICAg ICAgIC8vIGRpc2FibGUgY2VsbC1tb3Rpb24gdHJhY2tpbmcuCiAgICAgICAgfQogICAgICAgIGlm ICh3aW4zMl9pbnB1dF9tb2RlKQogICAgICAgICAgICAgICAgcHJpbnRzKCJcMDMzWz85MDAxbCIp OyAgICAgICAgICAvLyBkaXNhYmxlIHdpbjMyLWlucHV0LW1vZGUuCiAgICAgICAgZmZsdXNoKHN0 ZG91dCk7CgogICAgICAgIHRjc2V0YXR0cihTVERJTl9GSUxFTk8sIFRDU0FEUkFJTiwgJmJhayk7 Cn0KCnN0YXRpYyB2b2lkCmhleChjb25zdCB2b2lkICpidWYsIHVuc2lnbmVkIGxlbikKewojZGVm aW5lIEhFWFdJRFRIIDMyCiNkZWZpbmUgSEVYQ09MVU1OIDQKICAgICAgICBjb25zdCB1bnNpZ25l ZCBjaGFyICpjdXJzb3IgPSBidWYsICplbmQgPSBjdXJzb3IgKyBsZW47CiAgICAgICAgdW5zaWdu ZWQgb2Zmc2V0ID0gMDsKCiAgICAgICAgZm9yIChvZmZzZXQgPSAwOyBjdXJzb3IgPCBlbmQ7IG9m ZnNldCArPSBIRVhXSURUSCkgewogICAgICAgICAgICAgICAgY29uc3QgdW5zaWduZWQgY2hhciAq ZGF0YSA9IGN1cnNvcjsKCiAgICAgICAgICAgICAgICBwcmludGYoIiUwNHg6ICIsIG9mZnNldCk7 CiAgICAgICAgICAgICAgICBmb3IgKHVuc2lnbmVkIGNvbCA9IDA7IGNvbCA8IEhFWFdJRFRIOyAr K2NvbCkgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGNvbCAlIEhFWENPTFVNTikgPT0g MCAmJiBjb2wpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRzKCIgfCIpOwog ICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YSA9PSBlbmQpIHsKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBwcmludHMoIiAgICIpOwogICAgICAgICAgICAgICAgICAgICAgICB9 IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiICUwMngiLCAq ZGF0YSsrKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAg ICAgICAgICAgICAgcHJpbnRzKCIgICAiKTsKICAgICAgICAgICAgICAgIGZvciAodW5zaWduZWQg Y29sID0gMDsgY29sIDwgSEVYV0lEVEggJiYgY3Vyc29yIDwgZW5kOyArK2NvbCkgewogICAgICAg ICAgICAgICAgICAgICAgICBjb25zdCB1bnNpZ25lZCBjaGFyIGMgPSAqY3Vyc29yKys7CiAgICAg ICAgICAgICAgICAgICAgICAgIHByaW50ZigiJWMiLCAoYyA+PSAnICcgJiYgYyA8IDB4N2YgPyBj IDogJy4nKSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBwcmludHMoIlxuXHIi KTsKICAgICAgICB9CiAgICAgICAgZmZsdXNoKHN0ZG91dCk7Cn0KCgovLwovLyAgRGVjb2RlIGEg TVNUZXJtaW5hbCBzcGVjaWZpYyBrZXkgZXNjYXBlIHNlcXVlbmNlLgovLwoKZW51bSB7CiAgICAg ICAgbXNWaXJ0dWFsS2V5Q29kZSwKICAgICAgICBtc1ZpcnR1YWxTY2FuQ29kZSwKICAgICAgICBt c1VuaWNvZGVDaGFyLAogICAgICAgIG1zS2V5RG93biwKICAgICAgICBtc0NvbnRyb2xLZXlTdGF0 ZSwKICAgICAgICBtc1JlcGVhdENvdW50LAogICAgICAgIG1zZ0FyZ3VtZW50TWF4Cn07CgoKc3Rh dGljIGNvbnN0IGNoYXIgKgpEZWNvZGVNU1Rlcm1pbmFsQXJncyh1bnNpZ25lZCBhcmd1bWVudHNb bXNnQXJndW1lbnRNYXhdLCBjb25zdCBjaGFyICpidWZmZXIsIGNvbnN0IGNoYXIgKmVuZCkKewog ICAgICAgIGNvbnN0IGNoYXIgKmN1cnNvciA9IGJ1ZmZlciArIDI7CiAgICAgICAgdW5zaWduZWQg YXJncyA9IDAsIGRpZ2l0cyA9IDA7CgogICAgICAgIHdoaWxlIChjdXJzb3IgPCBlbmQgJiYgKmN1 cnNvcikgewogICAgICAgICAgICAgICAgY29uc3QgdW5zaWduZWQgY2hhciBjID0gKmN1cnNvcisr OwoKICAgICAgICAgICAgICAgIGlmIChjID49ICcwJyAmJiBjIDw9ICc5JykgewogICAgICAgICAg ICAgICAgICAgICAgICBpZiAoMCA9PSBkaWdpdHMrKykgewogICAgICAgICAgICAgICAgICAgICAg ICAgICAgaWYgKGFyZ3MgPj0gbXNnQXJndW1lbnRNYXgpIHsKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBicmVhazsgICAgICAgICAgLy8gb3ZlcmZsb3cKICAgICAgICAgICAgICAgICAg ICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3VtZW50c1thcmdzXSA9 IChjIC0gJzAnKTsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGFyZ3VtZW50c1thcmdzXSA9IChhcmd1bWVudHNbYXJnc10gKiAxMCkg KyAoYyAtICcwJyk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0g ZWxzZSBpZiAoYyA9PSAnOycgfHwgYyA9PSAnXycpIHsKICAgICAgICAgICAgICAgICAgICAgICAg ZGlnaXRzID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgKythcmdzOwogICAgICAgICAgICAg ICAgICAgICAgICBpZiAoYyA9PSAnXycpIHsgICAgICAgICAvLyB0ZXJtaW5hdG9yCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChhcmdzID49IDEgPyBjdXJzb3IgOiBOVUxM KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAg ICAgICAgICAgICAgICAgICAgICAgIGFyZ3MgPSAwOyAgICAgICAgICAgICAgIC8vIG5vbi1kaWdp dAogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIH0KICAgICAg ICB9CiAgICAgICAgcmV0dXJuIE5VTEw7Cn0KCgpzdGF0aWMgY29uc3QgY2hhciAqCm1za2V5KE1T VEVSTUlOQUxfSU5QVVRfUkVDT1JEICprZSwgY29uc3QgY2hhciAqYnVmLCBjb25zdCBjaGFyICpl bmQpCnsKICAgICAgICBpZiAoKGJ1ZiArIDYpIDwgZW5kICYmIGJ1ZlswXSA9PSAnXDAzMycgJiYg YnVmWzFdID09ICdbJyAmJiBidWZbMl0pIHsKICAgICAgICAgICAgICAgIC8qCiAgICAgICAgICAg ICAgICAgKiAgVGVybWluYWwgd2luMzItaW5wdXQtbW9kZQogICAgICAgICAgICAgICAgICoKICAg ICAgICAgICAgICAgICAqICAgICAgPEVTQz5bMTc7Mjk7MDsxOzg7MV8KICAgICAgICAgICAgICAg ICAqCiAgICAgICAgICAgICAgICAgKiAgRm9ybWF0OgogICAgICAgICAgICAgICAgICoKICAgICAg ICAgICAgICAgICAqICAgICAgPEVTQz5bVms7U2M7VWM7S2Q7Q3M7UmNfCiAgICAgICAgICAgICAg ICAgKgogICAgICAgICAgICAgICAgICogICAgICBWazogdGhlIHZhbHVlIG9mIHdWaXJ0dWFsS2V5 Q29kZSAtIGFueSBudW1iZXIuIElmIG9taXR0ZWQsIGRlZmF1bHRzIHRvICcwJy4KICAgICAgICAg ICAgICAgICAqICAgICAgU2M6IHRoZSB2YWx1ZSBvZiB3VmlydHVhbFNjYW5Db2RlIC0gYW55IG51 bWJlci4gSWYgb21pdHRlZCwgZGVmYXVsdHMgdG8gJzAnLgogICAgICAgICAgICAgICAgICogICAg ICBVYzogdGhlIGRlY2ltYWwgdmFsdWUgb2YgVW5pY29kZUNoYXIgLSBmb3IgZXhhbXBsZSwgTlVM IGlzICIwIiwgTEYgaXMKICAgICAgICAgICAgICAgICAqICAgICAgICAgICAiMTAiLCB0aGUgY2hh cmFjdGVyICdBJyBpcyAiNjUiLiBJZiBvbWl0dGVkLCBkZWZhdWx0cyB0byAnMCcuCiAgICAgICAg ICAgICAgICAgKiAgICAgIEtkOiB0aGUgdmFsdWUgb2YgYktleURvd24gLSBlaXRoZXIgYSAnMCcg b3IgJzEnLiBJZiBvbWl0dGVkLCBkZWZhdWx0cyB0byAnMCcuCiAgICAgICAgICAgICAgICAgKiAg ICAgIENzOiB0aGUgdmFsdWUgb2YgZHdDb250cm9sS2V5U3RhdGUgLSBhbnkgbnVtYmVyLiBJZiBv bWl0dGVkLCBkZWZhdWx0cyB0byAnMCcuCiAgICAgICAgICAgICAgICAgKiAgICAgIFJjOiB0aGUg dmFsdWUgb2Ygd1JlcGVhdENvdW50IC0gYW55IG51bWJlci4gSWYgb21pdHRlZCwgZGVmYXVsdHMg dG8gJzEnLgogICAgICAgICAgICAgICAgICoKICAgICAgICAgICAgICAgICAqICBSZWZlcmVuY2UK ICAgICAgICAgICAgICAgICAqICAgICAgaHR0cHM6Ly9naXRodWIuY29tL21pY3Jvc29mdC90ZXJt aW5hbC9ibG9iL21haW4vZG9jL3NwZWNzLyUyMzQ5OTklMjAtJTIwSW1wcm92ZWQlMjBrZXlib2Fy ZCUyMGhhbmRsaW5nJTIwaW4lMjBDb25wdHkubWQKICAgICAgICAgICAgICAgICAqLwogICAgICAg ICAgICAgICAgdW5zaWduZWQgYXJnc1ttc2dBcmd1bWVudE1heF0gPSB7IDAsIDAsIDAsIDAsIDAs IDEgfTsKICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKmN1cnNvcjsKCiAgICAgICAgICAgICAg ICBpZiAoTlVMTCAhPSAoY3Vyc29yID0gRGVjb2RlTVNUZXJtaW5hbEFyZ3MoYXJncywgYnVmLCBl bmQpKSkgewogICAgICAgICAgICAgICAgICAgICAgICBtZW1zZXQoa2UsIDAsIHNpemVvZigqa2Up KTsKICAgICAgICAgICAgICAgICAgICAgICAga2UtPmJLZXlEb3duID0gYXJnc1ttc0tleURvd25d ID8gMVUgOiAtMFU7CiAgICAgICAgICAgICAgICAgICAgICAgIGtlLT53UmVwZWF0Q291bnQgPSBh cmdzW21zUmVwZWF0Q291bnRdOwogICAgICAgICAgICAgICAgICAgICAgICBrZS0+d1ZpcnR1YWxL ZXlDb2RlID0gYXJnc1ttc1ZpcnR1YWxLZXlDb2RlXTsKICAgICAgICAgICAgICAgICAgICAgICAg a2UtPndWaXJ0dWFsU2NhbkNvZGUgPSBhcmdzW21zVmlydHVhbFNjYW5Db2RlXTsKICAgICAgICAg ICAgICAgICAgICAgICAga2UtPnVDaGFyLlVuaWNvZGVDaGFyID0gYXJnc1ttc1VuaWNvZGVDaGFy XTsKICAgICAgICAgICAgICAgICAgICAgICAga2UtPmR3Q29udHJvbEtleVN0YXRlID0gYXJnc1tt c0NvbnRyb2xLZXlTdGF0ZV07CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjdXJzb3I7 CiAgICAgICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJldHVybiBOVUxMOwp9CgovL2Vu ZAoKCgoKCgoK --0000000000001967480620e54979 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple --0000000000001967480620e54979--