{"thread":{"id":"62957","subject":"free(): invalid pointer, error: git died of signal 6 and error: git died of signal 11","startedAt":"2025-02-15T02:09:54Z","lastAt":"2025-02-20T00:07:55Z","messageCount":4,"participants":["Christoph Anton Mitterer","Christian Couder","René Scharfe"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"512456","messageId":"1480fc360e9afd4e2d381e1506624df058355ae6.camel@scientia.org","threadId":"62957","inReplyTo":null,"subject":"free(): invalid pointer, error: git died of signal 6 and error: git died of signal 11","fromName":"Christoph Anton Mitterer","fromEmail":"calestyo@scientia.org","sentAt":"2025-02-15T02:09:45Z","receivedAt":"2025-02-15T02:09:54Z","isPatch":false,"sender":{"key":"calestyo@scientia.org","avatar":"https://gravatar.com/avatar/2dd3cd5191e4ec4a5e1e0a0861a64378636270f4007bab080a27b27a607bb267?d=mp&s=160"},"body":"Hey.\n\nI see some weird segfaults on a fresh repo.\nIt has just one commit with license files, then branch from master in\nwhich I have a staged an initial skeleton program.\n\nFrom there when I do a\n  git dt\n(which is an alias `dt = difftool --dir-diff`) I get most of the time:\n\n$ git dt\nerror: git died of signal 11\n\nwith kernel log:\nFeb 15 02:52:43 heisenberg kernel: git[633078]: segfault at 557a50000000 ip 00007faddc054435 sp 00007ffcd3acc600 error 4 in libc.so.6[a2435,7faddbfda000+165000] likely on CPU 0 (core 0, socket 0)\nFeb 15 02:52:43 heisenberg kernel: Code: 56 14 00 a8 04 74 26 48 8b 15 97 4d 14 00 48 8d 04 95 00 00 00 00 48 f7 d8 48 85 d2 48 c7 c2 00 00 00 fc 48 0f 44 c2 48 21 f0 <48> 8b 38 31 d2 e8 a1 d5 ff ff 64 89 2b 48 83 c4 18 5b 5d c3 0f 1f\n\nand when creating a core dump of that and looking at it with gdb:\n$ gdb /usr/lib/git-core/git core.633078 \nGNU gdb (Debian 16.2-1) 16.2\nCopyright (C) 2024 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\nType \"show copying\" and \"show warranty\" for details.\nThis GDB was configured as \"x86_64-linux-gnu\".\nType \"show configuration\" for configuration details.\nFor bug reporting instructions, please see:\n<https://www.gnu.org/software/gdb/bugs/>.\nFind the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>.\n\nFor help, type \"help\".\nType \"apropos word\" to search for commands related to \"word\"...\nReading symbols from /usr/lib/git-core/git...\nReading symbols from /usr/lib/debug/.build-id/21/a30636041d46556cf064a7ea3e3a744c89bee2.debug...\n[New LWP 633078]\n[Thread debugging using libthread_db enabled]\nUsing host libthread_db library \"/lib/x86_64-linux-gnu/libthread_db.so.1\".\nCore was generated by `/usr/lib/git-core/git difftool --dir-diff'.\nProgram terminated with signal SIGSEGV, Segmentation fault.\n#0  0x00007faddc054435 in arena_for_chunk (ptr=0x557a509f69cc) at ./malloc/arena.c:153\n\nwarning: 153\t./malloc/arena.c: No such file or directory\n(gdb) bt\n#0  0x00007faddc054435 in arena_for_chunk (ptr=0x557a509f69cc) at ./malloc/arena.c:153\n#1  arena_for_chunk (ptr=0x557a509f69cc) at ./malloc/arena.c:151\n#2  __GI___libc_free (mem=<optimized out>) at ./malloc/malloc.c:3397\n#3  0x0000557a508a5e9b in free_individual_entries (map=map@entry=0x7ffcd3acc920, entry_offset=0) at ./hashmap.c:188\n#4  0x0000557a508a61c8 in hashmap_clear_ (map=map@entry=0x7ffcd3acc920, entry_offset=entry_offset@entry=0) at ./hashmap.c:207\n#5  0x0000557a5076161b in run_dir_diff (extcmd=0x0, symlinks=1, prefix=<optimized out>, child=0x7ffcd3acc980) at builtin/difftool.c:666\n#6  cmd_difftool (argc=<optimized out>, argv=<optimized out>, prefix=<optimized out>, repo=<optimized out>) at builtin/difftool.c:801\n#7  0x0000557a50724593 in run_builtin (p=0x557a50acdb50 <commands+912>, argc=2, argv=0x7ffcd3acd630, repo=0x557a50affec0 <the_repo>) at ./git.c:483\n#8  handle_builtin (argc=2, argv=0x7ffcd3acd630) at ./git.c:749\n#9  0x0000557a50725515 in run_argv (argcp=argcp@entry=0x7ffcd3acd40c, argv=argv@entry=0x7ffcd3acd400) at ./git.c:819\n#10 0x0000557a50726088 in cmd_main (argc=<optimized out>, argc@entry=3, argv=<optimized out>, argv@entry=0x7ffcd3acd628) at ./git.c:954\n#11 0x0000557a50724209 in main (argc=3, argv=0x7ffcd3acd628) at ./common-main.c:64\n(gdb) \n\n\n\nOnce I also got:\n$ git dt\nfree(): invalid pointer\nerror: git died of signal 6\n\nwith no kernel message and I think the following was the corresponding\ncore dump:\n$ gdb /usr/lib/git-core/git core.633069 \nGNU gdb (Debian 16.2-1) 16.2\nCopyright (C) 2024 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\nType \"show copying\" and \"show warranty\" for details.\nThis GDB was configured as \"x86_64-linux-gnu\".\nType \"show configuration\" for configuration details.\nFor bug reporting instructions, please see:\n<https://www.gnu.org/software/gdb/bugs/>.\nFind the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>.\n\nFor help, type \"help\".\nType \"apropos word\" to search for commands related to \"word\"...\nReading symbols from /usr/lib/git-core/git...\nReading symbols from /usr/lib/debug/.build-id/21/a30636041d46556cf064a7ea3e3a744c89bee2.debug...\n[New LWP 633069]\n[Thread debugging using libthread_db enabled]\nUsing host libthread_db library \"/lib/x86_64-linux-gnu/libthread_db.so.1\".\nCore was generated by `/usr/lib/git-core/git difftool --dir-diff'.\nProgram terminated with signal SIGABRT, Aborted.\n#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44\n\nwarning: 44\t./nptl/pthread_kill.c: No such file or directory\n(gdb) bt\n#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44\n#1  0x00007fb22ef18e2f in __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:78\n#2  0x00007fb22eec4d02 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26\n#3  0x00007fb22eead4f0 in __GI_abort () at ./stdlib/abort.c:79\n#4  0x00007fb22eeae32d in __libc_message_impl (fmt=fmt@entry=0x7fb22f030303 \"%s\\n\") at ../sysdeps/posix/libc_fatal.c:134\n#5  0x00007fb22ef22965 in malloc_printerr (str=str@entry=0x7fb22f02e082 \"free(): invalid pointer\") at ./malloc/malloc.c:5772\n#6  0x00007fb22ef24bf4 in _int_free (av=0x34fbb8158b0200, p=<optimized out>, have_lock=have_lock@entry=0) at ./malloc/malloc.c:4507\n#7  0x00007fb22ef2743f in __GI___libc_free (mem=<optimized out>) at ./malloc/malloc.c:3398\n#8  0x000055b4e4106e9b in free_individual_entries (map=map@entry=0x7ffee0e35a30, entry_offset=0) at ./hashmap.c:188\n#9  0x000055b4e41071c8 in hashmap_clear_ (map=map@entry=0x7ffee0e35a30, entry_offset=entry_offset@entry=0) at ./hashmap.c:207\n#10 0x000055b4e3fc261b in run_dir_diff (extcmd=0x0, symlinks=1, prefix=<optimized out>, child=0x7ffee0e35a90) at builtin/difftool.c:666\n#11 cmd_difftool (argc=<optimized out>, argv=<optimized out>, prefix=<optimized out>, repo=<optimized out>) at builtin/difftool.c:801\n#12 0x000055b4e3f85593 in run_builtin (p=0x55b4e432eb50 <commands+912>, argc=2, argv=0x7ffee0e36740, repo=0x55b4e4360ec0 <the_repo>) at ./git.c:483\n#13 handle_builtin (argc=2, argv=0x7ffee0e36740) at ./git.c:749\n#14 0x000055b4e3f86515 in run_argv (argcp=argcp@entry=0x7ffee0e3651c, argv=argv@entry=0x7ffee0e36510) at ./git.c:819\n#15 0x000055b4e3f87088 in cmd_main (argc=<optimized out>, argc@entry=3, argv=<optimized out>, argv@entry=0x7ffee0e36738) at ./git.c:954\n#16 0x000055b4e3f85209 in main (argc=3, argv=0x7ffee0e36738) at ./common-main.c:64\n(gdb) \n\n\nThe same happens also on a fresh and empty repo:\n$ git init foo; cd foo\n$ gdb --args git difftool --dir-diff\nGNU gdb (Debian 16.2-1) 16.2\nCopyright (C) 2024 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\nType \"show copying\" and \"show warranty\" for details.\nThis GDB was configured as \"x86_64-linux-gnu\".\nType \"show configuration\" for configuration details.\nFor bug reporting instructions, please see:\n<https://www.gnu.org/software/gdb/bugs/>.\nFind the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>.\n\nFor help, type \"help\".\nType \"apropos word\" to search for commands related to \"word\"...\nReading symbols from git...\nReading symbols from /usr/lib/debug/.build-id/21/a30636041d46556cf064a7ea3e3a744c89bee2.debug...\n(gdb) run\nStarting program: /usr/bin/git difftool --dir-diff\n[Thread debugging using libthread_db enabled]\nUsing host libthread_db library \"/lib/x86_64-linux-gnu/libthread_db.so.1\".\n[Detaching after fork from child process 635588]\n\nProgram received signal SIGSEGV, Segmentation fault.\n0x00007ffff7d7c435 in arena_for_chunk (ptr=0x5555558489cc) at ./malloc/arena.c:153\nwarning: 153\t./malloc/arena.c: No such file or directory\n(gdb) bt\n#0  0x00007ffff7d7c435 in arena_for_chunk (ptr=0x5555558489cc) at ./malloc/arena.c:153\n#1  arena_for_chunk (ptr=0x5555558489cc) at ./malloc/arena.c:151\n#2  __GI___libc_free (mem=<optimized out>) at ./malloc/malloc.c:3397\n#3  0x00005555556f7e9b in free_individual_entries (map=map@entry=0x7fffffffd220, entry_offset=0) at ./hashmap.c:188\n#4  0x00005555556f81c8 in hashmap_clear_ (map=map@entry=0x7fffffffd220, entry_offset=entry_offset@entry=0) at ./hashmap.c:207\n#5  0x00005555555b361b in run_dir_diff (extcmd=0x0, symlinks=1, prefix=<optimized out>, child=0x7fffffffd280) at builtin/difftool.c:666\n#6  cmd_difftool (argc=<optimized out>, argv=<optimized out>, prefix=<optimized out>, repo=<optimized out>) at builtin/difftool.c:801\n#7  0x0000555555576593 in run_builtin (p=0x55555591fb50 <commands+912>, argc=2, argv=0x7fffffffdf30, repo=0x555555951ec0 <the_repo>) at ./git.c:483\n#8  handle_builtin (argc=2, argv=0x7fffffffdf30) at ./git.c:749\n#9  0x0000555555577515 in run_argv (argcp=argcp@entry=0x7fffffffdd0c, argv=argv@entry=0x7fffffffdd00) at ./git.c:819\n#10 0x0000555555578088 in cmd_main (argc=<optimized out>, argc@entry=3, argv=<optimized out>, argv@entry=0x7fffffffdf28) at ./git.c:954\n#11 0x0000555555576209 in main (argc=3, argv=0x7fffffffdf28) at ./common-main.c:64\n(gdb) quit\nA debugging session is active.\n\n\tInferior 1 [process 635585] will be killed.\n\nQuit anyway? (y or n) quit\nEOF [assumed Y]\ncalestyo@heisenberg:~/xx/foo$ l\ntotal 0\ndrwxr-xr-x 1 calestyo calestyo  8 Feb 15 02:58 .\ndrwxr-xr-x 1 calestyo calestyo 12 Feb 15 02:59 ..\ndrwxr-xr-x 1 calestyo calestyo 98 Feb 15 02:58 .git\ncalestyo@heisenberg:~/xx/foo$ \ncalestyo@heisenberg:~/xx/foo$ \ncalestyo@heisenberg:~/xx/foo$ \ncalestyo@heisenberg:~/xx/foo$ \ncalestyo@heisenberg:~/xx/foo$ \ncalestyo@heisenberg:~/xx/foo$ \ncalestyo@heisenberg:~/xx/foo$ gdb --args git difftool --dir-diff\nGNU gdb (Debian 16.2-1) 16.2\nCopyright (C) 2024 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\nType \"show copying\" and \"show warranty\" for details.\nThis GDB was configured as \"x86_64-linux-gnu\".\nType \"show configuration\" for configuration details.\nFor bug reporting instructions, please see:\n<https://www.gnu.org/software/gdb/bugs/>.\nFind the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>.\n\nFor help, type \"help\".\nType \"apropos word\" to search for commands related to \"word\"...\nReading symbols from git...\nReading symbols from /usr/lib/debug/.build-id/21/a30636041d46556cf064a7ea3e3a744c89bee2.debug...\n(gdb) \n\nlooking slightly different, and I can directly get the backtrace\nwithout the coredump (presumably the alias handling get's otherwise in\nthe way with this?).\n\n\nThat's all on Debian unstable, with their git package 1:2.47.2-0.1.\n\n\nCheers,\nChris.\n"},{"id":"512459","messageId":"CAP8UFD0aZ-Ea96n1Tk9i2dS6ECoCFpyW_FQUVOP8Z2z8_=xXwA@mail.gmail.com","threadId":"62957","inReplyTo":"1480fc360e9afd4e2d381e1506624df058355ae6.camel@scientia.org","subject":"Re: free(): invalid pointer, error: git died of signal 6 and error: git died of signal 11","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2025-02-15T13:04:37Z","receivedAt":"2025-02-15T13:04:51Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Hi,\n\nOn Sat, Feb 15, 2025 at 3:10 AM Christoph Anton Mitterer\n<calestyo@scientia.org> wrote:\n>\n> Hey.\n>\n> I see some weird segfaults on a fresh repo.\n> It has just one commit with license files, then branch from master in\n> which I have a staged an initial skeleton program.\n>\n> From there when I do a\n>   git dt\n> (which is an alias `dt = difftool --dir-diff`) I get most of the time:\n>\n> $ git dt\n> error: git died of signal 11\n\n[...]\n\n> The same happens also on a fresh and empty repo:\n\n[...]\n\n> That's all on Debian unstable, with their git package 1:2.47.2-0.1.\n\nThanks for your report!\n\nThis might have been fixed by commit 98e4015593 (builtin/difftool:\nintialize some hashmap variables, 2024-11-12) that is part of v2.48.0\nand v2.48.1. So you might want to upgrade or maybe patch your version.\nLet us know if that fixes the issue.\n\nBest,\nChristian.\n"},{"id":"512460","messageId":"574a777e-8dc2-4bad-8248-8dee97215d40@web.de","threadId":"62957","inReplyTo":"1480fc360e9afd4e2d381e1506624df058355ae6.camel@scientia.org","subject":"Re: free(): invalid pointer, error: git died of signal 6 and error: git died of signal 11","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2025-02-15T13:58:06Z","receivedAt":"2025-02-15T13:58:54Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 15.02.25 um 03:09 schrieb Christoph Anton Mitterer:\n> Hey.\n>\n> I see some weird segfaults on a fresh repo.\n> It has just one commit with license files, then branch from master in\n> which I have a staged an initial skeleton program.\n>\n> From there when I do a\n>   git dt\n> (which is an alias `dt = difftool --dir-diff`) I get most of the time:\n>\n> $ git dt\n> error: git died of signal 11\n\nThis is a know bug fixed by 98e4015593 (builtin/difftool: intialize some\nhashmap variables, 2024-11-12), included in v2.48.0.\n\nRené\n\n"},{"id":"512751","messageId":"70b4a0b71bb6a68c0ef53dc776349927b6fd6799.camel@scientia.org","threadId":"62957","inReplyTo":"CAP8UFD0aZ-Ea96n1Tk9i2dS6ECoCFpyW_FQUVOP8Z2z8_=xXwA@mail.gmail.com","subject":"Re: free(): invalid pointer, error: git died of signal 6 and error: git died of signal 11","fromName":"Christoph Anton Mitterer","fromEmail":"calestyo@scientia.org","sentAt":"2025-02-20T00:07:50Z","receivedAt":"2025-02-20T00:07:55Z","isPatch":false,"sender":{"key":"calestyo@scientia.org","avatar":"https://gravatar.com/avatar/2dd3cd5191e4ec4a5e1e0a0861a64378636270f4007bab080a27b27a607bb267?d=mp&s=160"},"body":"Hey Christian, René.\n\nIndeed, testing 1:2.48.0~rc1+next.20250101-1 from experimental, and the\nissue doesn't show up anymore :-)\n\nThanks,\nChris.\n"}]}