Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mintty / git-bash crashes when "Options..." menu is used. #610

Closed
chadjoan opened this issue Nov 22, 2016 · 15 comments
Closed

mintty / git-bash crashes when "Options..." menu is used. #610

chadjoan opened this issue Nov 22, 2016 · 15 comments

Comments

@chadjoan
Copy link

mintty/git-bash crashes sometimes when the (Corner Dropdown)→Options menu is opened, and sometimes when submenus in the (Corner Dropdown)→Options menu are navigated to. This bug may or may not happen when the program is run, so I made a video demonstrating multiple runs of the program, along with the unusual behavior. It seems as if it more likely to crash the longer the program is open, and on some small time scale (perhaps 1-3 seconds or so before crashes become likely).

Link to a video of the behavior: https://www.youtube.com/watch?v=42Yh1iYMfJc

My current workaround is to start Git Bash really quick and get into the options menu before the bug happens. I managed to change the number of columns/rows on the window this way. So I managed to accomplish what I wanted, but the bug is still there.

Found on Windows 7 Pro 64-bit. Mintty 2.6.2, Git Bash v2.10.2 64-bit install.

Good luck and thank you for writing this software.

@mintty
Copy link
Owner

mintty commented Nov 22, 2016

I cannot reproduce that behaviour (after updating Git).
What about some cross-test cases? Like starting without --cd-to-home, starting from Start Menu or a desktop shortcut. And can for move aside your .profile and .bashrc for a cross-test, please?

@chadjoan
Copy link
Author

I originally found the problem by running it from the start menu. The command I ran, including the --cd-to-home was simply taken from the shortcut and pasted into a CMD window.

I just tried it without the --cd-to-home and it still crashes.

Sorry, I don't know what you mean by "move aside" regarding my .profile and .bashrc. I was going to give you the contents, but I don't seem to have a .profile or .bashrc:

cjoan@****** MINGW64 /c/Users/cjoan
$ cat ~/.profile
cat: /z//.profile: No such file or directory

cjoan@****** MINGW64 /c/Users/cjoan
$ cat ~/.bashrc
cat: /z//.bashrc: No such file or directory

@chadjoan
Copy link
Author

It also Option crashes when run from a desktop shortcut.

I also tried running "C:\Program Files\Git\usr\bin\mintty.exe" to remove any interference from git-bash.exe. Still crashes.

@mintty
Copy link
Owner

mintty commented Nov 23, 2016

In the git-for-windows issue, others report they see this crash on Windows 10, but not on Windows 7.
You said it's on Windows 7. Can you confirm this please, maybe also run cmd /c ver?

@chadjoan
Copy link
Author

Sure.

I confirm that it is a Windows 7 machine.

mintty_bug_report

Command output:

C:\Users\cjoan>cmd /c ver

Microsoft Windows [Version 6.1.7601]

mintty added a commit that referenced this issue Nov 28, 2016
@mintty
Copy link
Owner

mintty commented Nov 28, 2016

The current repository version includes some debug code for this issue. If you can compile it for Git Bash, or compile it for MSYS2 and reproduce the issue by copying that binary into Git for Windows, redirect its output (minttydebug > log) and report the contents of the log file after a crash (should be 1 line).

@chadjoan
Copy link
Author

I installed MSYS2. I also had to make MSYS2's pacman install gcc and make. Then I tried to compile your commit, but got an error:

$ make DEBUG=1
#cd src; make exe
#cd src; make bin
cd src; make
make[1]: Entering directory '/c/downloads/git_for_windows_debug_build/mintty/src'
mkdir -p ../bin/msys64
gcc -c -MMD -MP -DTARGET=x86_64-pc-msys -std=gnu99 -include std.h -Wall -Wextra -Wundef -Werror -mtune=atom -g  -fstack-check wintip.c -o ../bin/msys64/wintip.o
gcc -c -MMD -MP -DTARGET=x86_64-pc-msys -std=gnu99 -include std.h -Wall -Wextra -Wundef -Werror -mtune=atom -g  -fstack-check windialog.c -o ../bin/msys64/windialog.o
windialog.c:162:1: error: ‘crashtest’ defined but not used [-Werror=unused-function]
 crashtest()
 ^
