[PATCH] D84570: [tsan] Fix the open and open64 interceptors to have correct declarations (variadic functions)

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 11:35:48 PDT 2020


kubamracek added a comment.

If I read the output right, it seems that even before this change, running with TSan messes up the permissions argument. I think this may be some latent bug in glibc that is only triggered in unusual environments (like TSan). I found this comment at https://lkml.org/lkml/2014/10/30/812:

> ... uses a conditional va_arg() to get
> the third parameter *despite* not even being a variadic function (not
> varargs, not stdarg). So it's not even portable or correct *anyway*,

Which sounds relevant. Just a guess, but maybe the varargs code in glibc is technically wrong, but under normal conditions, it just ends up being lucky and the right value ends up at the right register/stackslot?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84570



More information about the llvm-commits mailing list