Re: [PATCH 2/3] pack-objects (mingw): demonstrate a segmentation fault with large deltas
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Oct 16, 2018, 23:43 UTC
- Message-ID
- <20181016234315.GG432229@genre.crustytoothpaste.net>
- In-Reply-To
- <eb6d10133ac9b1977db81ff9c243e77639226f85.1539723766.git.gitgitgadget@gmail.com>
On Tue, Oct 16, 2018 at 02:02:50PM -0700, Johannes Schindelin via GitGitGadget wrote:
Show 8 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de> > > There is a problem in the way 9ac3f0e5b3e4 (pack-objects: fix > performance issues on packing large deltas, 2018-07-22) initializes that > mutex in the `packing_data` struct. The problem manifests in a > segmentation fault on Windows, when a mutex (AKA critical section) is > accessed without being initialized. (With pthreads, you apparently do > not really have to initialize them?)
This is a good catch. You do have to initialize a pthread mutex, but on amd64 Linux the default initializer is all zeros, so since we use a static variable, it happens to coincidentally have the right value, so we don't notice.
Thanks for fixing this.
-- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204