git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Crash on MSYS2 with GIT_WORK_TREE

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 7, 2017, 23:03 UTC
Message-ID
<alpine.DEB.2.20.1703072345530.3767@virtualbox>
In-Reply-To
<CAFKRc7y_kpCGNORENUZ2qw_4qBwjjyaaDFxAEQa52fTryj+w7A@mail.gmail.com>
Hi valtron,
On Tue, 7 Mar 2017, valtron wrote:
> Git 1.12.0.

I take it you meant 2.12.0. And you probably also meant to imply that you are referring to MSYS2's git.exe in /usr/bin/.

Show 7 quoted lines
> When GIT_WORK_TREE contains a drive-letter and forward-slashes, some git
> commands crash:
> 
> C:\repo>set GIT_WORK_TREE=C:/repo
> C:\repo>git rev-parse HEAD
>      1 [main] git 2332 cygwin_exception::open_stackdumpfile: Dumping
> stack trace to git.exe.stackdump

This suggests that my assumption above is correct: it looks as if you are executing <MSYS2>\usr\bin\git.exe here.

The proof lies in the pudding, though, and you are the only person who can do that unless you post the contents of that git.exe.stackdump.

Show 21 quoted lines
> Stacktrace from GDB (on git-rev-parse) is:
> 
> #0  0x000000018019634d in strcmp (s1=0x600062080 "/c/repo", s2=0x0)
>    at /msys_scripts/msys2-runtime/src/msys2-runtime/newlib/libc/string/strcmp.c:83
> #1  0x00000001005239f1 in ?? ()
> #2  0x0000000100523f36 in ?? ()
> #3  0x000000010046c6fa in ?? ()
> #4  0x0000000100401b6d in ?? ()
> #5  0x0000000100401e4b in ?? ()
> #6  0x0000000100563593 in ?? ()
> #7  0x0000000180047c37 in _cygwin_exit_return ()
>    at /msys_scripts/msys2-runtime/src/msys2-runtime/winsup/cygwin/dcrt0.cc:1031
> #8  0x0000000180045873 in _cygtls::call2 (this=0xffffce00,
> func=0x180046bd0 <dll_crt0_1(void*)>, arg=0x0,
>    buf=buf@entry=0xffffcdf0) at
> /msys_scripts/msys2-runtime/src/msys2-runtime/winsup/cygwin/cygtls.cc:40
> #9  0x0000000180045924 in _cygtls::call (func=<optimized out>,
> arg=<optimized out>)
>    at /msys_scripts/msys2-runtime/src/msys2-runtime/winsup/cygwin/cygtls.cc:27
> #10 0x0000000000000000 in ?? ()
> Backtrace stopped: previous frame inner to this frame (corrupt stack?)

This may be the wrong thread, though. You can find out what other threads there are with `info threads` and switch by `thread <id>`, the backtrace(s) of the other thread(s) may be informative.

Please also note that installing the `msys2-runtime-devel` package via Pacman may be able to get you nicer symbols.

In any case, this problem is squarely within the MSYS2 runtime. It has nothing to do with Git except for the motivation to set an environment variable to an absolute path as you outlined.

Having said that, the problem also occurs when using *MSYS2* git.exe (i.e. /usr/bin/git.exe, not /mingw64/bin/git.exe) in the Git for Windows SDK.

Ciao, Johannes

Previous: valtronNext: Johannes Schindelin
Message 2 of 13 in “Crash on MSYS2 with GIT_WORK_TREE”
  1. valtronMar 7, 2017
  2. Johannes SchindelinMar 7, 2017
  3. Johannes SchindelinMar 8, 2017
  4. Johannes SchindelinMar 8, 2017
  5. valtronMar 8, 2017
  6. Johannes SchindelinMar 8, 2017
  7. Brandon WilliamsMar 8, 2017
  8. Johannes SchindelinMar 8, 2017
  9. Brandon WilliamsMar 8, 2017
  10. Junio C HamanoMar 8, 2017
  11. Junio C HamanoMar 8, 2017
  12. Johannes SchindelinMar 8, 2017
  13. Junio C HamanoMar 8, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.