# malloc: *** error for object 0x1: pointer being freed was not allocated on MacOS with git 2.47.0

9 messages from 2024-11-15 to 2024-11-19. Participants: Attila Kerekes, René Scharfe, Junio C Hamano, Patrick Steinhardt, Philippe Blain.
Thread: https://gitlist.dev/t/62496

## Attila Kerekes, 2024-11-15 09:40

Subject: malloc: *** error for object 0x1: pointer being freed was not allocated on MacOS with git 2.47.0
Message-ID: <5FFE9429-7496-429F-BEC5-9D00C8409AC3@enrg8.com>
URL: https://gitlist.dev/e/5FFE9429-7496-429F-BEC5-9D00C8409AC3%40enrg8.com

```
Dear Maintainers!

See my bug report below:

What did you do before the bug happened? (Steps to reproduce your issue)

run the command:
  git maintenance start

What did you expect to happen? (Expected behavior)

git maintenance is started

What happened instead? (Actual behavior)

git(26100,0x1ffd63840) malloc: *** error for object 0x1: pointer being freed was not allocated

What's different between what you expected and what actually happened?

git maintenance jobs did not get set up, instead i got a malloc error

Anything else you want to add:

MacOS 15.1 (24B83) on M3 mac.

git installed with brew

the Apple provided git 2.39.5 works fine when I run git maintenance start.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.47.0
cpu: arm64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
libcurl: 8.7.1
zlib: 1.2.12
uname: Darwin 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:23 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6031 arm64
compiler info: clang: 16.0.0 (clang-1600.0.26.3)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/zsh


[Enabled Hooks]


Best Regards
Attila

```

## René Scharfe, 2024-11-15 16:34

Subject: Re: malloc: *** error for object 0x1: pointer being freed was not allocated on MacOS with git 2.47.0
Message-ID: <4ca84916-c5f5-4d52-8f6a-08b729bb66b8@web.de>
URL: https://gitlist.dev/e/4ca84916-c5f5-4d52-8f6a-08b729bb66b8%40web.de
In-Reply-To: <5FFE9429-7496-429F-BEC5-9D00C8409AC3@enrg8.com>

```
Am 15.11.24 um 10:40 schrieb Attila Kerekes:
> Dear Maintainers!
>
> See my bug report below:
>
> What did you do before the bug happened? (Steps to reproduce your issue)
>
> run the command:
>   git maintenance start
>
> What did you expect to happen? (Expected behavior)
>
> git maintenance is started
>
> What happened instead? (Actual behavior)
>
> git(26100,0x1ffd63840) malloc: *** error for object 0x1: pointer being freed was not allocated
>
> What's different between what you expected and what actually happened?
>
> git maintenance jobs did not get set up, instead i got a malloc error

This is a known error.  Commit c95547a394 (builtin/gc: fix crash when
running `git maintenance start`, 2024-10-10) fixes it, but has not made
it into a released version, yet.

René


```

## Junio C Hamano, 2024-11-15 17:23

Subject: Re: malloc: *** error for object 0x1: pointer being freed was not allocated on MacOS with git 2.47.0
Message-ID: <xmqq34js1kd2.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq34js1kd2.fsf%40gitster.g
In-Reply-To: <4ca84916-c5f5-4d52-8f6a-08b729bb66b8@web.de>

```
René Scharfe <l.s.r@web.de> writes:

> This is a known error.  Commit c95547a394 (builtin/gc: fix crash when
> running `git maintenance start`, 2024-10-10) fixes it, but has not made
> it into a released version, yet.

Thanks.

There are bunch of topics that could go to 'maint' and be part of a
maintenance topic, and this certainly looks like one of those topics
that can go into 2.47.1 someday.  The usual source of candidate
topics I use is messy and unusable for some unknown reason, but
offhand I think these are safe and sensible to merge down to
'maint':

    ds/line-log-asan-fix # 1 (2024-10-10) 
    jk/fsmonitor-event-listener-race-fix # 2 (2024-10-15) 
    ps/maintenance-start-crash-fix # 1 (2024-10-18) 

Thanks.

```

## Patrick Steinhardt, 2024-11-18 08:19

Subject: Re: malloc: *** error for object 0x1: pointer being freed was not allocated on MacOS with git 2.47.0
Message-ID: <Zzr4cgk_5MJNcHm1@pks.im>
URL: https://gitlist.dev/e/Zzr4cgk_5MJNcHm1%40pks.im
In-Reply-To: <xmqq34js1kd2.fsf@gitster.g>

```
On Sat, Nov 16, 2024 at 02:23:53AM +0900, Junio C Hamano wrote:
> René Scharfe <l.s.r@web.de> writes:
> 
> > This is a known error.  Commit c95547a394 (builtin/gc: fix crash when
> > running `git maintenance start`, 2024-10-10) fixes it, but has not made
> > it into a released version, yet.
> 
> Thanks.
> 
> There are bunch of topics that could go to 'maint' and be part of a
> maintenance topic, and this certainly looks like one of those topics
> that can go into 2.47.1 someday.  The usual source of candidate
> topics I use is messy and unusable for some unknown reason, but
> offhand I think these are safe and sensible to merge down to
> 'maint':
> 
>     ds/line-log-asan-fix # 1 (2024-10-10) 
>     jk/fsmonitor-event-listener-race-fix # 2 (2024-10-15) 
>     ps/maintenance-start-crash-fix # 1 (2024-10-18) 

Other candidates that fix regressions:

    jk/fetch-prefetch-double-free-fix
    tb/multi-pack-reuse-dupfix
    pb/clar-build-fix
    ps/upgrade-clar
    wm/shortlog-hash

I think that we have accumulated enough topics by now to warrant a
2.47.1 release, but will of course leave that decision to you.

Thanks!

Patrick

```

## Junio C Hamano, 2024-11-18 12:42

Subject: Re: malloc: *** error for object 0x1: pointer being freed was not allocated on MacOS with git 2.47.0
Message-ID: <xmqqjzd0k92c.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqjzd0k92c.fsf%40gitster.g
In-Reply-To: <Zzr4cgk_5MJNcHm1@pks.im>

```
Patrick Steinhardt <ps@pks.im> writes:

>>     ds/line-log-asan-fix # 1 (2024-10-10) 
>>     jk/fsmonitor-event-listener-race-fix # 2 (2024-10-15) 
>>     ps/maintenance-start-crash-fix # 1 (2024-10-18) 
>
> Other candidates that fix regressions:
>
>     jk/fetch-prefetch-double-free-fix
>     tb/multi-pack-reuse-dupfix

Neither of these has hit 'master' yet.

>     pb/clar-build-fix

Not all that urgent (it is not end-user facing).

>     ps/upgrade-clar
>     wm/shortlog-hash

Unfortuately, these were both based not on 'maint' but on 'master',
and cannot ever be merged down to 'maint'.  The last topic may
deserve to be cherry-picked to 'maint' when the time comes.

Right now I have these lined up for 'maint'

    ds/line-log-asan-fix
    jk/fsmonitor-event-listener-race-fix
    ps/maintenance-start-crash-fix
    ps/cache-tree-w-broken-index-entry
    db/submodule-fetch-with-remote-name-fix

Thanks.

```

## Patrick Steinhardt, 2024-11-18 13:07

Subject: Re: malloc: *** error for object 0x1: pointer being freed was not allocated on MacOS with git 2.47.0
Message-ID: <Zzs8JJO_HCLrEBM0@pks.im>
URL: https://gitlist.dev/e/Zzs8JJO_HCLrEBM0%40pks.im
In-Reply-To: <xmqqjzd0k92c.fsf@gitster.g>

```
On Mon, Nov 18, 2024 at 09:42:03PM +0900, Junio C Hamano wrote:
> Patrick Steinhardt <ps@pks.im> writes:
> >     ps/upgrade-clar
> >     wm/shortlog-hash
> 
> Unfortuately, these were both based not on 'maint' but on 'master',
> and cannot ever be merged down to 'maint'.  The last topic may
> deserve to be cherry-picked to 'maint' when the time comes.

We got several reports about build failures with clar on esoteric
platforms, and ps/upgrade-clar fixes those. Distro maintainers can of
course cherry-pick those patches, but I think it would make sense to
pull them into a maintenance release.

I am happy to  provide a backport for ps/upgrade-clar if you agree with
me.

Patrick

```

## Philippe Blain, 2024-11-18 19:28

Subject: Re: malloc: *** error for object 0x1: pointer being freed was not allocated on MacOS with git 2.47.0
Message-ID: <b09b16f5-4fa1-c802-86ac-9f0b1bcc9f53@gmail.com>
URL: https://gitlist.dev/e/b09b16f5-4fa1-c802-86ac-9f0b1bcc9f53%40gmail.com
In-Reply-To: <xmqqjzd0k92c.fsf@gitster.g>

```
Hi Junio,

Le 2024-11-18 à 07:42, Junio C Hamano a écrit :
> 
>>     pb/clar-build-fix
> 
> Not all that urgent (it is not end-user facing).

I'm not sure what you mean by "not end-user facing".
I ran into this issue while running 'make -j -l 2.5', 
as I mentioned when I sent the patch [1]. I guess you mean that
end-users do not normally build the code themselves ?

Cheers,

Philippe.

[1] https://lore.kernel.org/git/pull.1810.git.1728323033680.gitgitgadget@gmail.com/

```

## Junio C Hamano, 2024-11-18 23:51

Subject: Re: malloc: *** error for object 0x1: pointer being freed was not allocated on MacOS with git 2.47.0
Message-ID: <xmqqy11ghzi6.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqy11ghzi6.fsf%40gitster.g
In-Reply-To: <Zzs8JJO_HCLrEBM0@pks.im>

```
Patrick Steinhardt <ps@pks.im> writes:

> On Mon, Nov 18, 2024 at 09:42:03PM +0900, Junio C Hamano wrote:
>> Patrick Steinhardt <ps@pks.im> writes:
>> >     ps/upgrade-clar
>> >     wm/shortlog-hash
>> 
>> Unfortuately, these were both based not on 'maint' but on 'master',
>> and cannot ever be merged down to 'maint'.  The last topic may
>> deserve to be cherry-picked to 'maint' when the time comes.
>
> We got several reports about build failures with clar on esoteric
> platforms, and ps/upgrade-clar fixes those. Distro maintainers can of
> course cherry-pick those patches, but I think it would make sense to
> pull them into a maintenance release.
>
> I am happy to  provide a backport for ps/upgrade-clar if you agree with
> me.

I am primarily following the wish left by the interim maintainer.
If a fix was based on 'master', it was deemed not critical to be
downmerged to 'maint'.  Other fixes may have been forked from
'maint'.  Cherry-picking is a declaration that the initial choice
was a grave mistake, and I'd rather avoid that for a small thing
that are not critical to the end-users and only affects developers.

In addition, for those building themselves, I'd prefer to nudge them
to be on the latest release, and not backporting developer features
at fringe like testing is probably a sensible way to do so.

Cherry-picking I can handle myself if it is necessaary.  Accepting a
new patch from you would cost me more time than that ;-).

Thanks.

```

## Junio C Hamano, 2024-11-19 00:33

Subject: Re: malloc: *** error for object 0x1: pointer being freed was not allocated on MacOS with git 2.47.0
Message-ID: <xmqqh684hxjv.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqh684hxjv.fsf%40gitster.g
In-Reply-To: <b09b16f5-4fa1-c802-86ac-9f0b1bcc9f53@gmail.com>

```
Philippe Blain <levraiphilippeblain@gmail.com> writes:

> Hi Junio,
>
> Le 2024-11-18 à 07:42, Junio C Hamano a écrit :
>> 
>>>     pb/clar-build-fix
>> 
>> Not all that urgent (it is not end-user facing).
>
> I'm not sure what you mean by "not end-user facing".
> I ran into this issue while running 'make -j -l 2.5', 

Anything that needs to run "make" is by definition end-user facing
in my book ;-)

As I said in my reply to Patrick, I am primarily following the
decision made by the interim maintainer when the fix was queued.

Thanks.

```
