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

git-fast-import segfaults

From
Ccpettitt <cpettitt@gmail.com>
Date
Oct 26, 2007, 00:29 UTC
Message-ID
<de47e4420710251729j5858481cg69146385a2ed798d@mail.gmail.com>
In-Reply-To
<de47e4420710251726nb45a19fk15b3105b735a74f8@mail.gmail.com>

I'm seeing the following errors when I run git-fast-import (on Intel OSX) with some data from a git-p4 import:

[cpettitt@gish scratch2]$ rm -rf .git; git init; git-fast-import < ~/writer.out Initialized empty Git repository in .git/ git-fast-import(23021) malloc: *** error for object 0x500e50: double free git-fast-import(23021) malloc: *** set a breakpoint in szone_error to debug git-fast-import(23021) malloc: *** Deallocation of a pointer not malloced: 0x501a80; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug git-fast-import(23021) malloc: *** error for object 0x5020a0: double free git-fast-import(23021) malloc: *** set a breakpoint in szone_error to debug git-fast-import(23021) malloc: *** Deallocation of a pointer not malloced: 0x5007e0; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug git-fast-import(23021) malloc: *** Deallocation of a pointer not malloced: 0x5006e0; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug git-fast-import(23021) malloc: *** Deallocation of a pointer not malloced: 0x501e10; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug git-fast-import(23021) malloc: *** Deallocation of a pointer not malloced: 0x502190; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug git-fast-import(23021) malloc: *** error for object 0x500280: double free git-fast-import(23021) malloc: *** set a breakpoint in szone_error to debug git-fast-import(23021) malloc: *** Deallocation of a pointer not malloced: 0x5009c0; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug git-fast-import(23021) malloc: *** error for object 0x500b00: incorrect checksum for freed object - object was probably modified after being freed, break at szone_error to debug git-fast-import(23021) malloc: *** set a breakpoint in szone_error to debug Segmentation fault

I start getting free errors at fast-import.c:1577:
                        rc = rc_free;
                        if (rc)
                                rc_free = rc->next;
                         else {
                                rc = cmd_hist.next;
                                cmd_hist.next = rc->next;
                                cmd_hist.next->prev = &cmd_hist;
                                free(rc->buf); // <-- error is emitted
in free here
                        }

I believe these errors started showing up in commit b449f4cfc972929b638b90d375b8960c37790618. I did a bisect on fast-import.c and this was the first commit for that file that exhibits this bug with the input.

I thought I would check with the list to see if this is a known issue before I spend time trying to dig into it.

Next: Shawn O. Pearce
Message 1 of 7 in “git-fast-import segfaults”
  1. cpettittOct 26, 2007
  2. Shawn O. PearceOct 26, 2007
  3. Fix regression in fast-import.c due to strbufs.Pierre Habouzit, Oct 26, 2007
  4. cpettittOct 26, 2007
  5. Pierre HabouzitOct 26, 2007
  6. Shun Kei LeungOct 29, 2007
  7. Pierre HabouzitOct 29, 2007

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.