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

64-bit sh.exe crashes with STATUS_STACK_OVERFLOW when ConEmuHk injection is enabled #1158

Closed
lassevk opened this issue Jun 7, 2017 · 10 comments

Comments

@lassevk
Copy link

lassevk commented Jun 7, 2017

git rebase and certain other operations fails, sh.exe crashes with a STATUS_STACK_OVERFLOW, when
ConEmuHk is injected, when ConEmu/Cmder is 64-bit and git is 64-bit. With 32-bit git the crash doesn't happen.

Versions

ConEmu build: 161206 x64
OS version: Windows 10.0.14393 x64
Used shell version (Far Manager, git-bash, cmd, powershell, cygwin, whatever): git-bash 4.4.12(1)-release (x86_64-pc-msys)

Running 32-bit git (and thus 32-bit bash) and the crash goes away.

Problem description

NOTE! this is running ConEmu as part of cmder, if the dialogs below is 100% cmder and not CmdEmu let me know and this issue must be moved to some other project.

git rebase and certain git merge operations fail, leaves incomplete git operation and also adds a file on disk, sh.exe.stackdump with STATUS_STACK_OVERFLOW + register dump.

Steps to reproduce

Execute the following with the 64-bit git version installed and "Inject ConEmuHk" enabled.

@echo off

setlocal

cd /d D:\

REM INITIALIZE EMPTY FOLDER AND REPOSITORY
if exist gittest rd /s /q gittest
md gittest

cd gittest
git init .

REM ADD TWO INITIAL COMMITS ON MASTER

for %%f in (a b) do (
    echo %%f >test-%%f.txt
    git add .
    git commit -m "%%f"
)

git branch develop

REM CONTINUE ADDING COMMITS TO MASTER
for %%f in (c d) do (
    echo %%f >test-%%f.txt
    git add .
    git commit -m "%%f"
)

REM GO BACK TO develop AND ADD COMMITS
git checkout develop
for %%f in (e f) do (
    echo %%f >test-%%f.txt
    git add .
    git commit -m "%%f"
)

REM REBASE
git rebase master

Actual results

Crashes rebase operation and leaves sh.exe.stackdump file on disk with content:

Exception: STATUS_STACK_OVERFLOW at rip=7FFC83ABCE47
rax=00000000000020D0 rbx=00000000FFFFB010 rcx=00007FFC83ABFC20
rdx=0000000002308090 rsi=0000000000000020 rdi=0000000000000000
r8 =00000000FFFFAB70 r9 =00000000FFFFA3D8 r10=00000000FFFF8000
r11=00000000FFE03550 r12=00000001005EDD3C r13=000000018021B490
r14=00000001005EDD44 r15=0000000000000000
rbp=0000000000000020 rsp=00000000FFFFAAF8
program=C:\Dropbox\Tools\Git\usr\bin\sh.exe, pid 31012, thread unknown (0x3AD8)
cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B

Expected results

Rebase operation completes successfully

Additional files

None relevant, only relevant setting is checkbox in options dialog for:

[x] Inject ConEmuHK

github-cygwin pushed a commit to cygwin/cygwin that referenced this issue Jun 9, 2017
ConEmu: There has been at least one report of it causing crashes <Maximus5/ConEmu#1158>

COMODO Internet Security: Causing GPG failures <https://github.com/msys2/msys2/issues/38>
@Maximus5
Copy link
Owner

I believe third-party software raises the crash. ConEmu is working fine with ssh on Windows without Comodo. And personally I use third-party antivirus software without any problems (AVP). Report to Comodo.

@lassevk
Copy link
Author

lassevk commented Jun 15, 2017

I will file a bug report with cmder, however...

cmder != comodo, cmder is http://cmder.net/, an alternative to cmd.exe, using conemu, and not antivirus
git-bash != ssh, git-bash is sh.exe (not ssh.exe), and is invoked by git in order to run shell-scripts that are part of git

Did you try running git rebase, using my batch file, under conemu?

@Maximus5
Copy link
Owner

I said nothing about cmder.
Just looked above to

github-cygwin referenced this issue from commit

Well, open ConEmu/About and paste here the text from SysInfo tab.

@Maximus5
Copy link
Owner

JFI, I use git in ConEmu on daily basis and haven't seen problems with rebase.

@lassevk
Copy link
Author

lassevk commented Jun 15, 2017

Here's all the information from Help/About/SysInfo from within cmder:

ConEmu 161206 [64] Startup Info
  OsVer: 10.0.14393.x64, Product: 1, SP: 0.0, Suite: 0x100, SM_SERVERR2: 0
  CSDVersion: , ReactOS: 0 (), Rsrv: 0
  DBCS: 0, WINE: 0, PE: 0, Remote: 0, ACP: 1252, OEMCP: 850, Admin: 0
  StartTime: 2017-06-15 14:20:35.179
  AppID: 07cebbd450714133cf72841790210580::162
  Desktop: `Winsta0\Default`, SessionId: 1, ConsoleSessionId: 1
  Title: `C:\Dropbox\tools\cmder\Cmder.exe`
  Size: {0,0},{0,0}
  Flags: 0x00001000, ShowWindow: 0, ConHWnd: 0x00000000
  char: 1, short: 2, int: 4, long: 4, u64: 8
  Handles: 0x00000000, 0x00000000, 0x00000000
  Current PID: 25540, TID: 8848
  Active HKL: 0x0000000004140809
  GetKeyboardLayoutList: 0x0000000004140809
CmdLine: /Icon "C:\Dropbox\tools\cmder\icons\cmder.ico" /Title Cmder
ExecMod: C:\Dropbox\tools\cmder\vendor\conemu-maximus5\ConEmu64.exe
WorkDir: C:\WINDOWS\system32
PathEnv: C:\Program Files\Docker\Docker\Resources\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\FinalBuilder 8;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\TortoiseHg\;C:\Program Files\TortoiseGit\bin;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Microsoft Team Foundation Server 2015 Power Tools\;C:\Program Files\dotnet\;C:\Dropbox\Tools\git\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\;C:\Dropbox\tools\cmder;C:\Users\lasse.karlsen\AppData\Local\Microsoft\WindowsApps;C:\Dropbox\Tools;c:\gatsoft\gitscripts
ConFont: 0	Lucida Console	00	Consolas
CMD's AutoRuns: {not defined}
Foreground: x007B1046 {323,169}-{1612,760} 'VirtualConsoleClass' - Cmder
MouseCursor: {237,608} MouseMonitor: 00010001 StartMonitor: 00000000
Display: bpp=32, planes=1, align=1, vrefr=60, shade=x00000000, rast=x00007E99, dpi=96x96, per-mon-dpi=1
Monitors (dpi: WholeDesktop, Effective, Angular, RAW):
  00010001: {0,0}-{1920,1080} (1920x1080), Working: {0,0}-{1920,1040} (1920x1040), dpi: {96,96};{96,96};{91,91};{92,92} `\\.\DISPLAY1` <<== Primary
  00010003: {1920,0}-{3840,1080} (1920x1080), Working: {1920,0}-{3840,1040} (1920x1040), dpi: {96,96};{96,96};{91,91};{92,92} `\\.\DISPLAY2`
Modules:
  00007FF715810000-00007FF715A9DFFF   28E000 C:\Dropbox\tools\cmder\vendor\conemu-maximus5\ConEmu64.exe
  00007FFEBE910000-00007FFEBEAE0FFF   1D1000 C:\WINDOWS\SYSTEM32\ntdll.dll
  00007FFEBCB20000-00007FFEBCBCBFFF    AC000 C:\WINDOWS\System32\KERNEL32.DLL
  00007FFEBB540000-00007FFEBB75CFFF   21D000 C:\WINDOWS\System32\KERNELBASE.dll
  00007FFEBC130000-00007FFEBC294FFF   165000 C:\WINDOWS\System32\USER32.dll
  00007FFEBB470000-00007FFEBB48DFFF    1E000 C:\WINDOWS\System32\win32u.dll
  00007FFEBD360000-00007FFEBD393FFF    34000 C:\WINDOWS\System32\GDI32.dll
  00007FFEBB230000-00007FFEBB3B1FFF   182000 C:\WINDOWS\System32\gdi32full.dll
  00007FFEBBEB0000-00007FFEBBF51FFF    A2000 C:\WINDOWS\System32\ADVAPI32.dll
  00007FFEBD2C0000-00007FFEBD35DFFF    9E000 C:\WINDOWS\System32\msvcrt.dll
  00007FFEBC7F0000-00007FFEBC848FFF    59000 C:\WINDOWS\System32\sechost.dll
  00007FFEBD190000-00007FFEBD2B0FFF   121000 C:\WINDOWS\System32\RPCRT4.dll
  00007FFEBD3A0000-00007FFEBE8A7FFF  1508000 C:\WINDOWS\System32\SHELL32.dll
  00007FFEBB0D0000-00007FFEBB111FFF    42000 C:\WINDOWS\System32\cfgmgr32.dll
  00007FFEBB7C0000-00007FFEBBE99FFF   6DA000 C:\WINDOWS\System32\windows.storage.dll
  00007FFEBC850000-00007FFEBCB17FFF   2C8000 C:\WINDOWS\System32\combase.dll
  00007FFEBAFD0000-00007FFEBB0C4FFF    F5000 C:\WINDOWS\System32\ucrtbase.dll
  00007FFEBB1C0000-00007FFEBB229FFF    6A000 C:\WINDOWS\System32\bcryptPrimitives.dll
  00007FFEBADA0000-00007FFEBADEBFFF    4C000 C:\WINDOWS\System32\powrprof.dll
  00007FFEBD130000-00007FFEBD181FFF    52000 C:\WINDOWS\System32\shlwapi.dll
  00007FFEBAD70000-00007FFEBAD7EFFF     F000 C:\WINDOWS\System32\kernel.appcore.dll
  00007FFEBB490000-00007FFEBB538FFF    A9000 C:\WINDOWS\System32\shcore.dll
  00007FFEBAD80000-00007FFEBAD93FFF    14000 C:\WINDOWS\System32\profapi.dll
  00007FFEBCC00000-00007FFEBCCF9FFF    FA000 C:\WINDOWS\System32\COMDLG32.dll
  00007FFEB6340000-00007FFEB6349FFF     A000 C:\WINDOWS\SYSTEM32\VERSION.dll
  00007FFEBC3B0000-00007FFEBC4E7FFF   138000 C:\WINDOWS\System32\ole32.dll
  00007FFEB3100000-00007FFEB3379FFF   27A000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.14393.953_none_42151e83c686086b\COMCTL32.dll
  00007FFEBBFD0000-00007FFEBC08EFFF    BF000 C:\WINDOWS\System32\OLEAUT32.dll
  00007FFEB90D0000-00007FFEB90F2FFF    23000 C:\WINDOWS\SYSTEM32\WINMM.dll
  00007FFEBB120000-00007FFEBB1BBFFF    9C000 C:\WINDOWS\System32\msvcp_win.dll
  00007FFEAEC00000-00007FFEAEC17FFF    18000 C:\WINDOWS\SYSTEM32\NETAPI32.dll
  000002483CE50000-000002483CE7AFFF    2B000 C:\WINDOWS\SYSTEM32\WINMMBASE.dll
  00007FFEB2F40000-00007FFEB2F58FFF    19000 C:\WINDOWS\SYSTEM32\SAMCLI.DLL
  00007FFEBA510000-00007FFEBA51CFFF     D000 C:\WINDOWS\SYSTEM32\NETUTILS.DLL
  00007FFEBC300000-00007FFEBC32DFFF    2E000 C:\WINDOWS\System32\IMM32.DLL
  00007FFEBA140000-00007FFEBA267FFF   128000 C:\WINDOWS\SYSTEM32\actuser.dll
  000000000F000000-000000000F005FFF     6000 C:\WINDOWS\SYSTEM32\acdetoured.dll
  00007FFEBA020000-00007FFEBA0B7FFF    98000 C:\WINDOWS\SYSTEM32\msvcp60.dll
  00007FFEB9320000-00007FFEB93B4FFF    95000 C:\WINDOWS\system32\uxtheme.dll
  00007FFEB9010000-00007FFEB9035FFF    26000 C:\WINDOWS\SYSTEM32\dwmapi.dll
  00007FFEBC090000-00007FFEBC12EFFF    9F000 C:\WINDOWS\System32\clbcatq.dll
  00007FFEA88B0000-00007FFEA8ADBFFF   22C000 C:\WINDOWS\System32\msxml3.dll
  00007FFEBA950000-00007FFEBA97AFFF    2B000 C:\WINDOWS\System32\bcrypt.dll
  00007FFEBC4F0000-00007FFEBC649FFF   15A000 C:\WINDOWS\System32\MSCTF.dll
  00007FFE97C00000-00007FFE98083FFF   484000 C:\WINDOWS\system32\explorerframe.dll
  0000000054610000-000000005471CFFF   10D000 C:\Dropbox\tools\cmder\vendor\conemu-maximus5\ConEmu\ConEmuCD64.dll
  00007FFE98FA0000-00007FFE98FE8FFF    49000 C:\WINDOWS\system32\dataexchange.dll
  00007FFEB7CC0000-00007FFEB7F75FFF   2B6000 C:\WINDOWS\system32\d3d11.dll
  00007FFEB88D0000-00007FFEB8A20FFF   151000 C:\WINDOWS\system32\dcomp.dll
  00007FFEB9B20000-00007FFEB9BBEFFF    9F000 C:\WINDOWS\system32\dxgi.dll
  00007FFEB95F0000-00007FFEB970BFFF   11C000 C:\WINDOWS\system32\twinapi.appcore.dll
  00007FFEB6940000-00007FFEB6AC4FFF   185000 C:\WINDOWS\SYSTEM32\PROPSYS.dll

It was a longshot hoping you wouldn't be using git and the second you tried my batch file you would be able to reproduce it. Injection issues are usually the result of an amalgamation of various products, anyone of which can be the culprit.

Hoping you can spot something in the sysinfo. Let me know if I can provide anything else that you might think of.

@Maximus5
Copy link
Owner

That's really strange.
Please try to update to latest alpha build.

@Maximus5 Maximus5 reopened this Jun 15, 2017
@lassevk
Copy link
Author

lassevk commented Jun 23, 2017

I've tried latest alpha, versioned 170622, it doesn't fix the problem. I'll keep trying different things.

@Maximus5
Copy link
Owner

Maximus5 commented Mar 3, 2019

Any updates on this? No messages for a long time. Did you give up?

@lassevk
Copy link
Author

lassevk commented Mar 4, 2019

I disabled it. I found no way to make it work so I will have to live with ansi codes not being supported by nested processes.

@Maximus5
Copy link
Owner

Maximus5 commented Mar 4, 2019

Nowadays correct way to run msys/cygwin is the connector. That you have both ANSI and no affection of heavy msys/cygwin forking.

@Maximus5 Maximus5 closed this as completed Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants