Skip to content

pr-453/dscho/fix-curl-xmalloc-regression-v2

This is one of those bugs that can cost entire days of work.

The symptom of this bug is that git -c http.extraheader push ... will fail
frequently in Git for Windows v2.24.0, but not always. When it fails,
though, it will cause a segmentation fault in git remote-https while calling
http_cleanup() and leave no visual indication of that problem, the only
indication of a problem will be the exit code of the caller (in this
instance, git push will fail with exit code 1).

In my tests during the pre-release period, I pushed many a time, it probably
failed a lot, in the way indicated above, and due to the absence of any
error message, I failed to realize that there was a problem in the first
place.

Fun side note: this bug haunted me for the best part of this past Monday,
when I tried to get Git for Windows v2.24.0 out the door. Large parts of Git
for Windows' release management are scripted, and that script failed,
claiming to have been unsuccessful in pushing the tag v2.24.0.windows.1,
just after printing a message to the extent that the tag is already up to
date (except in the first attempt, when it reported to have been successful
in pushing the tag). My attempts to fix the release script were doomed to
fail because the root cause was not a bug in the script, but the bug fixed
in this patch.

Changes since v1:

 * The patch was completely redone: instead of moving the call to
   curl_global_init() (which would have broken support for http.sslbackend),
   this iteration instead replaces the usage of cURL's slist in the config
   handling by using Git's own string_list.

Johannes Schindelin (1):
  remote-curl: unbreak http.extraHeader with custom allocators

 http.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

base-commit: 93b980e58f5624ee4e3b2dc0d0babaa97ef66d19

Submitted-As: https://public-inbox.org/git/pull.453.v2.git.1573034695.gitgitgadget@gmail.com
In-Reply-To: https://public-inbox.org/git/pull.453.git.1572991158.gitgitgadget@gmail.com
Assets 2