Re: Error in `git': free(): invalid pointer (was Re: [PATCH] sequencer: improve config handling)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Kaartic,

On Thu, 21 Dec 2017, Kaartic Sivaraam wrote:

> I recently encountered that error when trying to do an interactive
> rebase after using filter-branch to remove a file completely in a
> repository. I bisected this issue which pointed at this patch. I'm not
> sure how it is related as I'm not too familiar with the sequencer code.
> I could help in case any specific information is needed. As a first
> step, I've posted the output of "strace /mnt/Source//Git/git rebase -i
> HEAD~10" below.

I fear that the strace does not cover the `git-rebase` process nor the
`git-rebase--helper` process (which must have been part of your run, as
the commit affected only that part of the rebase operation).

If you have valgrind installed, you may want to give it a try. Since
git-rebase is (still, much to my dislike) a Unix shell script, you will
have to work quite hard to get it to valgrind correctly.

This is how I typically do it: I edit the
/home/unique/.local/libexec/git-core/git-rebase file directly (it is in a
different path for me, of course), first adding a `set -x` as 2nd or 3rd
line (not the 1st, to avoid messing with Git for Windows' shell script
detection that requires a shebang, and I do that also on other platforms
to spare some brain cycles), then treat git-rebase--interactive
identically, then run the offending command to figure out which call
really fails.

Then, I look for that call (I imagine it is the `exec git rebase--helper
${force_rebase:+--no-ff} --continue` line), then copy-edit it and guard it
by an environment variable:

	test -z "$DDDD" || {
		valgrind git rebase--helper ${force_rebase:+--no-ff} \
			--continue
		exit
	}
	exec git rebase--helper ${force_rebase:+--no-ff} --continue

After that, you can run the same command, and trigger the new code path by
that environment variable:

	DDDD=1 /mnt/Source/Git/git rebase -i HEAD~10

That way, you can keep the rest of your Git calls be unaffected by the
patch.

BTW from your invocation, I imagine that you wanted to actually run your
Git just-built-from-source, in-place. But for that, you would need to pass
the --exec-path option, too, like so:

	DDDD=1 /mnt/Source/Git/git --exec-path=/mnt/Source/Git \
		rebase -i HEAD~10

That way, you could edit the git-rebase--interactive file that is *not*
installed, and avoid affecting other Git operations (you would also not
need to guard the new code path behind a conditional).

Ciao,
Dscho



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux