-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
This supersedes #4737 which was misdiagnosed to be architecture-specific; in fact the segfault happens on all architectures.
$ mkdir build && cd build
$ cmake
$ make -j$(nproc)
$ while ./libgit2_clar -sthreads::diff >/dev/null; do true; done
Segmentation fault
Backtrace:
$ ulimit -c unlimited
$ while ./libgit2_clar -sthreads::diff >/dev/null; do true; done
Segmentation fault (core dumped)
$ cat /proc/sys/kernel/core_pattern
core
$ find /tmp -name core
[..redacted..]
/tmp/libgit2_tests_nQCj2Y/core
1
$ gdb ./libgit2_clar /tmp/libgit2_tests_nQCj2Y/core
GNU gdb (Debian 8.1-4) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./libgit2_clar...done.
[New LWP 6422]
[New LWP 6423]
[New LWP 6421]
[New LWP 6419]
[New LWP 6417]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./libgit2_clar -sthreads::diff'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 prefixcmp (str=0x7f28a000cf82 "\374\374\374\374\374\374u", str_n=18446744073709551614, prefix=0x326a43516e5f7375 <error: Cannot access memory at address 0x326a43516e5f7375>, icase=false)
at $HOME/libgit2/src/util.c:263
263 p = (unsigned char)*prefix++;
[Current thread is 1 (Thread 0x7f28a9a50700 (LWP 6422))]
(gdb) bt
#0 prefixcmp (str=0x7f28a000cf82 "\374\374\374\374\374\374u", str_n=18446744073709551614, prefix=0x326a43516e5f7375 <error: Cannot access memory at address 0x326a43516e5f7375>, icase=false)
at $HOME/libgit2/src/util.c:263
#1 0x0000562f411ac28e in git__prefixcmp (str=0x7f28a000cf81 "", prefix=0x326a43516e5f7374 <error: Cannot access memory at address 0x326a43516e5f7374>) at $HOME/libgit2/src/util.c:282
#2 0x0000562f410f5ab0 in git_attr_fnmatch__match (match=0x7f289c001500, path=0x7f28a9a4fa50) at $HOME/libgit2/src/attr_file.c:380
#3 0x0000562f41136363 in ignore_lookup_in_rules (ignored=0x7f28a0004a98, file=0x7f28a00025d0, path=0x7f28a9a4fa50) at $HOME/libgit2/src/ignore.c:443
#4 0x0000562f41136438 in git_ignore__lookup (out=0x7f28a0004a98, ignores=0x7f28a0000eb0, pathname=0x562f4134aa84 "", dir_flag=GIT_DIR_FLAG_TRUE) at $HOME/libgit2/src/ignore.c:467
#5 0x0000562f4114497c in filesystem_iterator_frame_push_ignores (iter=0x7f28a0000da0, frame_entry=0x0, new_frame=0x7f28a0004a50) at $HOME/libgit2/src/iterator.c:1151
#6 0x0000562f411450b8 in filesystem_iterator_frame_push (iter=0x7f28a0000da0, frame_entry=0x0) at $HOME/libgit2/src/iterator.c:1353
#7 0x0000562f41145fcf in filesystem_iterator_init (iter=0x7f28a0000da0) at $HOME/libgit2/src/iterator.c:1821
#8 0x0000562f4114631d in iterator_for_filesystem (out=0x7f28a9a4fdf8, repo=0x562f42c783c0, root=0x562f42c74c00 "/tmp/libgit2_tests_nQCj2Y/status/", index=0x562f42c78550, tree=0x0, type=GIT_ITERATOR_TYPE_WORKDIR,
options=0x7f28a9a4fd00) at $HOME/libgit2/src/iterator.c:1914
#9 0x0000562f4114646f in git_iterator_for_workdir_ext (out=0x7f28a9a4fdf8, repo=0x562f42c783c0, repo_workdir=0x562f42c74c00 "/tmp/libgit2_tests_nQCj2Y/status/", index=0x562f42c78550, tree=0x0, given_opts=0x7f28a9a4fdd0)
at $HOME/libgit2/src/iterator.c:1958
#10 0x0000562f4111e6b3 in git_iterator_for_workdir (out=0x7f28a9a4fdf8, repo=0x562f42c783c0, index=0x562f42c78550, tree=0x0, options=0x7f28a9a4fdd0) at $HOME/libgit2/src/iterator.h:142
#11 0x0000562f41121c09 in git_diff_index_to_workdir (out=0x7f28a9a4fe68, repo=0x562f42c783c0, index=0x562f42c78550, opts=0x7f28a9a4fe70) at $HOME/libgit2/src/diff_generate.c:1381
#12 0x0000562f410e8bbe in run_index_diffs (arg=0x562f42c7822c) at $HOME/libgit2/tests/threads/diff.c:98
#13 0x00007f28aeee4f2a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#14 0x00007f28ae03eedf in clone () from /lib/x86_64-linux-gnu/libc.so.6
Metadata
Metadata
Assignees
Labels
No labels