Crash listing git files on mounted cifs share · Issue #4000 · libgit2/libgit2 · GitHub
Skip to content

Crash listing git files on mounted cifs share #4000

Description

@dhaumann

This is an issue that was reported against the Kate text editor here:
https://bugs.kde.org/show_bug.cgi?id=372196

The bug report says:

I just tried to open a shell script on a mounted shared. Kate simply crashed.
[...] The same file opens nicely if copied to local FS.
The crash can be reproduced every time.

The important parts of the backtrace:

Thread 15 (Thread 0x7fb271e86700 (LWP 31811)):
[KCrash Handler]
#6  0x00007fb2a5bb5956 in strlen () from /lib64/libc.so.6
#7  0x00007fb2a5b7e323 in vfprintf () from /lib64/libc.so.6
#8  0x00007fb2a5c2b366 in __vsnprintf_chk () from /lib64/libc.so.6
#9  0x00007fb2a53dbe60 in vsnprintf (__ap=0x7fb271e85240, __fmt=0x7fb2a547663f "Could not read directory '%s'", __n=<optimized out>, __s=<optimized out>) at /usr/include/bits/stdio2.h:77
#10 git_buf_vprintf (buf=buf@entry=0x7fb26c00d5d8, format=format@entry=0x7fb2a547663f "Could not read directory '%s'", ap=ap@entry=0x7fb271e85290) at /usr/src/debug/libgit2-0.24.1/src/buffer.c:379
#11 0x00007fb2a53fe0b4 in giterr_set (error_class=error_class@entry=2, string=string@entry=0x7fb2a547663f "Could not read directory '%s'") at /usr/src/debug/libgit2-0.24.1/src/errors.c:62
#12 0x00007fb2a543418d in git_path_diriter_next (diriter=diriter@entry=0x7fb271e85420) at /usr/src/debug/libgit2-0.24.1/src/path.c:1316
#13 0x00007fb2a54179f0 in dirload_with_stat (fi=0x7fb26c015a70, contents=0x7fb26c013e48) at /usr/src/debug/libgit2-0.24.1/src/iterator.c:1256
#14 fs_iterator__expand_dir (fi=fi@entry=0x7fb26c015a70) at /usr/src/debug/libgit2-0.24.1/src/iterator.c:1363
#15 0x00007fb2a5417e45 in fs_iterator__advance_into (entry=0x7fb271e85580, iter=0x7fb26c015a70) at /usr/src/debug/libgit2-0.24.1/src/iterator.c:1432
#16 0x00007fb2a53f2b1e in git_iterator_advance_into (iter=<optimized out>, entry=0x7fb271e85580) at /usr/src/debug/libgit2-0.24.1/src/iterator.h:181
#17 iterator_advance_into (iterator=<optimized out>, entry=0x7fb271e85580) at /usr/src/debug/libgit2-0.24.1/src/diff.c:975
#18 handle_unmatched_new_item (info=0x7fb271e85560, diff=0x7fb26c013d10) at /usr/src/debug/libgit2-0.24.1/src/diff.c:1086
#19 git_diff__from_iterators (diff_ptr=diff_ptr@entry=0x7fb26c015a38, repo=repo@entry=0x7fb26c00d3b0, old_iter=0x7fb26c014150, new_iter=0x7fb26c015a70, opts=opts@entry=0x7fb271e85710) at /usr/src/debug/libgit2-0.24.1/src/diff.c:1271
#20 0x00007fb2a53f3f82 in git_diff_index_to_workdir (diff=diff@entry=0x7fb26c015a38, repo=repo@entry=0x7fb26c00d3b0, index=<optimized out>, opts=opts@entry=0x7fb271e85710) at /usr/src/debug/libgit2-0.24.1/src/diff.c:1397
#21 0x00007fb2a5453345 in git_status_list_new (out=out@entry=0x7fb271e857c0, repo=0x7fb26c00d3b0, opts=opts@entry=0x0) at /usr/src/debug/libgit2-0.24.1/src/status.c:344
#22 0x00007fb2a5453501 in git_status_foreach_ext (repo=<optimized out>, opts=opts@entry=0x0, cb=cb@entry=0x7fb2832d8a50 <(anonymous namespace)::gitStatusListWalker(char const*, unsigned int, void*)>, payload=payload@entry=0x7fb271e85880) at /usr/src/debug/libgit2-0.24.1/src/status.c:424
#23 0x00007fb2a54535cd in git_status_foreach (repo=<optimized out>, cb=cb@entry=0x7fb2832d8a50 <(anonymous namespace)::gitStatusListWalker(char const*, unsigned int, void*)>, payload=payload@entry=0x7fb271e85880) at /usr/src/debug/libgit2-0.24.1/src/status.c:446
#24 0x00007fb2832d8ff0 in (anonymous namespace)::gitSearchStatusList (basedir=..., repo=<optimized out>) at /usr/src/debug/kate-16.08.2/addons/project/kateprojectworker.cpp:343
#25 KateProjectWorker::filesFromGit (this=this@entry=0x18d7390, dir=..., recursive=recursive@entry=true) at /usr/src/debug/kate-16.08.2/addons/project/kateprojectworker.cpp:406

The last traces in Kate before we go into libgit2 are:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions