Bogus exit code 127 from a child process

2024-03-17 Thread Alexey Izbyshev via Cygwin

Hello,

I've been getting occasional "Error 127" from make -jN on seemingly 
random jobs. After reducing the set of jobs and eventually eliminating 
make, I've arrived to this one-liner:


bash -c 'true & true & wait -n || echo 1: $? && wait -n || echo 2: $?'

When run repeatedly, the second "wait -n" often reports 127.

I've reproduced this in the following environments:

* Cygwin 3.5.1, Windows 10 22H2 x64
* Cygwin 3.4.6, Windows 10 22H2 x64 and Windows 7 x64

I couldn't reproduce it in Cygwin 3.3.6 (WOW64) on Windows 7 x64.

Thanks,
Alexey


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


Re: Bogus exit code 127 from a child process

2024-03-17 Thread Takashi Yano via Cygwin
On Sun, 17 Mar 2024 11:14:16 +0300
Alexey Izbyshev wrote:
> Hello,
> 
> I've been getting occasional "Error 127" from make -jN on seemingly 
> random jobs. After reducing the set of jobs and eventually eliminating 
> make, I've arrived to this one-liner:
> 
> bash -c 'true & true & wait -n || echo 1: $? && wait -n || echo 2: $?'
> 
> When run repeatedly, the second "wait -n" often reports 127.
> 
> I've reproduced this in the following environments:
> 
> * Cygwin 3.5.1, Windows 10 22H2 x64
> * Cygwin 3.4.6, Windows 10 22H2 x64 and Windows 7 x64
> 
> I couldn't reproduce it in Cygwin 3.3.6 (WOW64) on Windows 7 x64.

Could you please try latest cygwin 3.6.0 (TEST) ?

-- 
Takashi Yano 

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


Re: Bogus exit code 127 from a child process

2024-03-17 Thread Alexey Izbyshev via Cygwin

On 2024-03-17 11:44, Takashi Yano wrote:

On Sun, 17 Mar 2024 11:14:16 +0300
Alexey Izbyshev wrote:

Hello,

I've been getting occasional "Error 127" from make -jN on seemingly
random jobs. After reducing the set of jobs and eventually eliminating
make, I've arrived to this one-liner:

bash -c 'true & true & wait -n || echo 1: $? && wait -n || echo 2: $?'

When run repeatedly, the second "wait -n" often reports 127.

I've reproduced this in the following environments:

* Cygwin 3.5.1, Windows 10 22H2 x64
* Cygwin 3.4.6, Windows 10 22H2 x64 and Windows 7 x64

I couldn't reproduce it in Cygwin 3.3.6 (WOW64) on Windows 7 x64.


Could you please try latest cygwin 3.6.0 (TEST) ?


Tested with 3.6.0-0.82.gfc691d0246b9 on Windows 10 22H2 x64, the problem 
still occurs.


Thanks,
Alexey

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


Re: Bogus exit code 127 from a child process

2024-03-17 Thread Takashi Yano via Cygwin
On Sun, 17 Mar 2024 12:01:55 +0300
Alexey Izbyshev wrote:
> On 2024-03-17 11:44, Takashi Yano wrote:
> > On Sun, 17 Mar 2024 11:14:16 +0300
> > Alexey Izbyshev wrote:
> >> Hello,
> >> 
> >> I've been getting occasional "Error 127" from make -jN on seemingly
> >> random jobs. After reducing the set of jobs and eventually eliminating
> >> make, I've arrived to this one-liner:
> >> 
> >> bash -c 'true & true & wait -n || echo 1: $? && wait -n || echo 2: $?'
> >> 
> >> When run repeatedly, the second "wait -n" often reports 127.
> >> 
> >> I've reproduced this in the following environments:
> >> 
> >> * Cygwin 3.5.1, Windows 10 22H2 x64
> >> * Cygwin 3.4.6, Windows 10 22H2 x64 and Windows 7 x64
> >> 
> >> I couldn't reproduce it in Cygwin 3.3.6 (WOW64) on Windows 7 x64.
> > 
> > Could you please try latest cygwin 3.6.0 (TEST) ?
> 
> Tested with 3.6.0-0.82.gfc691d0246b9 on Windows 10 22H2 x64, the problem 
> still occurs.

