Comments (4)
If you had just mentioned that there was a race condition somewhere in carmen-cache leading to invalid reads, I would have guessed that it was in coalesce
, which calls __get
(or __getTruncated
) in a thread other than the main thread, while the main thread might potentially be mutating the cache structures __get
would access, either with calls to unload
, or with calls to loadSync
which cause cache eviction (as the cache has a limited size). In particular, I think there's a race condition opportunity here between the cache membership check and the cache fetch in _get
, where if _get
is called from coalesce
it might be running in the thread pool, and in the intervening time the entry could get evicted or unloaded from the cache in the main thread.
But that's not what's going on here, if the crash is in the has
and _get
NAN_METHODs. has
, _get
, loadSync
, and unload
should all only get called from JS, so they should all be running on the main thread, and the latter two are the only things that might invalidate cache contents as far as I know, so I'm pretty confused as to how mutation could be occurring during a call to has
or _get
, as I don't think it should be possible for any of the mutating functions to be called at the same time as those two. It's super weird.
from carmen-cache.
Thank you for the thoughts! Right in this case neither of the asynchronous functions are being invoked (coalesce or merge). But i'll be digging into this more late tonight or tomorrow am to see if i can surface any more clues.
from carmen-cache.
Recapping: because this is so mysterious I suspect memory corruption is causing it (so the bug might be elsewhere and only manifesting in get/has calls because they are called so often and will fall prey to memory being messed up elsewhere). Therefore, my game plan is:
- Solve all the overflow issues flags by the sanitizers first: #75, #79 and #83
- Instrument libc++ with the address sanitizer
- Then revisit this test to try to replicate again.
from carmen-cache.
Recapping here:
Solve all the overflow issues flags by the sanitizers first: #75, #79 and #83
This was done in #86
Instrument libc++ with the address sanitizer
Still not go around to this. Ticketed at mapbox/mason#411
Then revisit this test to try to replicate again.
No plans to at this point. Going to hope that the actual bug was fixed in #86.
from carmen-cache.
Related Issues (20)
- [setgrid] Add unit tests for _set() with grid objects HOT 1
- [setgrid] Add an encodeGrid() cpp method HOT 1
- [setgrid] Wire up encodeGrid() and _set() HOT 1
- [setgrid] Building dev binaries HOT 1
- Flapping test failures in asan travis job HOT 1
- Refactor Plan HOT 9
- Refactor followup: enable LTO HOT 7
- Use `-Werror` and `-isystem` HOT 3
- Speed up sorting / reduce overhead of sorting HOT 1
- Illegal instruction on Node 8 HOT 3
- Documenting most recent bottlenecks detected HOT 3
- Don't publish binaries for git tags HOT 2
- Update scoredist implementation
- Refactor coalesce to reduce duplicate get operations
- Review Travis CI and Warning options.
- Place of binary
- Use `numeric_cast` for narrowing conversions HOT 2
- Update RocksDB: 4.13 -> 5 HOT 4
- Upstream: undo feature id sharding HOT 3
- [setgrid] Set Grid Quest HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carmen-cache.