{"thread":{"id":"42815","subject":"Odd git overrflow bug?","startedAt":"2016-07-10T16:02:54Z","lastAt":"2016-07-10T21:53:02Z","messageCount":7,"participants":["Linus Torvalds","Andreas Schwab","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"291141","messageId":"CA+55aFz=sZnABJr6F2yF_xvx6J6fZod6BbiL2OwszEnjjn-dEw@mail.gmail.com","threadId":"42815","inReplyTo":null,"subject":"Odd git overrflow bug?","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2016-07-10T16:02:44Z","receivedAt":"2016-07-10T16:02:54Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"We have an odd bug report in the kernel, where somebody had trouble\nbisecting all the way due to\n\n  \"git is failing with \"you are trying to use to much memory\"(?!)\"\n\nwhich can't be an exact  error message quote, but the closest I can\nfind smells like the \"unsigned_add_overflows()\" check in the strbuf\ncode. Very odd.\n\nSee\n\n    https://bugzilla.kernel.org/show_bug.cgi?id=121701\n\nfor the bug report.\n\nI'm not seeing how that could *possibly* happen,  but if it indeed is\nthat strbuf code, maybe it could print out the function name (there\nare two different cases) and values so give a hint about where/how\nthis happens..\n\nOf course, since the bug report isn't an exact quote anyway, maybe\nthat wouldn't have helped anyway. I asked for more information.\n\n           Linus\n"},{"id":"291145","messageId":"87eg712v5o.fsf@linux-m68k.org","threadId":"42815","inReplyTo":"CA+55aFz=sZnABJr6F2yF_xvx6J6fZod6BbiL2OwszEnjjn-dEw@mail.gmail.com","subject":"Re: Odd git overrflow bug?","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2016-07-10T18:41:07Z","receivedAt":"2016-07-10T18:41:19Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Linus Torvalds <torvalds@linux-foundation.org> writes:\n\n> We have an odd bug report in the kernel, where somebody had trouble\n> bisecting all the way due to\n>\n>   \"git is failing with \"you are trying to use to much memory\"(?!)\"\n>\n> which can't be an exact  error message quote, but the closest I can\n> find smells like the \"unsigned_add_overflows()\" check in the strbuf\n> code. Very odd.\n\nI've seen that too, but only at the end of bisection, when it tries to\ndisplay the bad commit.\n\nFor example, when running git bisect on git://gcc.gnu.org/git/gcc:\n\n$ git bisect start de4fa746271d39d490b59bdfbbdd2cf5b54c0521 dd58bf212e9a250300e64d78748418b01d0035cd\nBisecting: 0 revisions left to test after this (roughly 0 steps)\n[f529d395184700e2404f4a293a2198355ab7ded5] Daily bump.\n$ git bisect good\nde4fa746271d39d490b59bdfbbdd2cf5b54c0521 is the first bad commit\ncommit de4fa746271d39d490b59bdfbbdd2cf5b54c0521\nfatal: you want to use way too much memory\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"291146","messageId":"CA+55aFyJP8FLaBtsMekzQDsCjDbFPa-qUZNHZNpvva2vZTRGgQ@mail.gmail.com","threadId":"42815","inReplyTo":"87eg712v5o.fsf@linux-m68k.org","subject":"Re: Odd git overrflow bug?","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2016-07-10T21:01:22Z","receivedAt":"2016-07-10T21:01:28Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"On Sun, Jul 10, 2016 at 11:41 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:\n>\n> I've seen that too, but only at the end of bisection, when it tries to\n> display the bad commit.\n\nThat's apparently what the kernel bug reporter sees too now.\n\nHowever, I cannot reproduce the problem with the particular kernel\nbisect that the reporter is using. Judging by what he bisected things\ndown to, he must have done\n\n    git bisect start\n    git bisect bad 7ed18e2d1b6782989eb399ef79a8cc1a1b583b3c\n    git bisect good 7ed18e2d1b6782989eb399ef79a8cc1a1b583b3c^\n    git bisect good\n    git bisect bad\n\nbut that works fine for me.\n\n[ Oops. I tested something. It works for me with current git, but with\ngit-2.9.0 I get the failure ].\n\nI'll try to figure out why git-2.9.0 fails.\n\n               Linus\n"},{"id":"291147","messageId":"CA+55aFymKO5Bi2qZ-zaiZKQAk7RxusEMJ9Y0Gw6ywdznK+TaRQ@mail.gmail.com","threadId":"42815","inReplyTo":"CA+55aFyJP8FLaBtsMekzQDsCjDbFPa-qUZNHZNpvva2vZTRGgQ@mail.gmail.com","subject":"Re: Odd git overrflow bug?","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2016-07-10T21:05:55Z","receivedAt":"2016-07-10T21:06:00Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"On Sun, Jul 10, 2016 at 2:01 PM, Linus Torvalds\n<torvalds@linux-foundation.org> wrote:\n>\n> I'll try to figure out why git-2.9.0 fails.\n\nI'm getting \"extra\" being -1 in strbuf_grow(). Let me dog deeper.\n\n           Linus\n"},{"id":"291149","messageId":"CA+55aFwvZqqSkphgL+UBqfXnSGAFEzmqyH83OMGnpco3ZVZUnA@mail.gmail.com","threadId":"42815","inReplyTo":"CA+55aFymKO5Bi2qZ-zaiZKQAk7RxusEMJ9Y0Gw6ywdznK+TaRQ@mail.gmail.com","subject":"Re: Odd git overrflow bug?","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2016-07-10T21:21:05Z","receivedAt":"2016-07-10T21:21:12Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"On Sun, Jul 10, 2016 at 2:05 PM, Linus Torvalds\n<torvalds@linux-foundation.org> wrote:\n>\n> I'm getting \"extra\" being -1 in strbuf_grow(). Let me dog deeper.\n\n\"dog deeper\"? My typing skills are deteriorating.\n\nAnyway, I dug deeper, and the reason is that \"tabwidth\" is -1, and then\n\n pretty.c:1669: strbuf_add_tabexpand():\n\n        strbuf_addchars(sb, ' ', tabwidth - (width % tabwidth));\n\nends up having the number be -1.\n\nI'm not sure why it doesn't happen in current git master, because that\nfunction is the same, and the logic around expand_tabs_in_log looks\nsimilar too.\n\nThat all came from\n\n    fe37a9c586a6 (:pretty: allow tweaking tabwidth in --expand-tabs\")\n\nand I suspect the code just needs to protect against negative or zero,\nrather than just zero.\n\nJunio?\n\n              Linus\n"},{"id":"291150","messageId":"CA+55aFx=qT9mNo1MDkQuzB=V7=STSc_Knmj=6589qi=tSZs1ag@mail.gmail.com","threadId":"42815","inReplyTo":"CA+55aFwvZqqSkphgL+UBqfXnSGAFEzmqyH83OMGnpco3ZVZUnA@mail.gmail.com","subject":"Re: Odd git overrflow bug?","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2016-07-10T21:29:46Z","receivedAt":"2016-07-10T21:29:53Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"On Sun, Jul 10, 2016 at 2:21 PM, Linus Torvalds\n<torvalds@linux-foundation.org> wrote:\n>\n> I'm not sure why it doesn't happen in current git master, because that\n> function is the same, and the logic around expand_tabs_in_log looks\n> similar too.\n\nAhh. Commit 43ec55091553 (\"bisect: always call setup_revisions after\ninit_revisions\") is in master, but not in v2.9.0\n\n            Linus\n"},{"id":"291151","messageId":"CAPc5daUAfFJisFySuX1XgoufkaX7sSeSpW+vJ1ZG7Fia=Z9DLw@mail.gmail.com","threadId":"42815","inReplyTo":"CA+55aFx=qT9mNo1MDkQuzB=V7=STSc_Knmj=6589qi=tSZs1ag@mail.gmail.com","subject":"Re: Odd git overrflow bug?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-07-10T21:52:37Z","receivedAt":"2016-07-10T21:53:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"On Sun, Jul 10, 2016 at 2:29 PM, Linus Torvalds\n<torvalds@linux-foundation.org> wrote:\n> On Sun, Jul 10, 2016 at 2:21 PM, Linus Torvalds\n> <torvalds@linux-foundation.org> wrote:\n>>\n>> I'm not sure why it doesn't happen in current git master, because that\n>> function is the same, and the logic around expand_tabs_in_log looks\n>> similar too.\n>\n> Ahh. Commit 43ec55091553 (\"bisect: always call setup_revisions after\n> init_revisions\") is in master, but not in v2.9.0\n\nYes, leaving it in 'master' a while and then merging it down to\n'maint' for v2.9.x series\nis the plan as usual. Thanks for noticing and following up.\n"}]}