In my evrironmen, trial for 1 hour does not reproduce the issue.
Could you please let us know your environment, i.e. CPU, amount of 
memory, and so on?

-- 
Takashi Yano 

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


Re: Bogus exit code 127 from a child process

2024-03-17 Thread Alexey Izbyshev via Cygwin

On 2024-03-17 12:27, Takashi Yano wrote:

On Sun, 17 Mar 2024 12:01:55 +0300
Alexey Izbyshev wrote:

On 2024-03-17 11:44, Takashi Yano wrote:
> On Sun, 17 Mar 2024 11:14:16 +0300
> Alexey Izbyshev wrote:
>> Hello,
>>
>> I've been getting occasional "Error 127" from make -jN on seemingly
>> random jobs. After reducing the set of jobs and eventually eliminating
>> make, I've arrived to this one-liner:
>>
>> bash -c 'true & true & wait -n || echo 1: $? && wait -n || echo 2: $?'
>>
>> When run repeatedly, the second "wait -n" often reports 127.
>>
>> I've reproduced this in the following environments:
>>
>> * Cygwin 3.5.1, Windows 10 22H2 x64
>> * Cygwin 3.4.6, Windows 10 22H2 x64 and Windows 7 x64
>>
>> I couldn't reproduce it in Cygwin 3.3.6 (WOW64) on Windows 7 x64.
>
> Could you please try latest cygwin 3.6.0 (TEST) ?

Tested with 3.6.0-0.82.gfc691d0246b9 on Windows 10 22H2 x64, the 
problem

still occurs.


In my evrironmen, trial for 1 hour does not reproduce the issue.
Could you please let us know your environment, i.e. CPU, amount of
memory, and so on?


It's been reproduced in a variety of environments:

* Windows 10 22H2 x64, Intel Core i7 11700, 32 GB RAM
* Windows 10 22H2 x64, Intel Core i7 9700, 32 GB RAM
* Windows 10 22H2 x64, Intel Core i7 6700, 32 GB RAM
* Windows 7 SP1 x64, Intel Core i7 6700, 32 GB RAM

I'm surprised that you're not hitting it very quickly. The following 
loop usually fails after a few iterations (rarely a hundred or so) in my 
tests:


while bash -c 'true & true & wait -n || { echo 1: $?; exit 1; } && wait 
-n || { echo 2: $?; exit 1; }'; do echo $((i++)); done


Thanks,
Alexey

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


Re: Bogus exit code 127 from a child process

