Re: Odd git overrflow bug?

6 messages, 3 authors, 2016-07-10 · open the first message on its own page

Re: Odd git overrflow bug?

From: Andreas Schwab <hidden>
Date: 2016-07-10 18:41:19

Linus Torvalds [off-list ref] writes:
We have an odd bug report in the kernel, where somebody had trouble
bisecting all the way due to

  "git is failing with "you are trying to use to much memory"(?!)"

which can't be an exact  error message quote, but the closest I can
find smells like the "unsigned_add_overflows()" check in the strbuf
code. Very odd.
I've seen that too, but only at the end of bisection, when it tries to
display the bad commit.

For example, when running git bisect on git://gcc.gnu.org/git/gcc:

$ git bisect start de4fa746271d39d490b59bdfbbdd2cf5b54c0521 dd58bf212e9a250300e64d78748418b01d0035cd
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[f529d395184700e2404f4a293a2198355ab7ded5] Daily bump.
$ git bisect good
de4fa746271d39d490b59bdfbbdd2cf5b54c0521 is the first bad commit
commit de4fa746271d39d490b59bdfbbdd2cf5b54c0521
fatal: you want to use way too much memory

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Re: Odd git overrflow bug?

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-07-10 21:01:28

On Sun, Jul 10, 2016 at 11:41 AM, Andreas Schwab [off-list ref] wrote:
I've seen that too, but only at the end of bisection, when it tries to
display the bad commit.
That's apparently what the kernel bug reporter sees too now.

However, I cannot reproduce the problem with the particular kernel
bisect that the reporter is using. Judging by what he bisected things
down to, he must have done

    git bisect start
    git bisect bad 7ed18e2d1b6782989eb399ef79a8cc1a1b583b3c
    git bisect good 7ed18e2d1b6782989eb399ef79a8cc1a1b583b3c^
    git bisect good
    git bisect bad

but that works fine for me.

[ Oops. I tested something. It works for me with current git, but with
git-2.9.0 I get the failure ].

I'll try to figure out why git-2.9.0 fails.

               Linus

Re: Odd git overrflow bug?

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-07-10 21:06:00

On Sun, Jul 10, 2016 at 2:01 PM, Linus Torvalds
[off-list ref] wrote:
I'll try to figure out why git-2.9.0 fails.
I'm getting "extra" being -1 in strbuf_grow(). Let me dog deeper.

           Linus

Re: Odd git overrflow bug?

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-07-10 21:21:12

On Sun, Jul 10, 2016 at 2:05 PM, Linus Torvalds
[off-list ref] wrote:
I'm getting "extra" being -1 in strbuf_grow(). Let me dog deeper.
"dog deeper"? My typing skills are deteriorating.

Anyway, I dug deeper, and the reason is that "tabwidth" is -1, and then

 pretty.c:1669: strbuf_add_tabexpand():

        strbuf_addchars(sb, ' ', tabwidth - (width % tabwidth));

ends up having the number be -1.

I'm not sure why it doesn't happen in current git master, because that
function is the same, and the logic around expand_tabs_in_log looks
similar too.

That all came from

    fe37a9c586a6 (:pretty: allow tweaking tabwidth in --expand-tabs")

and I suspect the code just needs to protect against negative or zero,
rather than just zero.

Junio?

              Linus

Re: Odd git overrflow bug?

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-07-10 21:29:53

On Sun, Jul 10, 2016 at 2:21 PM, Linus Torvalds
[off-list ref] wrote:
I'm not sure why it doesn't happen in current git master, because that
function is the same, and the logic around expand_tabs_in_log looks
similar too.
Ahh. Commit 43ec55091553 ("bisect: always call setup_revisions after
init_revisions") is in master, but not in v2.9.0

            Linus

Re: Odd git overrflow bug?

From: Junio C Hamano <hidden>
Date: 2016-07-10 21:53:02

On Sun, Jul 10, 2016 at 2:29 PM, Linus Torvalds
[off-list ref] wrote:
On Sun, Jul 10, 2016 at 2:21 PM, Linus Torvalds
[off-list ref] wrote:
quoted
I'm not sure why it doesn't happen in current git master, because that
function is the same, and the logic around expand_tabs_in_log looks
similar too.
Ahh. Commit 43ec55091553 ("bisect: always call setup_revisions after
init_revisions") is in master, but not in v2.9.0
Yes, leaving it in 'master' a while and then merging it down to
'maint' for v2.9.x series
is the plan as usual. Thanks for noticing and following up.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help