# Segfault in git 1.8.1.5

4 messages from 2013-03-09 to 2013-03-09. Participants: Strasser Pablo, Dennis Kaarsemaker, Junio C Hamano.
Thread: https://gitlist.dev/t/33139

## Strasser Pablo, 2013-03-09 20:16

Subject: Segfault in git 1.8.1.5
Message-ID: <2078462.OF4zRmv4ar@pablohp>
URL: https://gitlist.dev/e/2078462.OF4zRmv4ar%40pablohp

```
Hello,

I segfault with the following command:

git checkout HEAD~1
git branch -u origin/master

I think it's because i'm in detached head.
A error message like cannot use this command in would be a better responce 
than a segfault.

Good day.

```

## Dennis Kaarsemaker, 2013-03-09 21:13

Subject: Re: Segfault in git 1.8.1.5
Message-ID: <1362863609.29502.4.camel@localhost>
URL: https://gitlist.dev/e/1362863609.29502.4.camel%40localhost
In-Reply-To: <2078462.OF4zRmv4ar@pablohp>

```
On za, 2013-03-09 at 21:16 +0100, Strasser Pablo wrote:
> Hello,
> 
> I segfault with the following command:
> 
> git checkout HEAD~1
> git branch -u origin/master
> 
> I think it's because i'm in detached head.
> A error message like cannot use this command in would be a better responce 
> than a segfault.

Confirmed.

dennis@lightning:/tmp/hacks$ gdb --args ~/code/git/git branch -u origin/master
(gdb) run
Starting program: /home/dennis/code/git/git branch -u origin/master
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
cmd_branch (argc=0, argv=0xbfffec08, prefix=0x0) at builtin/branch.c:886
886			if (!ref_exists(branch->refname))
(gdb) bt
#0  cmd_branch (argc=0, argv=0xbfffec08, prefix=0x0) at builtin/branch.c:886
#1  0x0804c26c in run_builtin (argv=0xbfffec08, argc=3, p=0x819f3f4 <commands.21695+84>) at git.c:273
#2  handle_internal_command (argc=3, argv=0xbfffec08) at git.c:435
#3  0x0804b656 in run_argv (argv=0xbfffeb74, argcp=0xbfffeb70) at git.c:481
#4  main (argc=3, argv=0xbfffec08) at git.c:556

But it's already been fixed by 8efb889: branch: segfault fixes and
validation. 
-- 
Dennis Kaarsemaker
www.kaarsemaker.net

```

## Junio C Hamano, 2013-03-09 21:16

Subject: Re: Segfault in git 1.8.1.5
Message-ID: <7vboase0jw.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vboase0jw.fsf%40alter.siamese.dyndns.org
In-Reply-To: <2078462.OF4zRmv4ar@pablohp>

```
Strasser Pablo <strasserpablo@bluewin.ch> writes:

> I segfault with the following command:
>
> git checkout HEAD~1
> git branch -u origin/master

A patch to address this in cooking in 'next', and is expected to be
in 1.8.2.1 or later.

```

## Strasser Pablo, 2013-03-09 21:31

Subject: Re: Segfault in git 1.8.1.5
Message-ID: <5706456.gdNEU5j7WE@pablohp>
URL: https://gitlist.dev/e/5706456.gdNEU5j7WE%40pablohp
In-Reply-To: <7vboase0jw.fsf@alter.siamese.dyndns.org>

```
On Saturday 09 March 2013 13.16:35 Junio C Hamano wrote:
> Strasser Pablo <strasserpablo@bluewin.ch> writes:
> > I segfault with the following command:
> > 
> > git checkout HEAD~1
> > git branch -u origin/master
> 
> A patch to address this in cooking in 'next', and is expected to be
> in 1.8.2.1 or later.

Ok thanks.

```
