Re: regression in 92392b4

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Shawn O. Pearce
Date: Tuesday, July 22, 2008 - 5:41 pm

Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
...
...

Oh.  This is a pointless assignment.  If you look at any call sites
for unlink_base_data() you will find that the struct passed in as
"c" here is going out of scope after unlink_base_data() returns.  In
no such case does the value of c->data get tested once this free is
complete.

We need the if (c->data) guard because we only want to decrement
base_cache_used if the memory is still allocated.  It may have been
released earlier, in which case base_cache_used has already been
decreased and we don't want to double-decrement it.

This patch makes the code more obvious, so Ack I guess, but it is
not a solution to Pierre's woes.  Something else is wrong.

Reading above shows we got a "fatal: Out of memory, malloc failed"
right before the segfault.  What's odd is we segfaulted after we
ran out of memory and should have die'd.

There's at least two bugs in the above output:

a) index-pack ran out of memory on a small pull (95 KiB).
b) fetch segfaulted when index-pack failed.

And this patch will unfortunately address neither of them.  :-|

I've had a long past couple of days, and another one tomorrow.
I'm not going to be able to debug this myself until perhaps Thursday
or Friday.  Sorry.  If nobody beats me to it, I will put this on
the top of the pile and try to fix it once I get back online at my
new home.

-- 
Shawn.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
regression in 92392b4, Pierre Habouzit, (Tue Jul 22, 4:17 pm)
Re: regression in 92392b4, Johannes Schindelin, (Tue Jul 22, 4:34 pm)
Re: regression in 92392b4, Pierre Habouzit, (Tue Jul 22, 4:37 pm)
Re: regression in 92392b4, Shawn O. Pearce, (Tue Jul 22, 5:41 pm)
Re: regression in 92392b4, Johannes Schindelin, (Tue Jul 22, 5:58 pm)
Re: regression in 92392b4, Pierre Habouzit, (Tue Jul 22, 6:09 pm)
Re: regression in 92392b4, Johannes Schindelin, (Tue Jul 22, 6:20 pm)
Re: regression in 92392b4, Björn, (Wed Jul 23, 3:14 am)
Re: regression in 92392b4, Pierre Habouzit, (Wed Jul 23, 3:22 am)
Re: regression in 92392b4, Pierre Habouzit, (Wed Jul 23, 3:38 am)
Re: regression in 92392b4, Johannes Schindelin, (Wed Jul 23, 3:49 am)
Re: regression in 92392b4, Björn, (Wed Jul 23, 3:56 am)
Re: regression in 92392b4, Pierre Habouzit, (Wed Jul 23, 4:19 am)
Re: regression in 92392b4, Johannes Schindelin, (Wed Jul 23, 4:37 am)
Re: regression in 92392b4, Pierre Habouzit, (Wed Jul 23, 4:50 am)
Re: regression in 92392b4, Björn, (Wed Jul 23, 5:00 am)
[PATCH] index-pack: never prune base_cache., Pierre Habouzit, (Wed Jul 23, 5:11 am)
Re: [PATCH] index-pack: never prune base_cache., Johannes Schindelin, (Wed Jul 23, 6:09 am)
Re: [PATCH] index-pack: never prune base_cache., Pierre Habouzit, (Wed Jul 23, 6:20 am)
Re: [PATCH] index-pack: never prune base_cache., Johannes Schindelin, (Wed Jul 23, 6:46 am)
Re: [PATCH] index-pack: never prune base_cache., Johannes Schindelin, (Wed Jul 23, 7:41 am)
Re: [PATCH] index-pack: never prune base_cache., Pierre Habouzit, (Wed Jul 23, 8:30 am)