# Bug with `git branch HEAD` in a 'detached HEAD' state

2 messages from 2013-08-15 to 2013-08-15. Participants: Benoît Legat, Stefan Beller.
Thread: https://gitlist.dev/t/34705

## Benoît Legat, 2013-08-15 20:50

Subject: Bug with `git branch HEAD` in a 'detached HEAD' state
Message-ID: <520D3F2A.5020203@gmail.com>
URL: https://gitlist.dev/e/520D3F2A.5020203%40gmail.com

```
Hello everyone,

I think I have just found a bug in Git which basically occurs when I run 
`git log HEAD` in a detached HEAD state.
To reproduce it, just run
$ git init
...
$ touch tmp
...
$ git add tmp
$ git commit -m "tmp"
...
$ git checkout <commit_sha>
...
$ git branch HEAD
Segmentation fault (core dumped)

My version of git is the following
$ git --version
git version 1.8.1.2

If that helps (and even if it doesn't actually), I'm running ubuntu 
13.04 64-bit.

Benoît Legat

```

## Stefan Beller, 2013-08-15 20:58

Subject: Re: Bug with `git branch HEAD` in a 'detached HEAD' state
Message-ID: <520D40E9.1020000@googlemail.com>
URL: https://gitlist.dev/e/520D40E9.1020000%40googlemail.com
In-Reply-To: <520D3F2A.5020203@gmail.com>

```
On 08/15/2013 10:50 PM, Benoît Legat wrote:
> Hello everyone,
> 
> I think I have just found a bug in Git which basically occurs when I run
> `git log HEAD` in a detached HEAD state.
> To reproduce it, just run
> $ git init
> ...
> $ touch tmp
> ...
> $ git add tmp
> $ git commit -m "tmp"
> ...
> $ git checkout <commit_sha>
> ...
> $ git branch HEAD
> Segmentation fault (core dumped)
> 
> My version of git is the following
> $ git --version
> git version 1.8.1.2
> 
> If that helps (and even if it doesn't actually), I'm running ubuntu
> 13.04 64-bit.
> 
> Benoît Legat
> -- 
> 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


This should be fixed by 8efb8899cfe866dddb3659b9e0a94232161db65e
(2013-02-23, branch: segfault fixes and validation)

I could reproduce with 1.8.1.2, but not on current master branch.
If this annoys you too much, please update your git version. ;)

Stefan


```
