Re: [PATCH 1/3] packfile: factor out --pack_header argument parsing
- From
- Koakuma <koachan@protonmail.com>
- Date
- Jan 18, 2025, 16:57 UTC
- Message-ID
- <oyahQoMDgyHL5zm-JuAtwlkUM2gHqO67zs83WP5Cm2h07S0x_xt8m4CNiShDFe2epznxlJF3kC-X_g414dRhDdrko44xo_yfsDXq1esVYVo=@protonmail.com>
- In-Reply-To
- <20250118092351.GB3474411@coredump.intra.peff.net>
Jeff King <peff@peff.net> wrote:
Show 19 quoted lines
> Junio C Hamano wrote: > > Jeff King peff@peff.net writes: > > Interesting. So the file-scope static input_buffer[] sits in the > > BSS and happens to be well aligned not to cause the problem, but ... > > I suspect it is a problem, but either: > > - The OP's test case was small enough to trigger unpack-objects, not > index-pack. Possibly: > > git index-pack --stdin --pack_header=2,2 <no-header.pack > > would fail for them. > > - We simply got lucky with alignment based on the other things in BSS, > the whim of the compiler, etc. But it is an accident waiting to > happen. > > -Peff
That particular command doesn't seem to crash for me right now, but, as you said, that is probably just a lucky coincidence that the compiler happens to place the buffer on aligned memory.