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

Re: git-fast-import crashes

From
Pierre Habouzit <madcoder@debian.org>
Date
Oct 16, 2007, 07:46 UTC
Message-ID
<20071016074645.GA6919@artemis.corp>
In-Reply-To
<e66701d40710160013h270f685sef57f80382089f3c@mail.gmail.com>
On Tue, Oct 16, 2007 at 07:13:31AM +0000, Shun Kei Leung wrote:
> Hi Pierre,
> 
> I have tested with your patch applied, and it still crashed badly.
  okay
> I compiled the b449f4c version and I got a different backtrace from
> GDB. I am still not sure about how the error occurs. I attached the
> memory usage from various command line tools.
  I believe you should rather test master as any of the strbuf stages is
broken for you, and that there has been some issues with strbuf fixed
lately (not only the patch I asked you to try, but also an issue with
empty strubufs, and you _need_ that patch).
Show 31 quoted lines
> GDB output
> ===========
> 
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_INVALID_ADDRESS at address: 0x756c7463
> 0x90018d0c in szone_realloc ()
> (gdb) bt
> #0  0x90018d0c in szone_realloc ()
> #1  0x90018898 in realloc ()
> #2  0x0001f8c8 in strbuf_grow (sb=0x75ef8, extra=0) at git-compat-util.h:223
> #3  0x0001fc14 in read_line (sb=0x75ef8, fp=0xa0001b9c, term=10) at strbuf.c:107
> #4  0x00002da8 in read_next_command () at fast-import.c:1599
> #5  0x0000742c in cmd_new_commit () at fast-import.c:2118
> #6  0x00007e80 in main (argc=1, argv=0xbffff828) at fast-import.c:2390
> (gdb) frame 3
> #3  0x0001fc14 in read_line (sb=0x75ef8, fp=0xa0001b9c, term=10) at strbuf.c:107
> 107                     strbuf_grow(sb, 1);
> (gdb) print *sb
> $1 = {
>   alloc = 60,
>   len = 23,
>   eof = 0,
>   buf = 0x5020b0 "D windows/packages/cdc/ces/adm"
> }
> (gdb) frame 2
> #2  0x0001f8c8 in strbuf_grow (sb=0x75ef8, extra=0) at git-compat-util.h:223
> 223             void *ret = realloc(ptr, size);
> (gdb) print (char *) ptr
> $2 = 0x5020b0 "D windows/packages/cdc/ces/adm"
> (gdb) print (char *)ret
> $3 = 0xd <Address 0xd out of bounds>
  This does not make sense, ptr should be either valid or NULL.
Show 13 quoted lines
> The output of `leaks'
> =================
> 
> Process 27075: 88 nodes malloced for 2335 KB
> Process 27075: 6 leaks for 624 total leaked bytes.
> Leak: 0x005012b0  size=208      string 'EOT'
> Leak: 0x00501e60  size=128      string 'EOT'
> Leak: 0x00501c80  size=128      string 'EOT'
> Leak: 0x00500f10  size=64       string 'EOT'
> Leak: 0x00501fa0  size=64       string 'EOT'
> Leak: 0x00501f60  size=32
>         0x00000000 0x02008000 0x00000000 0x01000000     ................
>         0x02000000 0x0000001a 0x00000000 0x00000000     ................
  What I _really_ need is that you run your test into valgrind (the easy
way is to rename git-fast-import into git-fast-import.bin, and make
git-fast-import be a shell-script doing:
  exec valgrind --log-file /tmp/git-fast-import git-fast-import "$@"
  and please send to me the /tmp/git-fast-import.<pid> from the one that
crashes.
  And please do that on the most recent tip of master so that you have a
(at least believe to be) full and sane strbuf series. Thanks.
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: Shun Kei LeungNext: Shun Kei Leung
Message 10 of 13 in “git-fast-import crashes”
  1. Shun Kei LeungOct 12, 2007
  2. Shawn O. PearceOct 13, 2007
  3. Shawn O. PearceOct 13, 2007
  4. Pierre HabouzitOct 13, 2007
  5. Pierre HabouzitOct 13, 2007
  6. Shun Kei LeungOct 15, 2007
  7. Pierre HabouzitOct 15, 2007
  8. Shun Kei LeungOct 15, 2007
  9. Shun Kei LeungOct 16, 2007
  10. Pierre HabouzitOct 16, 2007
  11. Shun Kei LeungOct 16, 2007
  12. Pierre HabouzitOct 16, 2007
  13. Johannes SchindelinOct 13, 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.