[Lldb-commits] [PATCH] D75200: AddressSanitizer failure in MemoryCache

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 27 06:22:13 PST 2020


labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Yea, I guess I spoke too soon when I said the fix is going to be easy -- this is quite messy.

I believe I understand now why we haven't run into this problem before . Lldb default cache size is 1024 bytes, and the typical page size is 4k. This means a single read will always stay within the confines of one memory page, and so we're very unlikely to get a partial read.

In this sense the wasm test is a bit atypical, because normally we would just end up reading random parts of inferior memory in case of tiny object files. Nevertheless, I don't think this code should assume any particular page size, and so I think truncating the buffer is the right thing to do. Judging by the comment on line 214, this code already expects this situation (although I wouldn't be surprised if there were other bugs in handling incomplete reads lurking around here).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75200/new/

https://reviews.llvm.org/D75200





More information about the lldb-commits mailing list