This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[OT] Wine + Cygwin: `script -e` exit status forwarding randomly return zero for non zero child process

Dear list,

Before the actual question, I wonder whether Wine specific issues are
considered as off-topic here, and whether it is allowed here? Anyway,
thanks for your great contribution on Cygwin!

In the past few months, we were working on supporting Cygwin/MSYS2 on
Wine (Wine Staging at this moment, we will upstream our patches
lately). After fixing a couple of Wine Staging bugs [1], today
Cygwin/MSYS2 works much better on Wine Staging than before.
GCC/GDB/etc, including most part of toolchain, are now basically
supported on Wine Staging 1.7.50.

However, the remain bugs are difficult, so it would be great to have
some help from Cygwin community to speed up the bug fix progress, many
thanks for anyone interesting to join!

==== thanks for reading :) ====

Now, here is one bug blocks me for two days:

On Cygwin Windows, `script -e -c "exit 5"` will always return 5;
On Cygwin Wine, `script -e -c "exit 5"` sometimes returns 5 while
sometimes return zero. I tested with a 100-times-loop, 34 of them
return zero, while 66 of them return 5.

Tested version:

$ uname -a
CYGWIN_NT-5.1  2.2.1(0.289/5/3) 2015-08-20 11:40 i686 Cygwin

$ wine --version
wine-1.7.50-823-ga81e861 (Staging)

I try to strace `script`, and I found when strace is used, the failure
rate down to 18/100: In a 100-times-loop with strace, 18 of scripts
return 0, 82 of scripts return 5.

I analysis the strace log, and I found a common pattern in all 18
failure logs: all of them have only 3 "ExitProcess" message, while in
the other 82 success logs, each of them has 4 "ExitProcess" message.

The attachment script.strace.good.txt is for the one returns none
zero, the attachment script.strace.bad.txt is for the one returns

I dig with Cygwin source code for a bit, but I haven't figure out
what's wrong yet, my main problem is I'm not familiar with the exit()
implementation in Cygwin. I'm reading how-startup-shutdown-works.txt
again, it does help but not enough. Anyone could provide some hints
where to go on? I can update this thread with my debugging result

Thanks very much for your help!


Qian Hong


Attachment: script.strace.good.txt
Description: Text document

Attachment: script.strace.bad.txt
Description: Text document

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]