{"push_id":1283171225,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"583989e920b9ae4e964107dd2865c9a6564e8597","before":"ceb9d6db4b003eab55caee88b37e8e1bfa247fc4","commits":[{"sha":"583989e920b9ae4e964107dd2865c9a6564e8597","author":{"name":"Dmitry Vyukov","email":"b57e2f029877ea15ce154a1e552a90c512dd912a@google.com"},"message":"asan: allow __asan_{before,after}_dynamic_init without registered globals\n\nWhen optimizing, GCC optimizes away aggressively unused static globals.\nThe __asan_before_dynamic_init/__asan_after_dynamic_init calls are placed\nin static constructor earlier while the registration of the globals is done\nlater in the compilation process.  If all the globals with\ndynamic initialization are optimized away from some particular TU in between\nthose two, libasan can fail on an assertion that dynamic_init_globals is\nempty.\n\nWhile I'm going to commit a GCC change which will remove the\n__asan_before_dynamic_init/__asan_after_dynamic_init in many cases when this\nhappens (basically if the optimizers can prove there are no memory\nreferences in between the two calls), there are still testcases where such\npair of calls is left, e.g. for\nstruct S { S () { asm volatile (\"\" : : : \"memory\"); } };\nstatic S c;\n\nint\nmain ()\n{\n  return 0;\n}\nwith -O2 -fsanitize=address and ASAN_OPTIONS=check_initialization_order=true\nthis still fails the assertion.  Trying to avoid this problem on the\ncompiler side would decrease code quality I'm afraid, whether it is making\nsure for -fsanitize=address we keep around at least one dynamically\ninitialized global if the\n__asan_before_dynamic_init/__asan_after_dynamic_init pair has been emitted,\nor adding some artificial global which would be used as the condition for\nthose calls etc.\nSo, can the assertion be instead just removed, this really shouldn't slow\ndown the calls measurably (for __asan_before_dynamic_init it is even\ncheaper) and the assertion doesn't check something worthwhile anyway (it is\nsufficient if there is a single dynamically initialized global in any other\nTU to make it happy).\n\nDetails in http://gcc.gnu.org/PR77396\n\nAuthor: Jakub Jelinek","distinct":true,"url":"https://api.github.com/repos/llvm-project/llvm-project-submodule/commits/583989e920b9ae4e964107dd2865c9a6564e8597"}]}
{"actor":{"display_login":"chapuni"}}