2024-03-17 Thread Takashi Yano via Cygwin
On Sun, 17 Mar 2024 13:03:40 +0300
Alexey Izbyshev wrote:
> On 2024-03-17 12:27, Takashi Yano wrote:
> > On Sun, 17 Mar 2024 12:01:55 +0300
> > Alexey Izbyshev wrote:
> >> On 2024-03-17 11:44, Takashi Yano wrote:
> >> > On Sun, 17 Mar 2024 11:14:16 +0300
> >> > Alexey Izbyshev wrote:
> >> >> Hello,
> >> >>
> >> >> I've been getting occasional "Error 127" from make -jN on seemingly
> >> >> random jobs. After reducing the set of jobs and eventually eliminating
> >> >> make, I've arrived to this one-liner:
> >> >>
> >> >> bash -c 'true & true & wait -n || echo 1: $? && wait -n || echo 2: $?'
> >> >>
> >> >> When run repeatedly, the second "wait -n" often reports 127.
> >> >>
> >> >> I've reproduced this in the following environments:
> >> >>
> >> >> * Cygwin 3.5.1, Windows 10 22H2 x64
> >> >> * Cygwin 3.4.6, Windows 10 22H2 x64 and Windows 7 x64
> >> >>
> >> >> I couldn't reproduce it in Cygwin 3.3.6 (WOW64) on Windows 7 x64.
> >> >
> >> > Could you please try latest cygwin 3.6.0 (TEST) ?
> >> 
> >> Tested with 3.6.0-0.82.gfc691d0246b9 on Windows 10 22H2 x64, the 
> >> problem
> >> still occurs.
> > 
> > In my evrironmen, trial for 1 hour does not reproduce the issue.
> > Could you please let us know your environment, i.e. CPU, amount of
> > memory, and so on?
> 
> It's been reproduced in a variety of environments:
> 
> * Windows 10 22H2 x64, Intel Core i7 11700, 32 GB RAM
> * Windows 10 22H2 x64, Intel Core i7 9700, 32 GB RAM
> * Windows 10 22H2 x64, Intel Core i7 6700, 32 GB RAM
> * Windows 7 SP1 x64, Intel Core i7 6700, 32 GB RAM
> 
> I'm surprised that you're not hitting it very quickly. The following 
> loop usually fails after a few iterations (rarely a hundred or so) in my 
> tests:
> 
> while bash -c 'true & true & wait -n || { echo 1: $?; exit 1; } && wait 
> -n || { echo 2: $?; exit 1; }'; do echo $((i++)); done

Thanks. My main PC still runs the above test for more than 15000 counts.
So, I tried another PC which CPU is Core i5 540M and could reproduce
the issue about 1 time per a few hundreds count.

I also tried to run sleep 0.1 instead of true, then, the issue happens
1 time per a few decades counts.

I'll look into this problem. Thanks for the report.

-- 
Takashi Yano 

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


Re: Bogus exit code 127 from a child process

2024-03-17 Thread Takashi Yano via Cygwin
On Sun, 17 Mar 2024 19:21:16 +0900
Takashi Yano wrote:
> On Sun, 17 Mar 2024 13:03:40 +0300
> Alexey Izbyshev wrote:
> > On 2024-03-17 12:27, Takashi Yano wrote:
> > > On Sun, 17 Mar 2024 12:01:55 +0300
> > > Alexey Izbyshev wrote:
> > >> On 2024-03-17 11:44, Takashi Yano wrote:
> > >> > On Sun, 17 Mar 2024 11:14:16 +0300
> > >> > Alexey Izbyshev wrote:
> > >> >> Hello,
> > >> >>
> > >> >> I've been getting occasional "Error 127" from make -jN on seemingly
> > >> >> random jobs. After reducing the set of jobs and eventually eliminating
> > >> >> make, I've arrived to this one-liner:
> > >> >>
> > >> >> bash -c 'true & true & wait -n || echo 1: $? && wait -n || echo 2: $?'
> > >> >>
> > >> >> When run repeatedly, the second "wait -n" often reports 127.
> > >> >>
> > >> >> I've reproduced this in the following environments:
> > >> >>
> > >> >> * Cygwin 3.5.1, Windows 10 22H2 x64
> > >> >> * Cygwin 3.4.6, Windows 10 22H2 x64 and Windows 7 x64
> > >> >>
> > >> >> I couldn't reproduce it in Cygwin 3.3.6 (WOW64) on Windows 7 x64.
> > >> >
> > >> > Could you please try latest cygwin 3.6.0 (TEST) ?
> > >> 
> > >> Tested with 3.6.0-0.82.gfc691d0246b9 on Windows 10 22H2 x64, the 
> > >> problem
> > >> still occurs.
> > > 
> > > In my evrironmen, trial for 1 hour does not reproduce the issue.
> > > Could you please let us know your environment, i.e. CPU, amount of
> > > memory, and so on?
> > 
> > It's been reproduced in a variety of environments:
> > 
> > * Windows 10 22H2 x64, Intel Core i7 11700, 32 GB RAM
> > * Windows 10 22H2 x64, Intel Core i7 9700, 32 GB RAM
> > * Windows 10 22H2 x64, Intel Core i7 6700, 32 GB RAM
> > * Windows 7 SP1 x64, Intel Core i7 6700, 32 GB RAM
> > 
> > I'm surprised that you're not hitting it very quickly. The following 
> > loop usually fails after a few iterations (rarely a hundred or so) in my 
> > tests:
> > 
> > while bash -c 'true & true & wait -n || { echo 1: $?; exit 1; } && wait 
> > -n || { echo 2: $?; exit 1; }'; do echo $((i++)); done
> 
> Thanks. My main PC still runs the above test for more than 15000 counts.
> So, I tried another PC which CPU is Core i5 540M and could reproduce
> the issue about 1 time per a few hundreds count.
> 
> I also tried to run sleep 0.1 instead of true, then, the issue happens
> 1 time per a few decades counts.
> 
> I'll look into this problem. Thanks for the report.

