Feh/nocache

undesired side effects on git

Closed this issue · 6 comments

Hi,

trying following:

git clone https://github.com/Feh/nocache.git
cd nocache
nocache git pull

gives:

error: git-remote-https died of signal 11
Already up-to-date.

Replacing the clone url "https://" by "git://" makes the error to disappear. Any clue how nocache causes this?

Feh commented

Hi, to clarify, I can reproduce that issue on a recent Debian (with make && ./nocache git pull). I’ll take a look.

Feh commented

The segfault appears to happen only occasionally and in different parts (i.e. different forked commands from git pull crash). Currently I suspect a race condition between the library destructor and the program’s exit routines (I’ve verified the crashes go away by deleting the destroy() function contents). The way the mutex protects the fds[] data structure is … let’s say brittle, and not a good choice. I’m thinking about completely rewriting that part of the code.

Feh commented

I think my inkling was right. I revamped the way in which locks are handled, and can’t reproduce the issue any more. Could you check out the commit in branch hierarchial_lock_structure and see if it fixes the issue on your end, too? Thanks.

1f4c9ea seems to fix crashes in both git-annex and gnutls-cli.

@Feh, thanks, git seems to work without the error now.

Feh commented

Thank you both for reporting this and the prompt feedback! I’ve merged the fix to the master branch and tagged it as a new version.