Chris
--
Chris Sutcliffe
http://emergedesktop.org
It could be related to the scrolling, as I did enable it.
I've attached my .minttyrc for your reference. One thing I should
point out is that all open mintty windows close at the same time. I
typically have several (3 to 4) mintty windows open at any given
point, and when it occurs, all of them close, with the bash.exe
processes remaining intact.
Could it perhaps have something to do with the hidden console (I
believe one is created?) being killed by something, and as a result,
all the child process (I assume the mintty windows), dying as a
result? Pure conjecture on my part, having not looked at the code...
Cheers!
I've not been able to recreate the issue today. I have since svn up'd
to 507 and rebooted. Perhaps the it was one of the age old,
fix-windows-by-rebooting type issues.
FWIW, I'm running Windows XP Pro Corporate - SP3. I invoke mintty with:
C:\cygwin\bin\mintty.exe -
If it happens again, I'll do my best to provide some useful information.
I spoke to soon...
> If it happens again, I'll do my best to provide some useful information.
With more than one mintty window open:
cd /etc
vim fstab
or
vim /etc/fstab
All other mintty windows close except the window where vim is
executing (though sometimes it closes as well). The bash.exe and
vim.exe processes remain.
This happens for me all the time.
As previously mentioned, I'm using XP Corporate Edition with SP3
installed running Cygwin 1.7.0-60 and mintty svn trunk (507).
mintty.exe compiled out of the 0.4 branch does not display this
behaviour.
Let me know if there is something else you would like me to do.
Some more interesting stuff found during testing... If mintty is
started from a Cygwin console, it does not silently close like those
started via:
C:\cygwin\bin\mintty.exe -
Don't know if this indicating the hidden console thing again (since I
believe a hidden console is not created if started from an existing
console)?
> I'm still stumped, and haven't managed to reproduce it yet. Let's try
> to pin down a few more variables:
>
> - I assume you're using gcc-4 to compile it?
No, gcc-3, I don't specify any gcc...
> - Any custom compiler flags?
No, I simply call 'make' in trunk.
> - Have you got any of LANG, LC_CTYPE or LC_ALL set?
Yes, LANG=en_CA.UTF-8
> - Are you running as administrator?
Yes.
> - Is run.exe involved when invoking mintty or vim?
No.
> - Does it happen with /etc/fstab only, or with an empty buffer or
> other files as well?
simply running vim causes no problem, but running 'vim test' (where
test does not exist) will cause the same behaviour.
> - Does switching off scrollback on the alternate screen make a
> difference?
No, with it on or off makes no difference.
> - Does the issue happen with r501 as well? (That's alpha1 plus the fix
> for the locale setting bug, but before messing about with the
> scrolling.)
Yes.
> - Does it happen with latest mintty and cygwin-1.7.0-59?
Yes.
> Sorry for this scattergun approach, but I don't know a better way to
> tackle this. Ideas welcome.
No worries, issues like this are tricky to track down.
I tried compiling with debug symbols, but running via gdb from a
Cygwin console window didn't help due to what I mentioned at the start
of this post. If memory servers, isn't there a way to attach gdb to a
running process?
Cheers!
>> - I assume you're using gcc-4 to compile it?
>
> No, gcc-3, I don't specify any gcc...
Compiling with gcc-4 corrects the issue, no idea why.
Unfortunately not for me.
> Trouble is, the "fix" shouldn't make a difference, so it's probably
> just masking the real issue. All it does is take the bool parameter
> off cp_update_locale. The code in cp_update_locale is innocent,
> because removing it didn't make the issue go away. Commenting out the
> cp_update_locale call in main() did also "fix" the issue though. A
> corrupted stack perhaps? Still no idea how vim, rxvt and consoles fit
> into the picture.
The corrupt stack sounds like a possibility. I assume gcc-3 and gcc-4
handle the stack differently (hence it working with gcc-4 and not
gcc-3)? I tried adding '-mms-bitfields' to see if it would make any
difference, but it didn't help.
The kicker is that anything I could use to do a trace (gdb, strace)
don't help because I don't experience the behaviour if mintty is
started from a Cygwin console.
As always, if there is anything I can do to help track down the issue,
please let me know.
Cheers!
I managed to connect to running mintty instance with gdb, and
unfortunately it didn't provide any helpful information. The other
windows silently closed, and the one I attached gdb to just went in to
a bad state where it didn't accept input and did not refresh /
repaint. There were no signals sent to gdb, and backtrace didn't
provide anything useful.
If there is anything else anyone can think of, I'd be happy to try it.
It may well be a compiler issue.
> Thank you very much for the gdb/strace efforts.
No worries, I like to do what I can to help out!
> As you noted as well, the issue appears to be triggered by accesses to
> vim .swp files. A couple of times I had it occurring when just doing
> tab completion in /etc while such a file exists? Do you happen to know
> whether there's anything special about those files? Are they memory-
> mapped?
I'm not familiar with the internals of the .swp file I'm afraid.
Would you like me to pose the question on the vim-dev mailing list?
FWIW, r514 fixes the issue for me.