In my environment, the issue is reproducible even with cygwin 3.3.6
(32bit, i.e. WOW64) and bash 4.4.12(3)-release (i686-pc-cygwin).

What are the versions of bash in each systems?

-- 
Takashi Yano 

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


Re: Bogus exit code 127 from a child process

2024-03-17 Thread Takashi Yano via Cygwin
On Sun, 17 Mar 2024 21:03:58 +0900
Takashi Yano wrote:
> On Sun, 17 Mar 2024 19:21:16 +0900
> Takashi Yano wrote:
> > On Sun, 17 Mar 2024 13:03:40 +0300
> > Alexey Izbyshev wrote:
> > > On 2024-03-17 12:27, Takashi Yano wrote:
> > > > On Sun, 17 Mar 2024 12:01:55 +0300
> > > > Alexey Izbyshev wrote:
> > > >> On 2024-03-17 11:44, Takashi Yano wrote:
> > > >> > On Sun, 17 Mar 2024 11:14:16 +0300
> > > >> > Alexey Izbyshev wrote:
> > > >> >> Hello,
> > > >> >>
> > > >> >> I've been getting occasional "Error 127" from make -jN on seemingly
> > > >> >> random jobs. After reducing the set of jobs and eventually 
> > > >> >> eliminating
> > > >> >> make, I've arrived to this one-liner:
> > > >> >>
> > > >> >> bash -c 'true & true & wait -n || echo 1: $? && wait -n || echo 2: 
> > > >> >> $?'
> > > >> >>
> > > >> >> When run repeatedly, the second "wait -n" often reports 127.
> > > >> >>
> > > >> >> I've reproduced this in the following environments:
> > > >> >>
> > > >> >> * Cygwin 3.5.1, Windows 10 22H2 x64
> > > >> >> * Cygwin 3.4.6, Windows 10 22H2 x64 and Windows 7 x64
> > > >> >>
> > > >> >> I couldn't reproduce it in Cygwin 3.3.6 (WOW64) on Windows 7 x64.
> > > >> >
> > > >> > Could you please try latest cygwin 3.6.0 (TEST) ?
> > > >> 
> > > >> Tested with 3.6.0-0.82.gfc691d0246b9 on Windows 10 22H2 x64, the 
> > > >> problem
> > > >> still occurs.
> > > > 
> > > > In my evrironmen, trial for 1 hour does not reproduce the issue.
> > > > Could you please let us know your environment, i.e. CPU, amount of
> > > > memory, and so on?
> > > 
> > > It's been reproduced in a variety of environments:
> > > 
> > > * Windows 10 22H2 x64, Intel Core i7 11700, 32 GB RAM
> > > * Windows 10 22H2 x64, Intel Core i7 9700, 32 GB RAM
> > > * Windows 10 22H2 x64, Intel Core i7 6700, 32 GB RAM
> > > * Windows 7 SP1 x64, Intel Core i7 6700, 32 GB RAM
> > > 
> > > I'm surprised that you're not hitting it very quickly. The following 
> > > loop usually fails after a few iterations (rarely a hundred or so) in my 
> > > tests:
> > > 
> > > while bash -c 'true & true & wait -n || { echo 1: $?; exit 1; } && wait 
> > > -n || { echo 2: $?; exit 1; }'; do echo $((i++)); done
> > 
> > Thanks. My main PC still runs the above test for more than 15000 counts.
> > So, I tried another PC which CPU is Core i5 540M and could reproduce
> > the issue about 1 time per a few hundreds count.
> > 
> > I also tried to run sleep 0.1 instead of true, then, the issue happens
> > 1 time per a few decades counts.
> > 
> > I'll look into this problem. Thanks for the report.
> 
> In my environment, the issue is reproducible even with cygwin 3.3.6
> (32bit, i.e. WOW64) and bash 4.4.12(3)-release (i686-pc-cygwin).
> 
> What are the versions of bash in each systems?

