{"thread":{"id":"12169","subject":"[Bug] Segfault in git status","startedAt":"2008-02-18T08:36:52Z","lastAt":"2008-02-21T17:19:21Z","messageCount":9,"participants":["Dane Jensen","Junio C Hamano","Jay Soffian","Pieter de Bie","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"69101","messageId":"F8D3F7F0-3A98-4576-BD89-6E5C682B351C@fastmail.fm","threadId":"12169","inReplyTo":null,"subject":"[Bug] Segfault in git status","fromName":"Dane Jensen","fromEmail":"careo@fastmail.fm","sentAt":"2008-02-18T08:36:52Z","receivedAt":"2008-02-18T08:36:52Z","isPatch":false,"sender":{"key":"careo@fastmail.fm","avatar":"https://gravatar.com/avatar/3ab94e7d309154bbc53ddcbffa3d689aabd08915e728fb9684c0bd337855fc1a?d=mp&s=160"},"body":"Hi all-\n\nSomehow I've managed to create a repository that causes git status to  \nsegfault. To be honest, I'm not entirely sure how just yet. This comes  \nafter a weekend of splitting a repository into two separate  \nrepositories, filtering out a directory from one, and then creating  \ngrafts in those repositories to skip commits that now change nothing.\n\nThis was in OS X 10.5.2 with git compiled from cf5c51e. Falling back  \nto 1.5.4.2 cleared it up, so with the help of git bisect I've narrowed  \nthe bug down to cf55870.\n\nI'll spend some time this week trying to find the exact point in my  \nfiltering that git status went south and report back if I can  \nreplicate it in a more-controlled test.\n\n-Dane\n"},{"id":"69221","messageId":"7vfxvpn3da.fsf@gitster.siamese.dyndns.org","threadId":"12169","inReplyTo":"F8D3F7F0-3A98-4576-BD89-6E5C682B351C@fastmail.fm","subject":"Re: [Bug] Segfault in git status","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-19T01:26:09Z","receivedAt":"2008-02-19T01:26:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dane Jensen <careo@fastmail.fm> writes:\n\n> This was in OS X 10.5.2 with git compiled from cf5c51e. Falling back\n> to 1.5.4.2 cleared it up, so with the help of git bisect I've narrowed\n> the bug down to cf55870.\n\nDo you have this issue only on OSX?  Do you have the issue on\nany commit, or a particular commit?\n\nWhat does the change between HEAD, index and the work tree\ninvolve in the commit that causes the problem?  Can you make\nrepository available to the public for diagnosis (if it is \"Only\non OSX\", I may not be able to help much with, but never hurt to\nask)?\n\nJust to double check, can you see if reverting the commit (and\nanother commit that immediately follows) fixes the issue for\nyou?\n\nA patch to do the revert for cf5c51e is attached.\n\n---\n\n cache.h      |    7 ---\n dir.c        |    2 +-\n read-cache.c |  118 +++++-----------------------------------------------------\n 3 files changed, 11 insertions(+), 116 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex e1000bc..fd7716c 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -3,7 +3,6 @@\n \n #include \"git-compat-util.h\"\n #include \"strbuf.h\"\n-#include \"hash.h\"\n \n #include SHA1_HEADER\n #include <zlib.h>\n@@ -110,7 +109,6 @@ struct ondisk_cache_entry {\n };\n \n struct cache_entry {\n-\tstruct cache_entry *next;\n \tunsigned int ce_ctime;\n \tunsigned int ce_mtime;\n \tunsigned int ce_dev;\n@@ -133,7 +131,6 @@ struct cache_entry {\n #define CE_UPDATE    (0x10000)\n #define CE_REMOVE    (0x20000)\n #define CE_UPTODATE  (0x40000)\n-#define CE_UNHASHED  (0x80000)\n \n static inline unsigned create_ce_flags(size_t len, unsigned stage)\n {\n@@ -203,8 +200,6 @@ struct index_state {\n \tstruct cache_tree *cache_tree;\n \ttime_t timestamp;\n \tvoid *alloc;\n-\tunsigned name_hash_initialized : 1;\n-\tstruct hash_table name_hash;\n };\n \n extern struct index_state the_index;\n@@ -228,7 +223,6 @@ extern struct index_state the_index;\n #define refresh_cache(flags) refresh_index(&the_index, (flags), NULL, NULL)\n #define ce_match_stat(ce, st, options) ie_match_stat(&the_index, (ce), (st), (options))\n #define ce_modified(ce, st, options) ie_modified(&the_index, (ce), (st), (options))\n-#define cache_name_exists(name, namelen) index_name_exists(&the_index, (name), (namelen))\n #endif\n \n enum object_type {\n@@ -315,7 +309,6 @@ extern int read_index_from(struct index_state *, const char *path);\n extern int write_index(struct index_state *, int newfd);\n extern int discard_index(struct index_state *);\n extern int verify_path(const char *path);\n-extern int index_name_exists(struct index_state *istate, const char *name, int namelen);\n extern int index_name_pos(struct index_state *, const char *name, int namelen);\n #define ADD_CACHE_OK_TO_ADD 1\t\t/* Ok to add */\n #define ADD_CACHE_OK_TO_REPLACE 2\t/* Ok to replace file/directory */\ndiff --git a/dir.c b/dir.c\nindex 1f507da..4d20871 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -371,7 +371,7 @@ static struct dir_entry *dir_entry_new(const char *pathname, int len)\n \n struct dir_entry *dir_add_name(struct dir_struct *dir, const char *pathname, int len)\n {\n-\tif (cache_name_exists(pathname, len))\n+\tif (cache_name_pos(pathname, len) >= 0)\n \t\treturn NULL;\n \n \tALLOC_GROW(dir->entries, dir->nr+1, dir->alloc);\ndiff --git a/read-cache.c b/read-cache.c\nindex e45f4b3..07abd5d 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -23,90 +23,6 @@\n \n struct index_state the_index;\n \n-static unsigned int hash_name(const char *name, int namelen)\n-{\n-\tunsigned int hash = 0x123;\n-\n-\tdo {\n-\t\tunsigned char c = *name++;\n-\t\thash = hash*101 + c;\n-\t} while (--namelen);\n-\treturn hash;\n-}\n-\n-static void hash_index_entry(struct index_state *istate, struct cache_entry *ce)\n-{\n-\tvoid **pos;\n-\tunsigned int hash = hash_name(ce->name, ce_namelen(ce));\n-\n-\tpos = insert_hash(hash, ce, &istate->name_hash);\n-\tif (pos) {\n-\t\tce->next = *pos;\n-\t\t*pos = ce;\n-\t}\n-}\n-\n-static void lazy_init_name_hash(struct index_state *istate)\n-{\n-\tint nr;\n-\n-\tif (istate->name_hash_initialized)\n-\t\treturn;\n-\tfor (nr = 0; nr < istate->cache_nr; nr++)\n-\t\thash_index_entry(istate, istate->cache[nr]);\n-\tistate->name_hash_initialized = 1;\n-}\n-\n-static void set_index_entry(struct index_state *istate, int nr, struct cache_entry *ce)\n-{\n-\tistate->cache[nr] = ce;\n-\tif (istate->name_hash_initialized)\n-\t\thash_index_entry(istate, ce);\n-}\n-\n-/*\n- * We don't actually *remove* it, we can just mark it invalid so that\n- * we won't find it in lookups.\n- *\n- * Not only would we have to search the lists (simple enough), but\n- * we'd also have to rehash other hash buckets in case this makes the\n- * hash bucket empty (common). So it's much better to just mark\n- * it.\n- */\n-static void remove_hash_entry(struct index_state *istate, struct cache_entry *ce)\n-{\n-\tce->ce_flags |= CE_UNHASHED;\n-}\n-\n-static void replace_index_entry(struct index_state *istate, int nr, struct cache_entry *ce)\n-{\n-\tstruct cache_entry *old = istate->cache[nr];\n-\n-\tif (ce != old) {\n-\t\tremove_hash_entry(istate, old);\n-\t\tset_index_entry(istate, nr, ce);\n-\t}\n-\tistate->cache_changed = 1;\n-}\n-\n-int index_name_exists(struct index_state *istate, const char *name, int namelen)\n-{\n-\tunsigned int hash = hash_name(name, namelen);\n-\tstruct cache_entry *ce;\n-\n-\tlazy_init_name_hash(istate);\n-\tce = lookup_hash(hash, &istate->name_hash);\n-\n-\twhile (ce) {\n-\t\tif (!(ce->ce_flags & CE_UNHASHED)) {\n-\t\t\tif (!cache_name_compare(name, namelen, ce->name, ce->ce_flags))\n-\t\t\t\treturn 1;\n-\t\t}\n-\t\tce = ce->next;\n-\t}\n-\treturn 0;\n-}\n-\n /*\n  * This only updates the \"non-critical\" parts of the directory\n  * cache, ie the parts that aren't tracked by GIT, and only used\n@@ -411,9 +327,6 @@ int index_name_pos(struct index_state *istate, const char *name, int namelen)\n /* Remove entry, return true if there are more entries to go.. */\n int remove_index_entry_at(struct index_state *istate, int pos)\n {\n-\tstruct cache_entry *ce = istate->cache[pos];\n-\n-\tremove_hash_entry(istate, ce);\n \tistate->cache_changed = 1;\n \tistate->cache_nr--;\n \tif (pos >= istate->cache_nr)\n@@ -789,7 +702,8 @@ static int add_index_entry_with_check(struct index_state *istate, struct cache_e\n \n \t/* existing match? Just replace it. */\n \tif (pos >= 0) {\n-\t\treplace_index_entry(istate, pos, ce);\n+\t\tistate->cache_changed = 1;\n+\t\tistate->cache[pos] = ce;\n \t\treturn 0;\n \t}\n \tpos = -pos-1;\n@@ -849,7 +763,7 @@ int add_index_entry(struct index_state *istate, struct cache_entry *ce, int opti\n \t\tmemmove(istate->cache + pos + 1,\n \t\t\tistate->cache + pos,\n \t\t\t(istate->cache_nr - pos - 1) * sizeof(ce));\n-\tset_index_entry(istate, pos, ce);\n+\tistate->cache[pos] = ce;\n \tistate->cache_changed = 1;\n \treturn 0;\n }\n@@ -978,8 +892,11 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p\n \t\t\thas_errors = 1;\n \t\t\tcontinue;\n \t\t}\n-\n-\t\treplace_index_entry(istate, i, new);\n+\t\tistate->cache_changed = 1;\n+\t\t/* You can NOT just free istate->cache[i] here, since it\n+\t\t * might not be necessarily malloc()ed but can also come\n+\t\t * from mmap(). */\n+\t\tistate->cache[i] = new;\n \t}\n \treturn has_errors;\n }\n@@ -1054,20 +971,6 @@ static void convert_from_disk(struct ondisk_cache_entry *ondisk, struct cache_en\n \tmemcpy(ce->name, ondisk->name, len + 1);\n }\n \n-static inline size_t estimate_cache_size(size_t ondisk_size, unsigned int entries)\n-{\n-\tlong per_entry;\n-\n-\tper_entry = sizeof(struct cache_entry) - sizeof(struct ondisk_cache_entry);\n-\n-\t/*\n-\t * Alignment can cause differences. This should be \"alignof\", but\n-\t * since that's a gcc'ism, just use the size of a pointer.\n-\t */\n-\tper_entry += sizeof(void *);\n-\treturn ondisk_size + entries*per_entry;\n-}\n-\n /* remember to discard_cache() before reading a different cache! */\n int read_index_from(struct index_state *istate, const char *path)\n {\n@@ -1118,7 +1021,7 @@ int read_index_from(struct index_state *istate, const char *path)\n \t * has room for a few  more flags, we can allocate using the same\n \t * index size\n \t */\n-\tistate->alloc = xmalloc(estimate_cache_size(mmap_size, istate->cache_nr));\n+\tistate->alloc = xmalloc(mmap_size);\n \n \tsrc_offset = sizeof(*hdr);\n \tdst_offset = 0;\n@@ -1129,7 +1032,7 @@ int read_index_from(struct index_state *istate, const char *path)\n \t\tdisk_ce = (struct ondisk_cache_entry *)((char *)mmap + src_offset);\n \t\tce = (struct cache_entry *)((char *)istate->alloc + dst_offset);\n \t\tconvert_from_disk(disk_ce, ce);\n-\t\tset_index_entry(istate, i, ce);\n+\t\tistate->cache[i] = ce;\n \n \t\tsrc_offset += ondisk_ce_size(ce);\n \t\tdst_offset += ce_size(ce);\n@@ -1167,7 +1070,6 @@ int discard_index(struct index_state *istate)\n \tistate->cache_nr = 0;\n \tistate->cache_changed = 0;\n \tistate->timestamp = 0;\n-\tfree_hash(&istate->name_hash);\n \tcache_tree_free(&(istate->cache_tree));\n \tfree(istate->alloc);\n \tistate->alloc = NULL;\n"},{"id":"69330","messageId":"746D851F-CE49-4867-BB0B-D09615463244@fastmail.fm","threadId":"12169","inReplyTo":"7vfxvpn3da.fsf@gitster.siamese.dyndns.org","subject":"Re: [Bug] Segfault in git status","fromName":"Dane Jensen","fromEmail":"careo@fastmail.fm","sentAt":"2008-02-19T23:18:51Z","receivedAt":"2008-02-19T23:18:51Z","isPatch":false,"sender":{"key":"careo@fastmail.fm","avatar":"https://gravatar.com/avatar/3ab94e7d309154bbc53ddcbffa3d689aabd08915e728fb9684c0bd337855fc1a?d=mp&s=160"},"body":"\nOn Feb 18, 2008, at 5:26 PM, Junio C Hamano wrote:\n\n> Dane Jensen <careo@fastmail.fm> writes:\n>\n>> This was in OS X 10.5.2 with git compiled from cf5c51e. Falling back\n>> to 1.5.4.2 cleared it up, so with the help of git bisect I've  \n>> narrowed\n>> the bug down to cf55870.\n>\n> Do you have this issue only on OSX?  Do you have the issue on\n> any commit, or a particular commit?\n\nIt's not with any particular commit. It occurs with a fresh clone or  \nat any other point, regardless of any changes I've made, what branch  \nI'm on, or anything else I could think of testing.\n\n> What does the change between HEAD, index and the work tree\n> involve in the commit that causes the problem?  Can you make\n> repository available to the public for diagnosis (if it is \"Only\n> on OSX\", I may not be able to help much with, but never hurt to\n> ask)?\n\nUnfortunately not. I'll try to see if I can't cook up a test case that  \nreproduces it however.\n\n> Just to double check, can you see if reverting the commit (and\n> another commit that immediately follows) fixes the issue for\n> you?\n>\n> A patch to do the revert for cf5c51e is attached.\n\nThe patch does indeed fix it.\n\nAdditionally, now that I see the output of a successful run right  \nafter a failed one, it appears that git-status is dying before listing  \nuntracked files. It will output the \"Changed but not updated:\"  \nsection, but then die before getting to \"Untracked files:\".\n\n-Dane\n"},{"id":"69479","messageId":"76718490802210734o43e7eb2fid3f4677d5570ac2a@mail.gmail.com","threadId":"12169","inReplyTo":"F8D3F7F0-3A98-4576-BD89-6E5C682B351C@fastmail.fm","subject":"Re: [Bug] Segfault in git status","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2008-02-21T15:34:47Z","receivedAt":"2008-02-21T15:34:47Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Mon, Feb 18, 2008 at 3:36 AM, Dane Jensen <careo@fastmail.fm> wrote:\n> Hi all-\n>\n>  Somehow I've managed to create a repository that causes git status to\n>  segfault. To be honest, I'm not entirely sure how just yet. This comes\n>  after a weekend of splitting a repository into two separate\n>  repositories, filtering out a directory from one, and then creating\n>  grafts in those repositories to skip commits that now change nothing.\n>\n>  This was in OS X 10.5.2 with git compiled from cf5c51e. Falling back\n>  to 1.5.4.2 cleared it up, so with the help of git bisect I've narrowed\n>  the bug down to cf55870.\n>\n>  I'll spend some time this week trying to find the exact point in my\n>  filtering that git status went south and report back if I can\n>  replicate it in a more-controlled test.\n\nBTW - you should have a crash log in ~/Library/Logs/CrashReporter and\nthat should list the function in which the crash occurred.\n\nj.\n"},{"id":"69481","messageId":"D3C27E63-329D-4509-830A-099A7BCB72B7@ai.rug.nl","threadId":"12169","inReplyTo":"F8D3F7F0-3A98-4576-BD89-6E5C682B351C@fastmail.fm","subject":"Re: [Bug] Segfault in git status","fromName":"Pieter de Bie","fromEmail":"pdebie@ai.rug.nl","sentAt":"2008-02-21T16:01:10Z","receivedAt":"2008-02-21T16:01:10Z","isPatch":false,"sender":{"key":"pdebie@ai.rug.nl","avatar":null},"body":"\nOn Feb 18, 2008, at 9:36 AM, Dane Jensen wrote:\n\n> Hi all-\n>\n> Somehow I've managed to create a repository that causes git status  \n> to segfault. To be honest, I'm not entirely sure how just yet. This  \n> comes after a weekend of splitting a repository into two separate  \n> repositories, filtering out a directory from one, and then creating  \n> grafts in those repositories to skip commits that now change nothing.\n\nI have the same problem, also on OS X.\n\nVienna:Project pieter$ git --version\ngit version 1.5.4.2.263.g5729\n\nwhich is 'next' + 2 patches\n\nVienna:Project pieter$ gdb --args git status\nGNU gdb 6.3.50-20050815 (Apple version gdb-768) (Tue Oct  2 04:07:49  \nUTC 2007)\nCopyright 2004 Free Software Foundation, Inc.\nGDB is free software, covered by the GNU General Public License, and  \nyou are\nwelcome to change it and/or distribute copies of it under certain  \nconditions.\nType \"show copying\" to see the conditions.\nThere is absolutely no warranty for GDB.  Type \"show warranty\" for  \ndetails.\nThis GDB was configured as \"i386-apple-darwin\"...Reading symbols for  \nshared libraries ........ done\n\n(gdb) r\nStarting program: /opt/pieter/bin/git status\nReading symbols for shared libraries +++++++. done\n# On branch master\n# Changed but not updated:\n#   (use \"git add <file>...\" to update what will be committed)\n#\n#\tmodified:   Data/Metadata/redirects.xml\n#\tmodified:   protege/ontologie.owl\n#\tmodified:   protege/ontologie.pprj\n#\tmodified:   protege/ontologie.repository\n#\tmodified:   protege/swirl_data.owl\n#\tmodified:   test-po2s.db\n#\tmodified:   test-so2p.db\n#\tmodified:   test-sp2o.db\n#\n\nProgram received signal EXC_BAD_ACCESS, Could not access memory.\nReason: KERN_INVALID_ADDRESS at address: 0x004a2010\nindex_name_exists (istate=0xeba80, name=0xbfffdc27 \"Data/Cache/ \nTemplate/Peter_II_of_Yugoslavia.html\", namelen=47) at read-cache.c:101\n101\t\t\tif (!(ce->ce_flags & CE_UNHASHED)) {\n(gdb) print *ce\nCannot access memory at address 0x4a1fec\n\nThis happens in at least one repository, most others are just fine.\n\n- Pieter\n"},{"id":"69483","messageId":"20080221162029.GA25778@coredump.intra.peff.net","threadId":"12169","inReplyTo":"D3C27E63-329D-4509-830A-099A7BCB72B7@ai.rug.nl","subject":"Re: [Bug] Segfault in git status","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-02-21T16:20:30Z","receivedAt":"2008-02-21T16:20:30Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 21, 2008 at 05:01:10PM +0100, Pieter de Bie wrote:\n\n> Program received signal EXC_BAD_ACCESS, Could not access memory.\n> Reason: KERN_INVALID_ADDRESS at address: 0x004a2010\n> index_name_exists (istate=0xeba80, name=0xbfffdc27 \"Data/Cache/ \n> Template/Peter_II_of_Yugoslavia.html\", namelen=47) at read-cache.c:101\n> 101\t\t\tif (!(ce->ce_flags & CE_UNHASHED)) {\n> (gdb) print *ce\n> Cannot access memory at address 0x4a1fec\n\nThis shows up using valgrind under Linux, too. I haven't had time to\ntrack it down yet, though.\n\n-Peff\n"},{"id":"69491","messageId":"76718490802210853t23b0498fkfb9a14bcd50ca458@mail.gmail.com","threadId":"12169","inReplyTo":"D3C27E63-329D-4509-830A-099A7BCB72B7@ai.rug.nl","subject":"Re: [Bug] Segfault in git status","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2008-02-21T16:53:01Z","receivedAt":"2008-02-21T16:53:01Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Thu, Feb 21, 2008 at 11:01 AM, Pieter de Bie <pdebie@ai.rug.nl> wrote:\n>  Vienna:Project pieter$ gdb --args git status\n>  (gdb) r\n>  Program received signal EXC_BAD_ACCESS, Could not access memory.\n>  Reason: KERN_INVALID_ADDRESS at address: 0x004a2010\n>  index_name_exists (istate=0xeba80, name=0xbfffdc27 \"Data/Cache/\n>  Template/Peter_II_of_Yugoslavia.html\", namelen=47) at read-cache.c:101\n>  101                     if (!(ce->ce_flags & CE_UNHASHED)) {\n>  (gdb) print *ce\n>  Cannot access memory at address 0x4a1fec\n\nDo that again, but type \"bt\" at the gdb prompt after the crash please. :-)\n\nj.\n"},{"id":"69494","messageId":"9E63BCA0-A99A-468D-8DC9-47860D60BB5B@ai.rug.nl","threadId":"12169","inReplyTo":"76718490802210853t23b0498fkfb9a14bcd50ca458@mail.gmail.com","subject":"Re: [Bug] Segfault in git status","fromName":"Pieter de Bie","fromEmail":"pdebie@ai.rug.nl","sentAt":"2008-02-21T17:17:45Z","receivedAt":"2008-02-21T17:17:45Z","isPatch":false,"sender":{"key":"pdebie@ai.rug.nl","avatar":null},"body":"\nOn Feb 21, 2008, at 5:53 PM, Jay Soffian wrote:\n>>\n> Do that again, but type \"bt\" at the gdb prompt after the crash  \n> please. :-)\n>\n> j.\n\nProgram received signal EXC_BAD_ACCESS, Could not access memory.\nReason: KERN_INVALID_ADDRESS at address: 0x004a2010\nindex_name_exists (istate=0xeba80, name=0xbfffdc27 \"Data/Cache/ \nTemplate/Peter_II_of_Yugoslavia.html\", namelen=47) at read-cache.c:101\n101\t\t\tif (!(ce->ce_flags & CE_UNHASHED)) {\n(gdb) backtrace\n#0  index_name_exists (istate=0xeba80, name=0xbfffdc27 \"Data/Cache/ \nTemplate/Peter_II_of_Yugoslavia.html\", namelen=47) at read-cache.c:101\n#1  0x0006fc04 in dir_add_name (dir=0xbfffef68, pathname=0xbfffdc27  \n\"Data/Cache/Template/Peter_II_of_Yugoslavia.html\", len=47) at dir.c:374\n#2  0x00070d11 in read_directory_recursive (dir=0xbfffef68,  \npath=<value temporarily unavailable, due to optimizations>,  \nbase=<value temporarily unavailable, due to optimizations>,  \nbaselen=20, check_only=0, simplify=0x8072cc) at dir.c:642\n#3  0x00070baf in read_directory_recursive (dir=0xbfffef68,  \npath=<value temporarily unavailable, due to optimizations>,  \nbase=<value temporarily unavailable, due to optimizations>,  \nbaselen=11, check_only=0, simplify=<value temporarily unavailable, due  \nto optimizations>) at dir.c:627\n#4  0x00070baf in read_directory_recursive (dir=0xbfffef68,  \npath=<value temporarily unavailable, due to optimizations>,  \nbase=<value temporarily unavailable, due to optimizations>, baselen=5,  \ncheck_only=0, simplify=<value temporarily unavailable, due to  \noptimizations>) at dir.c:627\n#5  0x00070baf in read_directory_recursive (dir=0xbfffef68,  \npath=<value temporarily unavailable, due to optimizations>,  \nbase=<value temporarily unavailable, due to optimizations>, baselen=0,  \ncheck_only=0, simplify=<value temporarily unavailable, due to  \noptimizations>) at dir.c:627\n#6  0x00070ed3 in read_directory (dir=0xbfffef68, path=0xc446c \".\",  \nbase=0xbb080 \"\", baselen=4857836, pathspec=0x0) at dir.c:715\n#7  0x0009d4d6 in wt_status_print (s=0xbffff5ac) at wt-status.c:282\n#8  0x000167c3 in run_status (fp=0xa015f5f8, index_file=0x500300 \"/ \nUsers/pieter/Documents/Studie/2007-2008/AWT/Project/.git/index\",  \nprefix=0x0, nowarn=4857836) at builtin-commit.c:347\n#9  0x000171af in cmd_status (argc=1, argv=0x0, prefix=0x500300 \"/ \nUsers/pieter/Documents/Studie/2007-2008/AWT/Project/.git/index\") at  \nbuiltin-commit.c:783\n#10 0x00002260 in handle_internal_command (argc=1, argv=0xbffff7b8) at  \ngit.c:259\n#11 0x0000246f in main (argc=1, argv=0xbffff7b8) at git.c:451\n\n\nThere ya go\n\n- Pieter\n"},{"id":"69495","messageId":"191B6CDE-D81C-4730-8A39-07774BB80D85@fastmail.fm","threadId":"12169","inReplyTo":"76718490802210853t23b0498fkfb9a14bcd50ca458@mail.gmail.com","subject":"Re: [Bug] Segfault in git status","fromName":"Dane Jensen","fromEmail":"careo@fastmail.fm","sentAt":"2008-02-21T17:19:21Z","receivedAt":"2008-02-21T17:19:21Z","isPatch":false,"sender":{"key":"careo@fastmail.fm","avatar":"https://gravatar.com/avatar/3ab94e7d309154bbc53ddcbffa3d689aabd08915e728fb9684c0bd337855fc1a?d=mp&s=160"},"body":"On Feb 21, 2008, at 8:53 AM, Jay Soffian wrote:\n\n> On Thu, Feb 21, 2008 at 11:01 AM, Pieter de Bie <pdebie@ai.rug.nl>  \n> wrote:\n>> Vienna:Project pieter$ gdb --args git status\n>> (gdb) r\n>> Program received signal EXC_BAD_ACCESS, Could not access memory.\n>> Reason: KERN_INVALID_ADDRESS at address: 0x004a2010\n>> index_name_exists (istate=0xeba80, name=0xbfffdc27 \"Data/Cache/\n>> Template/Peter_II_of_Yugoslavia.html\", namelen=47) at read-cache.c: \n>> 101\n>> 101                     if (!(ce->ce_flags & CE_UNHASHED)) {\n>> (gdb) print *ce\n>> Cannot access memory at address 0x4a1fec\n>\n> Do that again, but type \"bt\" at the gdb prompt after the crash  \n> please. :-)\n\n\nSame error as mine. Here's the result against my repository. This is  \nwith master, git --version => 1.5.4.2.184.gb23b,\n\n(gdb) r\nStarting program: /Users/djensen/bin/git status\nReading symbols for shared libraries +++++++. done\n# On branch remote/device-emulator\n\nProgram received signal EXC_BAD_ACCESS, Could not access memory.\nReason: KERN_INVALID_ADDRESS at address: 0x00431018\nindex_name_exists (istate=0xe04a0, name=0xbfffdc87 \"shared/models/spec/ \ndevice_spec.rb\", namelen=33) at read-cache.c:101\n101\t\t\tif (!(ce->ce_flags & CE_UNHASHED)) {\n(gdb) bt\n#0  index_name_exists (istate=0xe04a0, name=0xbfffdc87 \"shared/models/ \nspec/device_spec.rb\", namelen=33) at read-cache.c:101\n#1  0x00068624 in dir_add_name (dir=0xbfffefc0, pathname=0xbfffdc87  \n\"shared/models/spec/device_spec.rb\", len=33) at dir.c:374\n#2  0x00069731 in read_directory_recursive (dir=0xbfffefc0,  \npath=<value temporarily unavailable, due to optimizations>,  \nbase=<value temporarily unavailable, due to optimizations>,  \nbaselen=19, check_only=0, simplify=0x81de38) at dir.c:642\n#3  0x000695cf in read_directory_recursive (dir=0xbfffefc0,  \npath=<value temporarily unavailable, due to optimizations>,  \nbase=<value temporarily unavailable, due to optimizations>,  \nbaselen=14, check_only=0, simplify=<value temporarily unavailable, due  \nto optimizations>) at dir.c:627\n#4  0x000695cf in read_directory_recursive (dir=0xbfffefc0,  \npath=<value temporarily unavailable, due to optimizations>,  \nbase=<value temporarily unavailable, due to optimizations>, baselen=7,  \ncheck_only=0, simplify=<value temporarily unavailable, due to  \noptimizations>) at dir.c:627\n#5  0x000695cf in read_directory_recursive (dir=0xbfffefc0,  \npath=<value temporarily unavailable, due to optimizations>,  \nbase=<value temporarily unavailable, due to optimizations>, baselen=0,  \ncheck_only=0, simplify=<value temporarily unavailable, due to  \noptimizations>) at dir.c:627\n#6  0x000698f3 in read_directory (dir=0xbfffefc0, path=0xae8a0 \".\",  \nbase=0xae19c \"\", baselen=4394996, pathspec=0x0) at dir.c:715\n#7  0x00094746 in wt_status_print (s=0xbffff5ec) at wt-status.c:282\n#8  0x00014423 in run_status (fp=0xa01a65f8, index_file=0x5003b0 \"/ \nUsers/djensen/Projects/Soocial/source/.git/index\", prefix=0x0,  \nnowarn=4394996) at builtin-commit.c:346\n#9  0x00014e0f in cmd_status (argc=1, argv=0x0, prefix=0x5003b0 \"/ \nUsers/djensen/Projects/Soocial/source/.git/index\") at builtin-commit.c: \n782\n#10 0x00001da0 in handle_internal_command (argc=1, argv=0xbffff7f8) at  \ngit.c:259\n#11 0x00001faf in main (argc=1, argv=0xbffff7f8) at git.c:449\n(gdb)\n"}]}