On Sat, 7 May 2022 05:13:23 +0900
Takashi Yano wrote:
> 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.

1') gcc --static rl_stc.c -lreadline -lncurses -o rl_stc.c
2) mintty --hold always ./rl_stc

also causes crash. In this case, no code from libreadline is
executed, I think. Why this triggers GetProcessWindowStation()
crash?

-- 
Takashi Yano <takashi.y...@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

Reply via email to