{"thread":{"id":"22292","subject":"git-status segmentation fault in master / OS X","startedAt":"2010-01-19T17:59:51Z","lastAt":"2010-01-21T06:48:31Z","messageCount":10,"participants":["Jonathan del Strother","Jeff King","Junio C Hamano","Nguyen Thai Ngoc Duy","Nguyễn Thái Ngọc Duy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"132130","messageId":"57518fd11001190959n355a0f22p7caa7251b705efaf@mail.gmail.com","threadId":"22292","inReplyTo":null,"subject":"git-status segmentation fault in master / OS X","fromName":"Jonathan del Strother","fromEmail":"maillist@steelskies.com","sentAt":"2010-01-19T17:59:51Z","receivedAt":"2010-01-19T17:59:51Z","isPatch":false,"sender":{"key":"jon.delstrother@bestbefore.tv","avatar":"https://gravatar.com/avatar/754e21ab701c00e2d21fc261187254c34b2a1c0b959d9ee5be1a295990be3081?d=mp&s=160"},"body":"Heya,\nI've been running into a segmentation fault on running git status in\nmy repository while there are staged changes.  Bisecting suggests it\nwas introduced in:\n\ncommit 73d66323ac78c750ba42fef23b1cb8fd2110e023\nMerge: 054d2fa 8740773\nAuthor: Junio C Hamano <gitster@pobox.com>\nDate:   Wed Jan 13 11:58:34 2010 -0800\n\n    Merge branch 'nd/sparse'\n\n\nThe last commit from nd/sparse (8740773) is fine, so I guess it's a\nbad merge...?\n\n\nHere's the crash I get on 73d6632 :\n\nProcess:         git [93736]\nPath:            /Users/jon/bin/git\nIdentifier:      git\nVersion:         ??? (???)\nCode Type:       X86-64 (Native)\nParent Process:  zsh [26194]\n\nDate/Time:       2010-01-19 17:58:01.306 +0000\nOS Version:      Mac OS X 10.6.2 (10C540)\nReport Version:  6\n\nInterval Since Last Report:          349902 sec\nCrashes Since Last Report:           15\nPer-App Crashes Since Last Report:   11\nAnonymous UUID:                      2563166D-332E-42BE-9D2D-0E741A6DB38A\n\nException Type:  EXC_BAD_ACCESS (SIGSEGV)\nException Codes: KERN_INVALID_ADDRESS at 0x0000000000000000\nCrashed Thread:  0  Dispatch queue: com.apple.main-thread\n\nThread 0 Crashed:  Dispatch queue: com.apple.main-thread\n0   libSystem.B.dylib             \t0x00007fff81260a56 fnmatch1 + 442\n1   libSystem.B.dylib             \t0x00007fff8126088a fnmatch + 124\n2   git                           \t0x0000000100076cde excluded_from_list + 526\n3   git                           \t0x0000000100077877 excluded + 519\n4   git                           \t0x0000000100077ab5\nread_directory_recursive + 453\n5   git                           \t0x0000000100077ff9 read_directory + 249\n6   git                           \t0x000000010007812b fill_directory + 219\n7   git                           \t0x00000001000b91a7 wt_status_collect + 599\n8   git                           \t0x0000000100017380 cmd_status + 288\n(builtin-commit.c:1032)\n9   git                           \t0x0000000100001d1c\nhandle_internal_command + 188 (git.c:257)\n10  git                           \t0x0000000100001f5c main + 236 (git.c:446)\n11  git                           \t0x0000000100001814 start + 52\n\nThread 0 crashed with X86 Thread State (64-bit):\n  rax: 0x0000000000000003  rbx: 0x0000000000000000  rcx:\n0x00007fff5fbfe260  rdx: 0x0000000000000006\n  rdi: 0x000000000000002a  rsi: 0x00007fff5fbfe480  rbp:\n0x00007fff5fbfe1d0  rsp: 0x00007fff5fbfe010\n   r8: 0x00007fff70276980   r9: 0x0000000100528720  r10:\n0x0000000100528ae0  r11: 0x00007fff8120b860\n  r12: 0x00007fff5fbfe480  r13: 0x0000000000000001  r14:\n0x00007fff70276980  r15: 0x00007fff5fbfe260\n  rip: 0x00007fff81260a56  rfl: 0x0000000000010246  cr2: 0x0000000000000000\n\nBinary Images:\n       0x100000000 -        0x1000f9fef +git ??? (???)\n<FFFFCD11-3352-4216-B27D-2700D1A69326> /Users/jon/bin/git\n       0x100179000 -        0x10018bfe7 +libz.1.dylib ??? (???)\n<F450102F-273C-872E-0729-BD338777CA02> /opt/local/lib/libz.1.dylib\n       0x10018f000 -        0x10028bff7 +libiconv.2.dylib ??? (???)\n<A27D1D71-44A7-76A7-41EB-CC4BAC91E740> /opt/local/lib/libiconv.2.dylib\n       0x100298000 -        0x1003acfe7 +libcrypto.0.9.8.dylib ???\n(???) <D4E1B9E7-BE64-5054-F80A-B63296AFEAD4>\n/opt/local/lib/libcrypto.0.9.8.dylib\n       0x100410000 -        0x10044ffff +libssl.0.9.8.dylib ??? (???)\n<4E8F5D81-1DFF-5CBD-361A-C37609B799A8>\n/opt/local/lib/libssl.0.9.8.dylib\n    0x7fff5fc00000 -     0x7fff5fc3bdef  dyld 132.1 (???)\n<B633F790-4DDB-53CD-7ACF-2A3682BCEA9F> /usr/lib/dyld\n    0x7fff811d2000 -     0x7fff81390ff7  libSystem.B.dylib ??? (???)\n<526DD3E5-2A8B-4512-ED97-01B832369959> /usr/lib/libSystem.B.dylib\n    0x7fff871c3000 -     0x7fff871c7ff7  libmathCommon.A.dylib ???\n(???) <95718673-FEEE-B6ED-B127-BCDBDB60D4E5>\n/usr/lib/system/libmathCommon.A.dylib\n    0x7fffffe00000 -     0x7fffffe01fff  libSystem.B.dylib ??? (???)\n<526DD3E5-2A8B-4512-ED97-01B832369959> /usr/lib/libSystem.B.dylib\n\nModel: MacPro1,1, BootROM MP11.005C.B08, 4 processors, Dual-Core Intel\nXeon, 2 GHz, 3 GB, SMC 1.7f10\nGraphics: ATI Radeon X1900 XT, ATY,RadeonX1900, PCIe, 512 MB\nMemory Module: global_name\nAirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x87),\nBroadcom BCM43xx 1.0 (5.10.91.26)\nBluetooth: Version 2.2.4f3, 2 service, 1 devices, 1 incoming serial ports\nNetwork Service: Ethernet 1, Ethernet, en0\nPCI Card: ATY,RadeonX1900, Display, Slot-1\nSerial ATA Device: WDC WD2500KS-00MJB0, 232.89 GB\nSerial ATA Device: WDC WD2500JS-41SGB0, 232.89 GB\nParallel ATA Device: SONY    DVD RW DW-D150A\nUSB Device: Hub, 0x05ac  (Apple Inc.), 0x9130, 0xfd400000\nUSB Device: Keyboard Hub, 0x05ac  (Apple Inc.), 0x1006, 0xfd410000\nUSB Device: USB-PS/2 Optical Mouse, 0x046d  (Logitech Inc.), 0xc01e, 0xfd411000\nUSB Device: Apple Keyboard, 0x05ac  (Apple Inc.), 0x0221, 0xfd412000\nUSB Device: C-Media USB Headphone Set, 0x0d8c  (C-MEDIA ELECTRONICS\nINC.), 0x000c, 0xfd430000\nUSB Device: Apple Cinema Display, 0x05ac  (Apple Inc.), 0x9222, 0xfd420000\nUSB Device: Hub, 0x05ac  (Apple Inc.), 0x9131, 0xfd300000\nUSB Device: Apple Cinema HD Display, 0x05ac  (Apple Inc.), 0x9223, 0xfd320000\nUSB Device: Bluetooth USB Host Controller, 0x05ac  (Apple Inc.),\n0x8206, 0x5d200000\nFireWire Device: built-in_hub, Up to 800 Mb/sec\nFireWire Device: unknown_device, Unknown\n\n\n\nWant me to do any more digging?\n\n-Jonathan\n"},{"id":"132154","messageId":"20100120004146.GB16824@coredump.intra.peff.net","threadId":"22292","inReplyTo":"57518fd11001190959n355a0f22p7caa7251b705efaf@mail.gmail.com","subject":"Re: git-status segmentation fault in master / OS X","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-01-20T00:41:46Z","receivedAt":"2010-01-20T00:41:46Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jan 19, 2010 at 05:59:51PM +0000, Jonathan del Strother wrote:\n\n> I've been running into a segmentation fault on running git status in\n> my repository while there are staged changes.\n\nI can't reproduce it here. Is there anything else interesting about the\nrepo you can tell us besides that it has staged changes?\n\n> Bisecting suggests it was introduced in:\n> \n> commit 73d66323ac78c750ba42fef23b1cb8fd2110e023\n> Merge: 054d2fa 8740773\n> Author: Junio C Hamano <gitster@pobox.com>\n> Date:   Wed Jan 13 11:58:34 2010 -0800\n> \n>     Merge branch 'nd/sparse'\n> \n> \n> The last commit from nd/sparse (8740773) is fine, so I guess it's a\n> bad merge...?\n\nCould be a bad interaction between commits on nd/sparse and whatever was\ndone since it had branched. You can try rebasing nd/sparse and bisecting\na linearised version, like this:\n\n  bad_merge=73d66323\n  # pretend we are on nd/sparse\n  git checkout -b test $bad_merge^2\n  # rebase onto what we merged onto\n  git rebase $bad_merge^1\n  # now bisect. what we have now is presumably\n  # bad (though you should probably double check)\n  # and from the previous bisect we know that\n  # everything pre-merge is good\n  git bisect start\n  git bisect good $bad_merge^1\n  git bisect bad\n\n-Peff\n"},{"id":"132155","messageId":"7vd4157fwt.fsf@alter.siamese.dyndns.org","threadId":"22292","inReplyTo":"20100120004146.GB16824@coredump.intra.peff.net","subject":"Re: git-status segmentation fault in master / OS X","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-01-20T00:56:18Z","receivedAt":"2010-01-20T00:56:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Could be a bad interaction between commits on nd/sparse and whatever was\n> done since it had branched. You can try rebasing nd/sparse and bisecting\n> a linearised version, like this:\n>\n>   bad_merge=73d66323\n>   # pretend we are on nd/sparse\n>   git checkout -b test $bad_merge^2\n>   # rebase onto what we merged onto\n>   git rebase $bad_merge^1\n\nThat is a very good suggestion.\n\nYou will get hit by a few conflicts during the rebase, but I managed to\narrive at the same tree as $bad_merge after running the rebase procedure\nabove.  Just for Jonathan's convenience, the result is at:\n\n  git://repo.or.cz/alt-git.git junk-linearized-nd-sparse-for-bisection\n\nI'll remove this after a few days.\n\n>   # now bisect. what we have now is presumably\n>   # bad (though you should probably double check)\n>   # and from the previous bisect we know that\n>   # everything pre-merge is good\n>   git bisect start\n>   git bisect good $bad_merge^1\n>   git bisect bad\n\nIt would be interesting to hear the result of the test in the particular\nrepository Jonathan is seeing the problem with.  The issue didn't\nreproduce for me, either but I only tried \"having a staged change\" case\nwithout any more detailed set-up.\n"},{"id":"132183","messageId":"57518fd11001200243v416aa5f9o37a3b5b92bef3b57@mail.gmail.com","threadId":"22292","inReplyTo":"7vd4157fwt.fsf@alter.siamese.dyndns.org","subject":"Re: git-status segmentation fault in master / OS X","fromName":"Jonathan del Strother","fromEmail":"maillist@steelskies.com","sentAt":"2010-01-20T10:43:33Z","receivedAt":"2010-01-20T10:43:33Z","isPatch":false,"sender":{"key":"jon.delstrother@bestbefore.tv","avatar":"https://gravatar.com/avatar/754e21ab701c00e2d21fc261187254c34b2a1c0b959d9ee5be1a295990be3081?d=mp&s=160"},"body":"2010/1/20 Junio C Hamano <gitster@pobox.com>:\n> Jeff King <peff@peff.net> writes:\n>\n>> Could be a bad interaction between commits on nd/sparse and whatever was\n>> done since it had branched. You can try rebasing nd/sparse and bisecting\n>> a linearised version, like this:\n>>\n>>   bad_merge=73d66323\n>>   # pretend we are on nd/sparse\n>>   git checkout -b test $bad_merge^2\n>>   # rebase onto what we merged onto\n>>   git rebase $bad_merge^1\n>\n> That is a very good suggestion.\n>\n> You will get hit by a few conflicts during the rebase, but I managed to\n> arrive at the same tree as $bad_merge after running the rebase procedure\n> above.  Just for Jonathan's convenience, the result is at:\n>\n>  git://repo.or.cz/alt-git.git junk-linearized-nd-sparse-for-bisection\n>\n> I'll remove this after a few days.\n>\n>>   # now bisect. what we have now is presumably\n>>   # bad (though you should probably double check)\n>>   # and from the previous bisect we know that\n>>   # everything pre-merge is good\n>>   git bisect start\n>>   git bisect good $bad_merge^1\n>>   git bisect bad\n>\n> It would be interesting to hear the result of the test in the particular\n> repository Jonathan is seeing the problem with.  The issue didn't\n> reproduce for me, either but I only tried \"having a staged change\" case\n> without any more detailed set-up.\n>\n\nOK, found some more interesting results from that.  The new bad commit is :\n\ncommit 66dce7bdb6742cb06433f8ef25441690b71c7995\nAuthor: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\nDate:   Thu Aug 20 20:47:01 2009 +0700\n\n    Read .gitignore from index if it is skip-worktree\n\n\nI still haven't been able to come up with a minimal test case, but gdb\ngave me this:\n\nProgram received signal EXC_BAD_ACCESS, Could not access memory.\nReason: KERN_INVALID_ADDRESS at address: 0x00000000000001c8\n0x0000000100093e69 in excluded_1 (pathname=0x7fff5fbfd8b0\n\"shared/config/environments/.gitignore\", pathlen=37,\nbasename=0x7fff5fbfd8cb \".gitignore\", dtype=0x7fff5fbfd8a4,\nel=0x7fff5fbfeb00) at dir.c:378\n378\t\t\t\t\tif (*exclude == '/')\n(gdb) bt\n#0  0x0000000100093e69 in excluded_1 (pathname=0x7fff5fbfd8b0\n\"shared/config/environments/.gitignore\", pathlen=37,\nbasename=0x7fff5fbfd8cb \".gitignore\", dtype=0x7fff5fbfd8a4,\nel=0x7fff5fbfeb00) at dir.c:378\n#1  0x0000000100093fd0 in excluded (dir=0x7fff5fbfeac0,\npathname=0x7fff5fbfd8b0 \"shared/config/environments/.gitignore\",\ndtype_p=0x7fff5fbfd8a4) at dir.c:410\n#2  0x0000000100094a10 in read_directory_recursive\n(dir=0x7fff5fbfeac0, base=0x7fff5fbfdd20\n\"shared/config/environments/\", baselen=27, check_only=0, simplify=0x0)\nat dir.c:688\n#3  0x0000000100094bfa in read_directory_recursive\n(dir=0x7fff5fbfeac0, base=0x7fff5fbfe190 \"shared/config/\", baselen=14,\ncheck_only=0, simplify=0x0) at dir.c:727\n#4  0x0000000100094bfa in read_directory_recursive\n(dir=0x7fff5fbfeac0, base=0x7fff5fbfe600 \"shared/\", baselen=7,\ncheck_only=0, simplify=0x0) at dir.c:727\n#5  0x0000000100094bfa in read_directory_recursive\n(dir=0x7fff5fbfeac0, base=0x1000f48d0 \"\", baselen=0, check_only=0,\nsimplify=0x0) at dir.c:727\n#6  0x0000000100094ecc in read_directory (dir=0x7fff5fbfeac0,\npath=0x1000f48d0 \"\", len=0, pathspec=0x0) at dir.c:813\n#7  0x0000000100093118 in fill_directory (dir=0x7fff5fbfeac0,\npathspec=0x0) at dir.c:70\n#8  0x00000001000e85a7 in wt_status_collect_untracked\n(s=0x7fff5fbfef80) at wt-status.c:346\n#9  0x00000001000e86cc in wt_status_collect (s=0x7fff5fbfef80) at\nwt-status.c:366\n#10 0x000000010001e467 in cmd_status (argc=0, argv=0x7fff5fbff248,\nprefix=0x0) at builtin-commit.c:1026\n#11 0x0000000100001b52 in run_builtin (p=0x10013e3b0, argc=1,\nargv=0x7fff5fbff248) at git.c:257\n#12 0x0000000100001d04 in handle_internal_command (argc=1,\nargv=0x7fff5fbff248) at git.c:401\n#13 0x0000000100001e83 in main (argc=1, argv=0x7fff5fbff248) at git.c:482\n\n\n\"shared/config/environments/.gitignore\" contained just\n\"_local_config.rb\", no newline.  It seemed like adding or removing\ncharacters from that file would 'fix' the problem, but changing them\nwouldn't (ie the problem was always there when .gitignore was 16\nbytes), but I'm not entirely sure because it continues to be a bit of\na Schrodinger bug.\n\n\nOne thing I wondered about from that commit - shouldn't the \"buf =\nxmalloc(size);\" on dir.c:252 be \"buf = xmalloc(size+1);\" ?  I haven't\nreally looked at the program flow there, so may be wrong...\n"},{"id":"132192","messageId":"fcaeb9bf1001200458v436a8adeq5cfc6753900e6c0c@mail.gmail.com","threadId":"22292","inReplyTo":"57518fd11001200243v416aa5f9o37a3b5b92bef3b57@mail.gmail.com","subject":"Re: git-status segmentation fault in master / OS X","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-01-20T12:58:54Z","receivedAt":"2010-01-20T12:58:54Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On 1/20/10, Jonathan del Strother <maillist@steelskies.com> wrote:\n>  One thing I wondered about from that commit - shouldn't the \"buf =\n>  xmalloc(size);\" on dir.c:252 be \"buf = xmalloc(size+1);\" ?  I haven't\n>  really looked at the program flow there, so may be wrong...\n\nYou would also need to revert 66c3fa0 (Avoid writing to buffer in\nadd_excludes_from_file_1() - 2009-08-20) and see if it fixes the\nproblem. I think there is a potential memory corruption at \"buf[i - (i\n&& buf[i-1] == '\\r')] = 0;\". Don't know if it is the cause though.\n-- \nDuy\n"},{"id":"132195","messageId":"1263996556-9712-1-git-send-email-pclouds@gmail.com","threadId":"22292","inReplyTo":"fcaeb9bf1001200458v436a8adeq5cfc6753900e6c0c@mail.gmail.com","subject":"[PATCH] Fix memory corruption when .gitignore does not end by \\n","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-01-20T14:09:16Z","receivedAt":"2010-01-20T14:09:16Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Commit b5041c5 (Avoid writing to buffer in add_excludes_from_file_1())\ntried not to append '\\n' at the end because the next commit\nmay return a buffer that does not have extra space for that.\n\nUnfortunately it left this assignment in the loop:\n\n  buf[i - (i && buf[i-1] == '\\r')] = 0;\n\nthat can corrupt memory if \"buf\" is not '\\n' terminated. But even if\nit does not corrupt memory, the last line would not be\nNULL-terminated, leading to errors later inside add_exclude().\n\nThis patch fixes it by reverting the faulty commit and make\nsure \"buf\" is always \\n terminated.\n\nWhile at it, free unused memory properly.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n This patch causes a crash for me. Not sure if it does for anybody else.\n\n  diff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh\n  index 6d2f2b6..e7efdb5 100755\n  --- a/t/t3001-ls-files-others-exclude.sh\n  +++ b/t/t3001-ls-files-others-exclude.sh\n  @@ -57,7 +57,7 @@ expect\n   echo '*.1\n   /*.3\n   !*.6' >.gitignore\n  -echo '*.2\n  +echo -n '*.2\n   two/*.4\n   !*.7\n   *.8' >one/.gitignore\n\n dir.c |   16 +++++++++++++---\n 1 files changed, 13 insertions(+), 3 deletions(-)\n\ndiff --git a/dir.c b/dir.c\nindex 1538ad5..67c3af6 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -242,6 +242,14 @@ int add_excludes_from_file_to_list(const char *fname,\n \t\tif (!check_index ||\n \t\t    (buf = read_skip_worktree_file_from_index(fname, &size)) == NULL)\n \t\t\treturn -1;\n+\t\tif (size == 0) {\n+\t\t\tfree(buf);\n+\t\t\treturn 0;\n+\t\t}\n+\t\tif (buf[size-1] != '\\n') {\n+\t\t\tbuf = xrealloc(buf, size+1);\n+\t\t\tbuf[size++] = '\\n';\n+\t\t}\n \t}\n \telse {\n \t\tsize = xsize_t(st.st_size);\n@@ -249,19 +257,21 @@ int add_excludes_from_file_to_list(const char *fname,\n \t\t\tclose(fd);\n \t\t\treturn 0;\n \t\t}\n-\t\tbuf = xmalloc(size);\n+\t\tbuf = xmalloc(size+1);\n \t\tif (read_in_full(fd, buf, size) != size) {\n+\t\t\tfree(buf);\n \t\t\tclose(fd);\n \t\t\treturn -1;\n \t\t}\n+\t\tbuf[size++] = '\\n';\n \t\tclose(fd);\n \t}\n \n \tif (buf_p)\n \t\t*buf_p = buf;\n \tentry = buf;\n-\tfor (i = 0; i <= size; i++) {\n-\t\tif (i == size || buf[i] == '\\n') {\n+\tfor (i = 0; i < size; i++) {\n+\t\tif (buf[i] == '\\n') {\n \t\t\tif (entry != buf + i && entry[0] != '#') {\n \t\t\t\tbuf[i - (i && buf[i-1] == '\\r')] = 0;\n \t\t\t\tadd_exclude(entry, base, baselen, which);\n-- \n1.6.6.181.g5ee6\n"},{"id":"132209","messageId":"7v3a20367d.fsf@alter.siamese.dyndns.org","threadId":"22292","inReplyTo":"1263996556-9712-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH] Fix memory corruption when .gitignore does not end by \\n","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-01-20T19:51:50Z","receivedAt":"2010-01-20T19:51:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n\n>  This patch causes a crash for me. Not sure if it does for anybody else.\n\nI am puzzled.  What do you mean by this?  If this patch makes the code\ncrash, then it is not a fix.  Is this meant as \"Jonathan, can you try this\npatch and tell me what happens, so that I can diagnose the issue better?\"\npatch?\n\nIs it better/safer to revert the entire nd/sparse topic from the master in\nthe meantime before we know what is going on?\n"},{"id":"132256","messageId":"fcaeb9bf1001201738x5cd374c2o280ec42d6d65c0f7@mail.gmail.com","threadId":"22292","inReplyTo":"7v3a20367d.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Fix memory corruption when .gitignore does not end by \\n","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-01-21T01:38:48Z","receivedAt":"2010-01-21T01:38:48Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On 1/21/10, Junio C Hamano <gitster@pobox.com> wrote:\n> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n>\n>  >  This patch causes a crash for me. Not sure if it does for anybody else.\n>\n>\n> I am puzzled.  What do you mean by this?  If this patch makes the code\n>  crash, then it is not a fix.  Is this meant as \"Jonathan, can you try this\n>  patch and tell me what happens, so that I can diagnose the issue better?\"\n>  patch?\n\nI mean the t3001 patch in comment part, which removes \\n at the end of\n.gitignore and crashes the unmodified git.\n\nIOW I found a problem and this patch (not the t3001 one) should fix\nit. Not sure if this causes Jonathan problem though.\n\n>  Is it better/safer to revert the entire nd/sparse topic from the master in\n>  the meantime before we know what is going on?\n\nI would wait for Jonathan response. If this is not the cause, probably\nsafer to revert it.\n-- \nDuy\n"},{"id":"132273","messageId":"57518fd11001202208x3dfd68f6p793f77cb85534923@mail.gmail.com","threadId":"22292","inReplyTo":"fcaeb9bf1001201738x5cd374c2o280ec42d6d65c0f7@mail.gmail.com","subject":"Re: [PATCH] Fix memory corruption when .gitignore does not end by \\n","fromName":"Jonathan del Strother","fromEmail":"maillist@steelskies.com","sentAt":"2010-01-21T06:08:37Z","receivedAt":"2010-01-21T06:08:37Z","isPatch":true,"sender":{"key":"jon.delstrother@bestbefore.tv","avatar":"https://gravatar.com/avatar/754e21ab701c00e2d21fc261187254c34b2a1c0b959d9ee5be1a295990be3081?d=mp&s=160"},"body":"2010/1/21 Nguyen Thai Ngoc Duy <pclouds@gmail.com>:\n> On 1/21/10, Junio C Hamano <gitster@pobox.com> wrote:\n>> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n>>\n>>  >  This patch causes a crash for me. Not sure if it does for anybody else.\n>>\n>>\n>> I am puzzled.  What do you mean by this?  If this patch makes the code\n>>  crash, then it is not a fix.  Is this meant as \"Jonathan, can you try this\n>>  patch and tell me what happens, so that I can diagnose the issue better?\"\n>>  patch?\n>\n> I mean the t3001 patch in comment part, which removes \\n at the end of\n> .gitignore and crashes the unmodified git.\n>\n> IOW I found a problem and this patch (not the t3001 one) should fix\n> it. Not sure if this causes Jonathan problem though.\n>\n>>  Is it better/safer to revert the entire nd/sparse topic from the master in\n>>  the meantime before we know what is going on?\n>\n> I would wait for Jonathan response. If this is not the cause, probably\n> safer to revert it.\n> --\n> Duy\n>\n\nThink it's all fixed after applying this patch - at least, I can no\nlonger reproduce the crash, whereas I was able to make it fail ~90% of\nthe time before.\n"},{"id":"132275","messageId":"7vockovtq8.fsf@alter.siamese.dyndns.org","threadId":"22292","inReplyTo":"fcaeb9bf1001201738x5cd374c2o280ec42d6d65c0f7@mail.gmail.com","subject":"Re: [PATCH] Fix memory corruption when .gitignore does not end by \\n","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-01-21T06:48:31Z","receivedAt":"2010-01-21T06:48:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n\n> I mean the t3001 patch in comment part, which removes \\n at the end of\n> .gitignore and crashes the unmodified git.\n>\n> IOW I found a problem and this patch (not the t3001 one) should fix\n> it. Not sure if this causes Jonathan problem though.\n\nAh, I see.  And a bug that leaves a string unterminated will exhibit\ndifferent symptoms depending on what garbage happens to follow it, so it\nmay not be universally reproducible.\n\nThanks; applied (and I saw Jonathan's Ack, as well).\n\nThanks, both.\n"}]}