Coder Social home page Coder Social logo

Comments (2)

yuyichao avatar yuyichao commented on July 27, 2024

A related issue and the root cause of the crash is that the cache loading process corrupts the memory when invalid cache is encountered and it may not be good enough to simply retry.

This happens because Cache::load stored a raw pointer from the sha buffer into the global cache (i.e. revsFiles). However, if the reads errors, the caller (Git::loadFileCache) does not keep this buffer alive so as soon as loadFileCache returns the cache is already corrupted and must not be looked at again (every keys in the hash table becomes invalid AFAICT). The solution to this problem would be to unconditionally preserve the shaBuf or revert all changes to the cache immediately.

It also seems that the reader of the shas does not check bound and simply forward the pointer by 41 bytes every cycle. A bounds check should probably be added...

from qgit.

yuyichao avatar yuyichao commented on July 27, 2024

And just for the reference, the cause for my corrupted cache file may be openning multiple qgit on the same checkout at the same time, or using complex options to filter the commits (--not, --branches, --remotes=*, etc) or a combination of both. Clearing the cache (or let qgit do it automatically with #103) fixes the problem and trying the command line options I've used before did not reproduce it.

In this case, the fresh cache file is 4.1kB whereas the old one was 1.8MB so the currupted one is clearly not just truncated.

from qgit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.