And, the attached simple test case in C which does very similar things
with bash command could not reproduce the problem.

Can you reproduce the issue with attached STC?

-- 
Takashi Yano 
#include 
#include 
#include 
#include 

int main(int argc, char *argv[])
{
	int status;
	int num = 2;
	int cnt = 0;
	if (argc > 1) num = atoi(argv[1]);
	while (1) {
		for (int i=0; i
-- 
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


Re: Bogus exit code 127 from a child process

2024-03-17 Thread Takashi Yano via Cygwin
On Sun, 17 Mar 2024 21:15:17 +0900
Takashi Yano wrote:
> On Sun, 17 Mar 2024 21:03:58 +0900
> Takashi Yano wrote:
> > On Sun, 17 Mar 2024 19:21:16 +0900
> > Takashi Yano wrote:
> > > On Sun, 17 Mar 2024 13:03:40 +0300
> > > Alexey Izbyshev wrote:
> > > > On 2024-03-17 12:27, Takashi Yano wrote:
> > > > > On Sun, 17 Mar 2024 12:01:55 +0300
> > > > > Alexey Izbyshev wrote:
> > > > >> On 2024-03-17 11:44, Takashi Yano wrote:
> > > > >> > On Sun, 17 Mar 2024 11:14:16 +0300
> > > > >> > Alexey Izbyshev wrote:
> > > > >> >> Hello,
> > > > >> >>
> > > > >> >> I've been getting occasional "Error 127" from make -jN on 
> > > > >> >> seemingly
> > > > >> >> random jobs. After reducing the set of jobs and eventually 
> > > > >> >> eliminating
> > > > >> >> make, I've arrived to this one-liner:
> > > > >> >>
> > > > >> >> bash -c 'true & true & wait -n || echo 1: $? && wait -n || echo 
> > > > >> >> 2: $?'
> > > > >> >>
> > > > >> >> When run repeatedly, the second "wait -n" often reports 127.
> > > > >> >>
> > > > >> >> I've reproduced this in the following environments:
> > > > >> >>
> > > > >> >> * Cygwin 3.5.1, Windows 10 22H2 x64
> > > > >> >> * Cygwin 3.4.6, Windows 10 22H2 x64 and Windows 7 x64
> > > > >> >>
> > > > >> >> I couldn't reproduce it in Cygwin 3.3.6 (WOW64) on Windows 7 x64.
> > > > >> >
> > > > >> > Could you please try latest cygwin 3.6.0 (TEST) ?
> > > > >> 
> > > > >> Tested with 3.6.0-0.82.gfc691d0246b9 on Windows 10 22H2 x64, the 
> > > > >> problem
> > > > >> still occurs.
> > > > > 
> > > > > In my evrironmen, trial for 1 hour does not reproduce the issue.
> > > > > Could you please let us know your environment, i.e. CPU, amount of
> > > > > memory, and so on?
> > > > 
> > > > It's been reproduced in a variety of environments:
> > > > 
> > > > * Windows 10 22H2 x64, Intel Core i7 11700, 32 GB RAM
> > > > * Windows 10 22H2 x64, Intel Core i7 9700, 32 GB RAM
> > > > * Windows 10 22H2 x64, Intel Core i7 6700, 32 GB RAM
> > > > * Windows 7 SP1 x64, Intel Core i7 6700, 32 GB RAM
> > > > 
> > > > I'm surprised that you're not hitting it very quickly. The following 
> > > > loop usually fails after a few iterations (rarely a hundred or so) in 
> > > > my 
> > > > tests:
> > > > 
> > > > while bash -c 'true & true & wait -n || { echo 1: $?; exit 1; } && wait 
> > > > -n || { echo 2: $?; exit 1; }'; do echo $((i++)); done
> > > 
> > > Thanks. My main PC still runs the above test for more than 15000 counts.
> > > So, I tried another PC which CPU is Core i5 540M and could reproduce
> > > the issue about 1 time per a few hundreds count.
> > > 
> > > I also tried to run sleep 0.1 instead of true, then, the issue happens
> > > 1 time per a few decades counts.
> > > 
> > > I'll look into this problem. Thanks for the report.
> > 
> > In my environment, the issue is reproducible even with cygwin 3.3.6
> > (32bit, i.e. WOW64) and bash 4.4.12(3)-release (i686-pc-cygwin).
> > 
> > What are the versions of bash in each systems?
> 
> And, the attached simple test case in C which does very similar things
> with bash command could not reproduce the problem.
> 
> Can you reproduce the issue with attached STC?

I also test your test case:
while bash -c 'true & true & wait -n || { echo 1: $?; exit 1; } && wait -n || { 
echo 2: $?; exit 1; }'; do echo $((i++)); done
in Linux (Debian 12.5), and the issue reproduced!

It seems that this is a bug of upstream of bash.

Eric, Corinna, any idea?

-- 
Takashi Yano 

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


Re: Bogus exit code 127 from a child process

2024-03-17 Thread Dimitry Andric via Cygwin
On 17 Mar 2024, at 13:35, Takashi Yano via Cygwin  wrote:
...
> 
> I also test your test case:
> while bash -c 'true & true & wait -n || { echo 1: $?; exit 1; } && wait -n || 
> { echo 2: $?; exit 1; }'; do echo $((i++)); done
> in Linux (Debian 12.5), and the issue reproduced!

Yeah, same here with bash 5.1.16(1)-release on Ubuntu 22.04. It errors out with 
127 after ~50-200 loops.

-Dimitry


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


Re: Bogus exit code 127 from a child process

2024-03-17 Thread Dimitry Andric via Cygwin
On 17 Mar 2024, at 13:50, Dimitry Andric  wrote:
> 
> On 17 Mar 2024, at 13:35, Takashi Yano via Cygwin  wrote:
> ...
>> 
>> I also test your test case:
>> while bash -c 'true & true & wait -n || { echo 1: $?; exit 1; } && wait -n 
>> || { echo 2: $?; exit 1; }'; do echo $((i++)); done
>> in Linux (Debian 12.5), and the issue reproduced!
> 
> Yeah, same here with bash 5.1.16(1)-release on Ubuntu 22.04. It errors out 
> with 127 after ~50-200 loops.

Having built bash master (bash-5.2-27-gf3b6bd19) here, it consistently gives 
127 in this area:

https://git.savannah.gnu.org/cgit/bash.git/tree/builtins/wait.def#n227

   211  #if defined (JOB_CONTROL)
   212if (nflag)
   213  {
   214if (list)
   215  {
   216opt = set_waitlist (list);
   217if (opt == 0)
   218  WAIT_RETURN (127);
   219wflags |= JWAIT_WAITING;
   220  }
   221
   222status = wait_for_any_job (wflags, &pstat);
   223if (vname && status >= 0)
   224  builtin_bind_var_to_int (vname, pstat.pid, bindflags);
   225
   226if (status < 0)
=> 227  status = 127;
   228if (list)
   229  unset_waitlist ();
   230WAIT_RETURN (status);
   231  }
   232  #endif

So for some reason, wait_for_any_job() returns a negative value in this 
particular situation.

-Dimitry


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


Re: Re: Black screen running startx

2024-03-17 Thread Frank Eskesen via Cygwin
Easy to see problem symptom: When running xinit, the full-screen window 
has a white border.


I have an older machine with an "ASUS NVIDIA GeForce GTX 770" graphics card.

The problem was either with the NVIDIA Windows display driver or some 
underlying Windows update. Fixing it was a problem:

- Reinstalling a back-level driver *did not* fix the problem.
- Deleting the device driver *did not* fix the problem.
At first, Windows installed a basic windows driver and xinit worked and 
the screen was visible. However, after a short time the window turned 
all white. Examining the "(Control Panel/Device manager)machine/Display 
adapters" showed that the NVIDIA driver had been reinstalled. I found 
(with some difficulty) a Windows tool (wushowhide.diagcab) that's 
*supposed* to prevent driver reinstalls. It found the NVIDIA driver in 
the brief window between when the driver was deleted and before the 
automatic reinstall but *did not* prevent the re-install. Additionally:
  - Control panel delete of all NVIDIA programs (including device 
driver) didn't work.
  - Renaming all "C:/Program Files/NVIDA*" and "C:/Program 
Files/X86/NVIDIA*" folders to "../xxNVIDIA*" folders didn't work.
  (Windows still found "restored" the useless driver from a 
DriverStore/Repository.)


> Disabling the NVIDIA driver finally fixed the problem. Drastic, but 
at least removing the video card wasn't required.


(Whew.)

On 3/16/2024 5:39 PM, Frank Eskesen wrote:

When I ran xinit, I got the following events in the Windows event log:
   Display driver nvlddmkm stopped responding and has successfully 
recovered.


Kernel diagnostic event: 
=

Fault bucket LKD_0x141_Tdr:6_IMAGE_nvlddmkm.sys_Kepler_3D, type 0
Event Name: LiveKernelEvent
Response: Not available
Cab Id: a6403500-eabe-4cd3-b903-6bb2b419deb1

Problem signature:
P1: 141
P2: 860f28aef050
P3: f805298bc9b8
P4: 0
P5: 0
P6: 10_0_19045
P7: 0_0
P8: 256_1
P9:
P10:

Attached files:
\\?\C:\WINDOWS\LiveKernelReports\WATCHDOG\WATCHDOG-20240316-1657.dmp
\\?\C:\WINDOWS\TEMP\WER-327258125-0.sysdata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERA8C5.tmp.WERInternalMetadata.xml 


\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERA8E5.tmp.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERA8F8.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERA956.tmp.txt

These files may be available here:
\\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\Kernel_141_6cdced420649f37203e03acc79a72eda67e51__cab_efab5333-8f8d-44e4-a528-6ae62b848c4d 



Analysis symbol:
Rechecking for solution: 0
Report Id: efab5333-8f8d-44e4-a528-6ae62b848c4d
Report Status: 268435456
Hashed bucket:
== 



Why this suddenly appeared is a mystery, but it's a Windows mystery. The
ReportArchive information summary is:
ReportDescription=A problem with your hardware caused Windows to stop 
working correctly.


So, the problem appears to in the Windows display driver. Please hold off
looking at this problem, at least until I can get more usable 
information.



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


Re: Bogus exit code 127 from a child process

2024-03-17 Thread Takashi Yano via Cygwin
On Sun, 17 Mar 2024 14:10:55 +0100
Dimitry Andric wrote:
> On 17 Mar 2024, at 13:50, Dimitry Andric  
> wrote:
> > 
> > On 17 Mar 2024, at 13:35, Takashi Yano via Cygwin  wrote:
> > ...
> >> 
> >> I also test your test case:
> >> while bash -c 'true & true & wait -n || { echo 1: $?; exit 1; } && wait -n 
> >> || { echo 2: $?; exit 1; }'; do echo $((i++)); done
> >> in Linux (Debian 12.5), and the issue reproduced!
> > 
> > Yeah, same here with bash 5.1.16(1)-release on Ubuntu 22.04. It errors out 
> > with 127 after ~50-200 loops.
> 
> Having built bash master (bash-5.2-27-gf3b6bd19) here, it consistently gives 
> 127 in this area:
> 
> https://git.savannah.gnu.org/cgit/bash.git/tree/builtins/wait.def#n227
> 
>211  #if defined (JOB_CONTROL)
>212if (nflag)
>213  {
>214if (list)
>215  {
>216opt = set_waitlist (list);
>217if (opt == 0)
>218  WAIT_RETURN (127);
>219wflags |= JWAIT_WAITING;
>220  }
>221
>222status = wait_for_any_job (wflags, &pstat);
>223if (vname && status >= 0)
>224  builtin_bind_var_to_int (vname, pstat.pid, bindflags);
>225
>226if (status < 0)
> => 227  status = 127;
>228if (list)
>229  unset_waitlist ();
>230WAIT_RETURN (status);
>231  }
>232  #endif
> 
> So for some reason, wait_for_any_job() returns a negative value in this 
> particular situation.

Line 218 looks also suspicious.

-- 
Takashi Yano 

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


Re: Bogus exit code 127 from a child process

2024-03-17 Thread Takashi Yano via Cygwin
On Mon, 18 Mar 2024 12:09:06 +0900
Takashi Yano wrote:
> On Sun, 17 Mar 2024 14:10:55 +0100
> Dimitry Andric wrote:
> > On 17 Mar 2024, at 13:50, Dimitry Andric  
> > wrote:
> > > 
> > > On 17 Mar 2024, at 13:35, Takashi Yano via Cygwin  
> > > wrote:
> > > ...
> > >> 
> > >> I also test your test case:
> > >> while bash -c 'true & true & wait -n || { echo 1: $?; exit 1; } && wait 
> > >> -n || { echo 2: $?; exit 1; }'; do echo $((i++)); done
> > >> in Linux (Debian 12.5), and the issue reproduced!
> > > 
> > > Yeah, same here with bash 5.1.16(1)-release on Ubuntu 22.04. It errors 
> > > out with 127 after ~50-200 loops.
> > 
> > Having built bash master (bash-5.2-27-gf3b6bd19) here, it consistently 
> > gives 127 in this area:
> > 
> > https://git.savannah.gnu.org/cgit/bash.git/tree/builtins/wait.def#n227
> > 
> >211  #if defined (JOB_CONTROL)
> >212if (nflag)
> >213  {
> >214if (list)
> >215  {
> >216opt = set_waitlist (list);
> >217if (opt == 0)
> >218  WAIT_RETURN (127);
> >219wflags |= JWAIT_WAITING;
> >220  }
> >221
> >222status = wait_for_any_job (wflags, &pstat);
> >223if (vname && status >= 0)
> >224  builtin_bind_var_to_int (vname, pstat.pid, bindflags);
> >225
> >226if (status < 0)
> > => 227  status = 127;
> >228if (list)
> >229  unset_waitlist ();
> >230WAIT_RETURN (status);
> >231  }
> >232  #endif
> > 
> > So for some reason, wait_for_any_job() returns a negative value in this 
> > particular situation.
> 
> Line 218 looks also suspicious.

Probably, this is not a bug. man bash says:
  If  the  -n option is supplied, wait waits for a single job from
  the list of ids or, if no ids are supplied, any job, to complete
  and returns its exit status.  If none of the supplied  arguments
  is a child of the shell, or if no arguments are supplied and the
  shell  has no unwaited‐for children, the exit status is 127.

If the background process exited before calling 'wait -n', it returns 127.
This is very different from wait() system call, which is necessary for
any background joubs, otherwise zombie remains.

In the shell, it is not necessary to call wait command for background jobs,
therefore exit status of the background job which already exited is not held
anymore.

So, actual bug is in the test case.

-- 
Takashi Yano 

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