git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: Son Luong Ngoc <sluongng@gmail.com>
Cc: git <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: Git Stash brake splitIndex
Date: Tue, 28 Apr 2020 15:57:41 +0200	[thread overview]
Message-ID: <CAP8UFD32D4WnSbpB1erMTidFpinCNwzqHG_fsyHqRmWgZpsSjA@mail.gmail.com> (raw)
In-Reply-To: <EED2CFF1-5BEF-429D-AB99-AD148A867614@gmail.com>

Hi,

On Tue, Apr 28, 2020 at 3:21 PM Son Luong Ngoc <sluongng@gmail.com> wrote:

> I am on git version 2.26.2.526.g744177e7f7 (latest next)
> When you do a git stash while using splitIndex, it seems like the index will get corrupted
>
> Using configs:
> core.splitindex=true
> splitindex.maxpercentchange=50
> splitindex.sharedindexexpire=now
>
> Reproduce steps:
>
> mkdir repo
> cd repo && git init
> echo a > a
> commit -a -m 'add a'

It looks like it should be `git commit -a -m 'add a'`

When I try to reproduce the steps using git version 2.26.2.526.g744177e7f7:

mkdir repo
cd repo && git init
git config core.splitindex true
git config splitindex.maxpercentchange 50
git config splitindex.sharedindexexpire now
echo a > a
git commit -a -m 'add a'

I get a segfault then:

Program received signal SIGSEGV, Segmentation fault.
0x00005555556ccf89 in ewah_each_bit (self=0x0, callback=0x5555557af648
<replace_entry>, payload=0x555555b47480 <the_index>)
    at ewah/ewah_bitmap.c:252
252             while (pointer < self->buffer_size) {
(gdb) bt
#0  0x00005555556ccf89 in ewah_each_bit (self=0x0,
callback=0x5555557af648 <replace_entry>, payload=0x555555b47480
<the_index>)
    at ewah/ewah_bitmap.c:252
#1  0x00005555557af90c in merge_base_index (istate=0x555555b47480
<the_index>) at split-index.c:162
#2  0x0000555555748b9f in read_index_from (istate=0x555555b47480
<the_index>, path=0x555555b4cd80 ".git/index",
    gitdir=0x555555b4ac20 ".git") at read-cache.c:2335
#3  0x000055555576faf3 in repo_read_index (repo=0x555555b33f20
<the_repo>) at repository.c:271
#4  0x000055555559b91b in prepare_to_commit (index_file=0x555555b4d760
"/tmp/git/repo/.git/index.lock", prefix=0x0,
    current_head=0x0, s=0x555555b04420 <s>,
author_ident=0x7fffffffd810) at builtin/commit.c:927
#5  0x000055555559d6a4 in cmd_commit (argc=0, argv=0x7fffffffdcf0,
prefix=0x0) at builtin/commit.c:1595
#6  0x0000555555570fda in run_builtin (p=0x555555af1218
<commands+504>, argc=4, argv=0x7fffffffdcf0) at git.c:447
#7  0x000055555557134b in handle_builtin (argc=4, argv=0x7fffffffdcf0)
at git.c:672
#8  0x0000555555571610 in run_argv (argcp=0x7fffffffdb9c,
argv=0x7fffffffdb90) at git.c:739
#9  0x0000555555571aba in cmd_main (argc=4, argv=0x7fffffffdcf0) at git.c:870
#10 0x0000555555641bc4 in main (argc=5, argv=0x7fffffffdce8) at common-main.c:52

It looks like merge_base_index() in split-index.c is calling
ewah_each_bit(si->replace_bitmap, replace_entry, istate) when
si->replace_bitmap is NULL.

  reply	other threads:[~2020-04-28 13:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 13:19 Git Stash brake splitIndex Son Luong Ngoc
2020-04-28 13:57 ` Christian Couder [this message]
2020-04-28 14:17   ` Son Luong Ngoc
2020-05-04 10:26 ` Alban Gruin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAP8UFD32D4WnSbpB1erMTidFpinCNwzqHG_fsyHqRmWgZpsSjA@mail.gmail.com \
    --to=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sluongng@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).