cc1: all warnings being treated as errors
make[1]: *** [Makefile:123: ../bin/msys64/windialog.o] Error 1
make[1]: Leaving directory '/c/downloads/git_for_windows_debug_build/mintty/src'
make: *** [Makefile:21: exe] Error 2
cjoan@****** MINGW64 /c/downloads/git_for_windows_debug_build/mintty
$ make --version
GNU Make 4.2.1
Built for x86_64-pc-msys
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

cjoan@****** MINGW64 /c/downloads/git_for_windows_debug_build/mintty
$ gcc --version
gcc (GCC) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@mintty
Copy link
Owner

mintty commented Nov 28, 2016

Yes, sorry, that's been fixed meanwhile, please try again.

@chadjoan
Copy link
Author

Well, I'm having trouble getting a clean test, but I ran into something interesting that might help you repro.

First, a bit of methodology:

I successfully built the new mintty. I copied mintty.exe into Git for Windows' $DIR/usr/bin directory. I tried to run it from CMD and got a cygheap base mismatch detected error (sorry, I forgot to copy it when I had it).

I realized that I had built mintty in a MINGW64 environment (ex: by opening MINGW64.EXE in the MSYS2 directory, then cd'ing to the mintty directory, then running make DEBUG=1) instead of an MSYS environment (both are packaged in MSYS2, and the icons differ only in color).

I rebuilt mintty from the MSYS environment, copied mintty.exe into Git for Windows, then tried to run it from CMD. I got another cygheap base mismatch detected error:

      3 [main] cut (2168) C:\msys64\usr\bin\cut.exe: *** fatal error - cygheap base mismatch detected - 0x1802FF408/0x1802FE408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.

The same thing happens in a Git Bash environment (whatever that is; I'm not sure myself).

Now for the interesting bit:

I then tried invoking the new mintty.exe from the MSYS environment (ex: by opening MSYS.EXE in the MSYS2 directory and then typing "C:\Program Files\Git\usr\bin\mintty" at the prompt). It opened successfully without a cygheap error AND no longer exhibits the Options crash!

Well, it's not a clean test because I couldn't repro and give you an error log, but it does indicate that this problem might be at least triggered by the environment that mintty.exe is executed from.

I might dig at it more later, but I am busy with work, so it could take some time. If you want to work ahead of me, maybe you can do it by thinking about how these different programs set up their environment, and make a test based on that. If you can give me detailed directions on how to set up another test, maybe that will make it easier for me to proceed sooner and I can run it for you.

Hope that helps.

@willhaslam
Copy link

I have the same issue

@mintty
Copy link
Owner

mintty commented Dec 6, 2016

Please retry with mintty 2.7.1, then report back.

@chadjoan
Copy link
Author

chadjoan commented Dec 7, 2016

I had an opportunity to try this, but I realized that there's a problem on my end that prevents me from giving you any meaningful feedback on 2.7.1: I can't repro the problem if I build mintty myself.

I think I will need to know how Git for Windows builds mintty before I can proceed.

Hopefully that would allow me to build an older version of mintty, repro the problem on that, then build the 2.7.1 version and be able to confirm/deny resolution.

@weeble
Copy link

weeble commented Dec 9, 2016

I think this might be related to having $HOME point to a network drive. I get the same symptoms (the options window either crashes immediately or when I switch to the Terminal section) when $HOME is undefined, $HOMEDRIVE is "Z:" and $HOMEPATH is "\". If I set $HOME to "C:\Users\username" before starting git-bash.exe, the options window works without crashing. In this case the Z: drive is a mounted network share. However, I've not tried the most recent build yet.

@mintty
Copy link
Owner

mintty commented Dec 9, 2016

Interesting observation, and I can in fact reproduce it now, thanks. (No need to try recent build anymore.)

@mintty
Copy link
Owner

mintty commented Dec 10, 2016

Fix released in 2.7.2. Root cause notified to cygwin mailing list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants