Web lists-archives.com

Re: Puzzling Git backtrace




On Wed, Mar 27, 2019 at 05:49:27PM -0700, Bryan Turner wrote:

> I'm trying to assist a Bitbucket Server customer who is seeing some
> "git-upload-pack" processes "hang" on their server.
> 
> While investigating, we had them connect gdb to their processes (which
> are 2.10.0 built from source using a simple unzip-and-run-make
> approach) and get the backtraces for them. The output that they're
> seeing makes no sense to me, though, so I'm throwing this out to the
> list just to see if anyone has any idea how the processes could end up
> like this.

upload-pack didn't become a builtin until v2.18, so...

> When they attached to 32433 and printed its backtrace, though, things
> go a little sideways:
> 
> (gdb) attach 32433
> Attaching to program: /usr/bin/git, process 32433

The debugger needs to be using git-upload-pack as its executable, not
"git".

> (gdb) bt
> #0  0x00007f79d1aca240 in ?? ()
> #1  0x000000000045179e in mktree_line (allow_missing=4,
> nul_term_line=0, len=<optimized out>, buf=<optimized out>) at
> builtin/mktree.c:103
> #2  cmd_mktree (ac=<optimized out>, av=<optimized out>,
> prefix=<optimized out>) at builtin/mktree.c:173
> #3  0x0000000000000000 in ?? ()

And all of this is just trash, because it's matching the core with the
wrong binary.

I'm sure there's a way to switch binaries within gdb, but I don't know
it offhand. I'd just start a new gdb like:

  gdb git-upload-pack 32433

-Peff