[llvm-commits] [PATCH] [msan] MemorySanitizer runtime
Kostya Serebryany
kcc at google.com
Sun Dec 9 21:50:21 PST 2012
================
Comment at: llvm/projects/compiler-rt/lib/msan/msan.cc:85
@@ +84,3 @@
+};
+int msan_inited = 0;
+bool msan_init_is_running;
----------------
Alexey Samsonov wrote:
> Is it really safe to explicitly initialize this? Can __msan_init() run before this module is initialized?
the initializer is a constant, this the initialization happens at link time.
================
Comment at: llvm/projects/compiler-rt/lib/msan/msan.cc:201
@@ +200,3 @@
+ if (StackSizeIsUnlimited()) {
+ // Printf("Unlimited stack, doing reexec\n");
+ SetStackSizeLimitInBytes(32 * 1024 * 1024);
----------------
Alexey Samsonov wrote:
> hide under verbosity?
reexec is not fully usable solution here yet. Once it is, yes, we'll hide it.
================
Comment at: llvm/projects/compiler-rt/lib/msan/msan.cc:337
@@ +336,3 @@
+ uptr beg = x & ~3UL; // align down.
+ uptr end = (x + size + 3) & ~3UL; // align up.
+ u64 origin64 = ((u64)origin << 32) | origin;
----------------
Alexey Samsonov wrote:
> These magic numbers seem pretty scary to me.
These are not magic at all. The 4-byte origins are mapped to each aligned 4 bytes of app memory.
I would agree that we need an extended comment about the origins.
It could go into MemorySanitizer.cpp separately.
================
Comment at: llvm/projects/compiler-rt/lib/msan/msan_interceptors.cc:374
@@ +373,3 @@
+
+UNSUPPORTED(wcscoll_l);
+UNSUPPORTED(wcsnrtombs);
----------------
Alexey Samsonov wrote:
> Does it actually work (you don't provide args to INTERCEPTOR)?
Sure it does. You don't need the arguments to crash.
http://llvm-reviews.chandlerc.com/D191
More information about the llvm-commits
mailing list