assert failed in pathspec.c
Hi all,
I've got an assertion error when git add .
git: pathspec.c:317: prefix_pathspec: Assertion `item->nowildcard_len <= item->len && item->prefix <= item->len' failed.
Aborted (core dumped)
I think the repo doesn't have anything interesting. No submodules or subrepos. It's like:
repo/
.gitignore
.git/
scripts/
.gitignore
foo.py
bar.json
something/
someanother/
other/ (gitignored)
scripts.git/ (original .git for scripts/)
foo.txt
With
modified: ../something/a.txt modified: ../someanother/b.txt
...
Working directory is repo/scripts.
I think the bug is related to this post: [assert failed in submodule edge case](https://marc.info/?l=git&m=142894416621088&w=2).
(gdb) r
Starting program: /home/gumble/software/git-master/git-add . [Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
git-add: pathspec.c:317: prefix_pathspec: Assertion `item->nowildcard_len <= item->len && item->prefix <= item->len' failed.
Program received signal SIGABRT, Aborted. 0x00007ffff6fc8507 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
55 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff6fc8507 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#1 0x00007ffff6fc98da in __GI_abort () at abort.c:89 #2 0x00007ffff6fc159d in __assert_fail_base (fmt=0x7ffff70fe6b8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=assertion@entry=0x56ffe0 "item->nowildcard_len <=
item->len && item->prefix <= item->len", file=file@entry=0x5701a6
"pathspec.c", line=line@entry=317,
function=function@entry=0x5701d0 <__PRETTY_FUNCTION__.22386>"prefix_pathspec") at assert.c:92
#3 0x00007ffff6fc1652 in __GI___assert_fail (assertion=assertion@entry=0x56ffe0 "item->nowildcard_len <= item->len && item->prefix <= item->len", file=file@entry=0x5701a6 "pathspec.c",
line=line@entry=317, function=function@entry=0x5701d0
<__PRETTY_FUNCTION__.22386> "prefix_pathspec") at assert.c:101 #4 0x00000000004deb3e in prefix_pathspec (elt=0x7fffffffe3f5 ".", prefixlen=8, prefix=0x7e71f3 "scripts/", flags=50, raw=0x7fffffffe0a0, p_short_magic=<synthetic pointer>, item=<optimized out>)
at pathspec.c:316
#5 parse_pathspec (pathspec=pathspec@entry=0x7fffffffd530, magic_mask=magic_mask@entry=0, flags=flags@entry=50, prefix=prefix@entry=0x7e71f3 "scripts/", argv=argv@entry=0x7fffffffe0a0) at pathspec.c:417
#6 0x0000000000406423 in cmd_add (argc=<optimized out>, argv=0x7fffffffe0a0, prefix=0x7e71f3 "scripts/") at builtin/add.c:364 #7 0x0000000000405cc8 in run_builtin (argv=0x7fffffffe098, argc=2, p=0x7b2520 <commands>) at git.c:352
#8 handle_builtin (argc=2, argv=0x7fffffffe098) at git.c:542 #9 0x0000000000404e7a in main (argc=2, av=<optimized out>) at git.c:665
--
Dingyuan Wang
On 02/11/2016 04:59 AM, Dingyuan Wang wrote:
[]
Thanks for the bug report.
What does
git --version
give you ?
And what happens, if you run the latest version of Git ?
git version 2.7.0.GIT (latest git master)
Sorry, I have found out that this problem is exactly the same as the previous post I mentioned.
When I created the repo, scripts/ was a subrepo, and then I moved scripts/.git out. If I add files in the scripts/ dir, SIGABRT.
Quoted 11 lines · Torsten Bögershausen
On 02/11/2016 04:59 AM, Dingyuan Wang wrote:
[]Thanks for the bug report.
What does
git --version
give you ?And what happens, if you run the latest version of Git ?
Signature · 1 line
Dingyuan Wang
Quoted 7 lines · Dingyuan Wang
Hi all,
I've got an assertion error when
git add .git: pathspec.c:317:
prefix_pathspec: Assertion `item->nowildcard_len <=item->len&&item->prefix<=item->len' failed.
Aborted (core dumped)
Sounds like http://article.gmane.org/gmane.comp.version-control.git/283549
Quoted 73 lines
I think the repo doesn't have anything interesting. No submodules or subrepos. It's like:
repo/
.gitignore
.git/
scripts/
.gitignore
foo.py
bar.json
something/
someanother/
other/ (gitignored)
scripts.git/ (original .git forscripts/)
foo.txtWith
modified: ../something/a.txt modified: ../someanother/b.txt...
Working directory is repo/scripts.
I think the bug is related to this post: [assert failed in submodule edge case](https://marc.info/?l=git&m=142894416621088&w=2).
(gdb) r
Starting program:/home/gumble/software/git-master/git-add. [Thread debugging usinglibthread_dbenabled]
Using hostlibthread_dblibrary "/lib/x86_64-linux-gnu/libthread_db.so.1".
git-add: pathspec.c:317:prefix_pathspec: Assertion `item->nowildcard_len <=item->len&&item->prefix<=item->len' failed.Program received signal SIGABRT, Aborted.
0x00007ffff6fc8507in__GI_raise(sig=sig@entry=6) at../sysdeps/unix/sysv/linux/raise.c:55
55../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#00x00007ffff6fc8507in__GI_raise(sig=sig@entry=6) at../sysdeps/unix/sysv/linux/raise.c:55
#10x00007ffff6fc98dain__GI_abort() at abort.c:89 #20x00007ffff6fc159din__assert_fail_base(fmt=0x7ffff70fe6b8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",assertion=assertion@entry=0x56ffe0 "item->nowildcard_len <= item->len && item->prefix <= item->len", file=file@entry=0x5701a6 "pathspec.c", line=line@entry=317, function=function@entry=0x5701d0 <__PRETTY_FUNCTION__.22386>"
prefix_pathspec") at assert.c:92
#30x00007ffff6fc1652in__GI___assert_fail(assertion=assertion@entry=0x56ffe0 "item->nowildcard_len<=item->len&&item->prefix<=item->len", file=file@entry=0x5701a6 "pathspec.c",line=line@entry=317, function=function@entry=0x5701d0<__PRETTY_FUNCTION__.22386> "
prefix_pathspec") at assert.c:101 #40x00000000004deb3einprefix_pathspec(elt=0x7fffffffe3f5 ".", prefixlen=8, prefix=0x7e71f3 "scripts/", flags=50, raw=0x7fffffffe0a0, p_short_magic=<synthetic pointer>, item=<optimized out>)at pathspec.c:316#5
parse_pathspec(pathspec=pathspec@entry=0x7fffffffd530, magic_mask=magic_mask@entry=0, flags=flags@entry=50, prefix=prefix@entry=0x7e71f3 "scripts/", argv=argv@entry=0x7fffffffe0a0) at pathspec.c:417
#60x0000000000406423incmd_add(argc=<optimized out>, argv=0x7fffffffe0a0, prefix=0x7e71f3 "scripts/") atbuiltin/add.c:364#70x0000000000405cc8inrun_builtin(argv=0x7fffffffe098, argc=2, p=0x7b2520 <commands>) at git.c:352
#8handle_builtin(argc=2, argv=0x7fffffffe098) at git.c:542 #90x0000000000404e7ain main (argc=2, av=<optimized out>) at git.c:665--
Dingyuan Wang