[PATCH] [UBsan] Dumping call stacks when reporting bad-cast (-fsanitize=vptr)
byoungyoung at google.com
Thu Jul 24 09:50:35 PDT 2014
This is quite strange, but UBSAN_OPTIONS are not visible (i.e.,
getEnv("UBSAN_OPTIONS") returns null) even when all Chrome sandboxes are
disabled. So I suppose this is related to the Chrome's multi-process
running model involving Zygote (i.e., UBsan init has to be executed from
the Zygote process, not one of Zygote's child processes. However, all of
rendering processes are running as a child process of the Zygote process
while the Zygote process may wipe out all environment variables.). If the
initialization is done at the very early running phase, UBsan can read
On Thu, Jul 24, 2014 at 12:29 AM, Byoungyoung Lee <byoungyoung at google.com>
> Thanks Alexey for turning my sloppy patch into way better one!
> Yes, I was calling the InitializeSanitizerCommon() in the early phase to
> initialize UBSan before the Chrome sandbox kick in. As I tried Clang ToT
> today, I found another issue that UBSAN_OPTIONS was not visible in
> InitializeSanitizerCommon() for Chrome (I suspect this is also related to
> the Chrome sandboxing, but haven't verified yet). Please let me try more
> On Wed, Jul 23, 2014 at 12:01 PM, Alexey Samsonov <vonosmas at gmail.com>
>> I've incorporated your patch into r213783. Now if you want to see stack
>> traces in vptr checker, but don't want to run online symbolization you can
>> provide UBSAN_OPTIONS="symbolize=0 print_stacktrace=1". Let me know if
>> you're OK with this change. One thing that wasn't submitted is call to
>> InitializeSanitizerCommon() early in __ubsan_handle_dynamic_type_cache_miss
>> (before we even check for duplicated report or for cache miss). It would be
>> really costly and weird to add initialization at this place. I assume that
>> you're trying to initialize UBSan as early as possible in presence of
>> Chromium sandbox. Is that right?
>> On Wed, Jul 23, 2014 at 8:53 AM, Byoungyoung Lee <byoungyoung at google.com>
>>> Thank you Alexey!
>>> On Tue, Jul 22, 2014 at 6:24 PM, Alexey Samsonov <vonosmas at gmail.com>
>>>> FYI I'm working on a slightly modified version of this patch. Will
>>>> update this thread tomorrow.
>> Alexey Samsonov
>> vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits