9 ms·
The commit that fixes this issue: https://github.com/gitster/git/commit/684dd4c2b414bcf648505e74498a608f28de4592 https://github.com/gitster/git/commit/684dd4c2
by stefan_ 6y ago
The commit that fixes this issue:
https://github.com/gitster/git/commit/684dd4c2b414bcf648505e74498a608f28de4592 https://github.com/gitster/git/commit/684dd4c2b414bcf648505e...
(Surprise, the root cause is a cache)
- softwaredoug 6y agoAnother cachelty
- medicineman 6y agoHe who would pun would pick a pocket.
- AbraKdabra 6y agoOh man...
- sethammons 6y agowell played. I think that just got added to my standard vocabulary. Caching has caused more errors and bugs that I've had to deal with than I can recall. My favorite was an off by one error where we returned nicely cached info -- just for the previous user who came through our system! :facepalm: That was a bad one.
- taf2 6y agoYeah but the speed.
- saganus 6y agoHere goes the obligatory > There are only two hard things in Computer Science...
- jholman 6y agoI can never remember what they are, though. To avoid this problem, I think I wrote them down on a post-it, but I had too many post-its on my desk so I got rid of them all, and now I can't remember.
- joubert 6y ago> wrote them down on a post-it You write it on local media and kept it on-premises? Cloud is the new thing, I hear.
- ampdepolymerase 6y agoThe Post-it was but a cache.
- mrathys 6y agoI would consider the Post-it as persistent storage or the backup. Your memory would be the cache :D
- llarsson 6y agoThe two most difficult ones are naming things, cache invalidation, and off-by-one errors. HTH. ;)
- deleted 6y ago[deleted]
- anyfoo 6y agoThat's because essentially, "state" and "caching" are the same thing on some level. And the problem with state is that you have to make sure all your state transitions don't cause bugs. What we know as a "cache" is essentially creating new state representing existing state, with all new transitions...
- bin_bash 6y agoCache is a type of state but not necessarily the other way around
- anyfoo 6y agoIn the efficient implementation of a pure functional language (say Haskell without MVars), what really is the difference between state and cache? I know this is overly philosophical, and in practical scenarios we readily (although not always unambiguously) differentiate between "cache" and "state", but the point about transitions and that being a major source of bugs still stands.
- eru 6y ago> In the efficient implementation of a pure functional language (say Haskell without MVars), what really is the difference between state and cache? If you want to unify state and cache, you might want to go down a different route: Think of log based filesystems (or a log based data base). Instead of defining your operations in terms of state, you define them as pure functions of the log. So your log is full of operations. Writing just means appending a symbolic operation like `write(key, value)` to your log. And you define the result of `read(key)`: scan backwards through the log until you hit the last instance of `write(x, value)` and the return that `value`. Now state means: compact your log by replacing a swath of `write` log entries with one big `snapshot` operation that encompasses many key/value pairs. Alternatively, you can also define state to mean caching your `read` operations. In this approach, it's no coincidence that the log is a data structure that has a linear shape: the evolution of state over time is also linear. (With some cleverness you can replace the linear structure with eg a DAG; and then also think about how you merge divergent states.)
- segfaultbuserr 6y agoDifficult problems in programming: (1) cache invalidation (2) off-by-one errors
- mattiasfestin 6y agoThe classical three problems.
- xarope 6y agoI thought the two hardest problems were: 1) naming 2) cache invalidation ... 3) off-by-one errors
- waheoo 6y agoI feel like we should have solved the naming problem as an industry by now. Alas.
- layer8 6y agoIt’s actually the hardest one of the three, being outside the grasp of formal methods.
- kreeben 6y agoTo solve this problem we would need to first understand the human mind, how it stores data, how it does computation, and how it interacts with names. So we would need the same set of information that we would need for creating AGI. A solution is probably only a couple of months/decades away.
- waheoo 6y agoI really have to disagree, why can't you devise a formal method? - a good name should be descriptive - avoid being overly clever, call a spade a spade - don't optimise for generalisation, naming things is a time to be specific - aim for short but not at the expense of losing context - avoid redundancy in naming of things nearby, leverage spatial context - avoid qualifiers or type information where possible - type should be obvious from context and use, if it's not qualify or refactor Anything else?
- slavik81 6y agoThey had this bug before in other code unrelated to caching. To me, that suggests a deeper root.
- pabs3 6y agoI wish folks who announce security issues would link to the patches for the issues they are announcing. This should become standard practice.
- de6u99er 6y agoStrange. The guy who fixed the issue works at Microsoft, but uses his gmx email for Github.
- deleted 6y ago[deleted]
- eru 6y agoI think you just got a glimpse of a vast sea of internal policy and compliance issues.
- balp 6y agoOr that the opensource hobby is much more longlived that something as temporary as an employer.
- enneff 6y agoAnd the guy who announced the new Git release works for Google, but uses his pobox.com email for Git development.
- Agentlien 6y agoI am really fascinated by the responses to this comment. So many people exclaiming how many issues are caused by caches. In ten years as a fulltime programmer the only cache issues I've seen are cache misses. It probably has to do with one's field. I'm a game developer mainly dealing with graphics programming.
- ironmagma 6y agoThe key problem (as I understand it) is that updating a cache properly requires knowing the exact graph of relations that an entry in the cache has to other entries. So that when that entry changes, you can propagate that change throughout the cache to other concerned entries which need to be recomputed. But knowing that exact graph is too complex a task to be trivial, it seems in this case. Basically it sounds like the non-visual version of rerendering UI when a state changes, which is hard enough even with visual feedback.
- josefx 6y agoA lot of threading issues are also cache related. Forget to properly mark access to shared variables and suddenly every thread /CPU core ends up with its own locally cached version of it.
- Agentlien 6y agoYes, but this is such a well understood danger that I've never really been bitten by it in practice. Along the same lines a lot of GPU programming tutorials warn of inconsistencies between threads and it has never been a problem since I just assume I cannot rely on consistency or order of execution, seeing each thread as separate and independent.
- brundolf 6y agoIt's amazing how often exploits come down to optimizations. The general form being "the domain logic is X, and is secure, but we faked around it in this one case to make it faster, and it turns out we made a bad assumption while doing so". Meltdown fits this description too.
- lixtra 6y ago> (Surprise, the root cause is a cache) Couldn’t it just as well be attributed to improper file path normalization? If we had only lower case ASCII file systems it would not have caused a problem.
- yxhuvud 6y agoThings can have more than one cause that act together.