[PATCH] [compiler-rt] Make the UBSan coverage-levels.cc test be Linux specific

Kuba Brecka kuba.brecka at gmail.com
Wed Mar 11 17:05:00 PDT 2015


In http://reviews.llvm.org/D8278#139480, @samsonov wrote:

> Do you understand why it fails on x86_64?


Yes, I already sent it into the mailing list:

> I believe this recent change (r231413) caused a subtle change in behavior that is causing a test failure on the Darwin buildbot at http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA_check/2083/console.  The test is failing for a few days already, but it’s hard to tell which exact patch caused the regression, because the bot was offline for a day and a half when it occurred.




> I think the cause is this:  The old code in CovDump() iterates over the process map, but it intentionally skips over segments that are not executable.  The new code in DumpOffsets() asks GetModuleNameAndOffsetForPC instead, which contains a bug/feature that is triggered for in a 64-bit binary when a 4GB __PAGEZERO (with protection=0) segment is present.  In that case GetModuleNameAndOffsetForPC will say that the resulting offset is larger than 4GB, and the subsequent check in DumpOffsets that asserts `offset > 0xffffffffU` will ignore that item and not print it into the coverage file.




> I also realized that simply ignoring __PAGEZERO in the Darwin implementation of process maps is not going to work easily, because there seems to be other code that relies on this behavior (I can’t tell if that’s a bug or a feature).  What do you think would be way to fix this?


This patch is based on Kostya's suggestion to disable the test on Mac (it's already marked with `XFAIL: darwin` anyway).


http://reviews.llvm.org/D8278

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list