Skip to content

sh Stack Overflow when pushing subtree. (2.38.1 works 2.39.1 does not) #4267

Open
@josh08287

Description

@josh08287
  • [x ] I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

**
WORKING VERSION 
$ git --version --build-options
git version 2.38.1.windows.1
cpu: x86_64
built from commit: b85c8f604d375d4d773a36842964e8a7ec056aae
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon 

NOT WORKING VERSION
$ git --version --build-options
git version 2.39.1.windows.1
cpu: x86_64
built from commit: b03dafd9c26b06c92d509a07ab01b01e6d0d85ee
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon

**
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

** Microsoft Windows [Version 10.0.19045.2486] **
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

** Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: WinSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Enabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled **
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

** we're using subtrees**

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

** mingw bash **

** git subtree push --prefix=<prefix> <repo> <branch> **
  • What did you expect to occur after running these commands?

** subtree split and push happens successfully **

  • What actually happened instead?

** sh process crashes with stackdump of:

Exception: STATUS_STACK_OVERFLOW at rip=7FFFA5EDC2B3
rax=0000CCEBCBC31338 rbx=00000000FFE054A0 rcx=0000000000000340
rdx=0000000000000000 rsi=00000000FFE04920 rdi=0000000000000000
r8 =000000021023EEA0 r9 =00000000FFE047B8 r10=0000000000000000
r11=0000000000000246 r12=00000000FFE04910 r13=0000000000000000
r14=000000021023EEA0 r15=0000000000000000
rbp=00000000FFE03E00 rsp=00000000FFE03D00
program=C:\Program Files\Git\usr\bin\sh.exe, pid 1103, thread 
cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame        Function    Args
000FFE03E00  7FFFA5EDC2B3 (000FFE054A0, 00000000000, 00000000000, 00000000000)
000FFE04560  7FFFA5EDB496 (1D90EF56088401F, 00000000000, 00000000001, 000FFE048A8)
000FFE04950  7FFFA5EDBD87 (00000000008, 00000000046, 7FFFA72EB238, 00000000000)
000FFE054C0  7FFFA5892993 (00000000420, 00000000420, 000007A1670, 000FFE05E90)
00000000420  7FFFA4CA9215 (000FFE06D90, 000000002B8, 002100D0000, 00800018190)
00000000420  7FFFA4CA73C6 (002100577DE, 0021023EEA0, 000FFE06F58, 00000000001)
00000000420  7FFFA587D374 (000FFE07270, 000FFE07280, 00000000000, 00000000001)
00000000420  002100D3A1F (000FFE06FB0, 00000000000, 00000000000, 00000000000)
001004F84B7  002100D4638 (008000E8E50, 008000E8E50, 00000000008, 000FFE07270)
001004F84B7  002100D496A (000FFE07328, 000FFE07514, 00000000008, 000000E8E50)
001004F84B7  00210199A7B (000FFE07328, 000FFE07514, 00000000008, 000000E8E50)
001004F84B7  00000BFE458 (000FFE07514, 00000000008, 000000E8E50, 008000E8E50)
001004F84B7  00800069700 (00000000008, 000000E8E50, 008000E8E50, 00000084002)
001004F84B7  000FFE07328 (000000E8E50, 008000E8E50, 00000084002, 00000000000)
001004F84B7  000FFE07514 (008000E8E50, 00000084002, 00000000000, 00000004000)
001004F84B7  00000000008 (00000084002, 00000000000, 00000004000, 00100479620)
001004F84B7  000000E8E50 (00000000000, 00000004000, 00100479620, 00000000001)
001004F84B7  008000E8E50 (00000004000, 00100479620, 00000000001, 00000000008)
001004F84B7  00000084002 (00000004000, 00100479620, 00000000001, 00000000008)
End of stack trace

**

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

** private repos**

It actually looks like it's the bundled sh.exe that is having a stack overflow due to the subtree split script. Is it possible to build the sh.exe with a larger stack size or fix the subtree script such that it isn't as recursvie? Our repo is only ~3000 commits with about 188 of those being split into the subtree repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions