X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 458763858413
Authentication-Results: sourceware.org;
 dmarc=fail (p=none dis=none) header.from=nifty.ne.jp
Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 246KDHuK019358
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp;
 s=dec2015msa; t=1651867998;
 bh=j+f/B1vx1noScq8ptLVL76E1b757Hp3ofnUe/krJ+t8=;
 h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
 b=MmrStHCr0og0UR6bBEfPyIeW+tCLLDcQQrgBICh5H0zJmLR4VQr9e5JS/+fsTB2+R
 hRE1vE22PKHYWNoTDSkYb+3ADuEV/ypNwtYvjlW75U/ucKR3IHPNRZSwirkkJ1hhej
 kJb3A2NULp75cMssHZzYS4+e52ia721weBBTNs5jUrOn1RFMAs0oiIgoxhx6Fqfoe2
 bUz7UMrY7rmJ9CAkHtlvwATVZumEBjDFVLxlmms1D8TZdDrWrBNDwDIDu7HMNnpVNA
 xOm37/sJtDAeNIgfhR1Qc3MjTyps2q/o/RZ6LIDCcKQUmokEEBqe6s7qH3WvAAYBzV
 SKMf6bwAtOi1A==
X-Nifty-SrcIP: [119.150.44.95]
Date: Sat, 7 May 2022 05:13:23 +0900
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin@cygwin.com
Subject: Re: mintty crashes on Windows 7
Message-Id: <20220507051323.a6f1116ded86123e8c14993d@nifty.ne.jp>
In-Reply-To: <nycvar.QRO.7.76.6.2205062109380.346@tvgsbejvaqbjf.bet>
References: <CAGHpTB+t+gCySabZZQvJstZSLresmoOTUUL8of9cwCdvmGySdg@mail.gmail.com>
 <CAGHpTB+3V98eWDaHv7DCa133KWS39FaDFMUo=8qOJjxTFon51A@mail.gmail.com>
 <20220504011018.7c455cedb38571f786d72ae9@nifty.ne.jp>
 <CAGHpTBJyOgYAzEvs3NLb8AzkiujbCKjaf+w-QSJAou47g-J-Cg@mail.gmail.com>
 <CAGHpTB+tZX+z0ZkCNG-42bp4Pw+YKUXkccnnNqwN_tHRekk=UA@mail.gmail.com>
 <20220504201610.125888f234ffe063fa6773c0@nifty.ne.jp>
 <CAGHpTBKphe_jSRS+9ihygODYGYYyzPfLPkt9H4rTDm9u7pMexw@mail.gmail.com>
 <20220505102045.fd6bfd46732e2eab0451e28c@nifty.ne.jp>
 <20220505102724.11b5675450f2b4f723a8b70e@nifty.ne.jp>
 <20220505105954.e910df2e6998d130a9373299@nifty.ne.jp>
 <20220505123307.e745d7c88877316b9a38d0c9@nifty.ne.jp>
 <20220505134120.242af45a631131d7e4217f5e@nifty.ne.jp>
 <20220505154440.d9002cc94e7d52b3c6c1f339@nifty.ne.jp>
 <20220506074851.3ce94db7a3ab2bedf7e07f93@nifty.ne.jp>
 <CAGHpTBJRbqTf_2rmXD8413940+At+KS6_2C_702xR0t-L7aVSg@mail.gmail.com>
 <nycvar.QRO.7.76.6.2205062109380.346@tvgsbejvaqbjf.bet>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, NICE_REPLY_A,
 RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP,
 T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
        Orgad Shaneh <orgads@gmail.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

On Fri, 6 May 2022 21:16:10 +0200 (CEST)
Johannes Schindelin wrote:
> Takashi, for the record, I find it hard to believe that the bug is
> libreadline's because Orgad's scenario works if he reverts that patch in
> the _MSYS2 runtime_, _and_ it is rather dubious that libreadline would
> potentially do anything that makes a call to `GetProcessWindowStation()`
> not fail but _crash_.

I found the following test case also crashes with that commit.

1) Compile rl_stc.c with gcc rl_stc.c -lreadline -o rl_stc.c
2) mintty --hold always ./rl_stc

/* rl_stc.c */
#include <stdio.h>
#include <stdlib.h>
#include <readline/readline.h>

int main(int argc, char *argv[])
{
    char *str;
    if (argc > 1) {
        str = readline(">> ");
        printf("%s\n", str);
        free(str);
    }
    return 0;
}

In this test case, no args is specified, so readline() is
not called. However, this crashes indeed. This means just
loading msys-readline8.dll causes the crash.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

-- 
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
