ClickHouse/base
Azat Khuzhin 0fe1f070fa Fix getauxval() in glibc-compatibility
getauxval() from glibc-compatibility did not work always correctly:

- it does not work after setenv(), and this breaks vsyscalls,
  like sched_getcpu() [1] (and BaseDaemon.cpp always set TZ if timezone
  is defined, which is true for CI [2]).

  [1]: https://bugzilla.redhat.com/show_bug.cgi?id=1163404
  [2]: https://github.com/ClickHouse/ClickHouse/pull/32928#issuecomment-1015762717

- another think that is definitely broken is LSan (Leak Sanitizer), it
  relies on worked getauxval() but it does not work if __environ is not
  initialized yet (there is even a commit about this).

  And because of, at least, one leak had been introduced [3]:

    [3]: https://github.com/ClickHouse/ClickHouse/pull/33840

Fix this by using /proc/self/auxv.

And let's see how many issues will LSan find...

I've verified this patch manually by printing AT_BASE and compared it
with output of LD_SHOW_AUXV.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-26 12:56:27 +03:00
..
base Remove MAKE_STATIC_LIBRARIES (in favor of USE_STATIC_LIBRARIES) 2022-01-24 17:28:33 +03:00
bridge Fix w/o ODBC build 2022-01-20 10:02:02 +03:00
daemon Remove MAKE_STATIC_LIBRARIES (in favor of USE_STATIC_LIBRARIES) 2022-01-24 17:28:33 +03:00
glibc-compatibility Fix getauxval() in glibc-compatibility 2022-01-26 12:56:27 +03:00
harmful Update harmful.c 2021-12-22 22:55:55 +03:00
loggers Merge pull request #33695 from amosbird/buildimprove 2022-01-19 03:19:22 +03:00
pcg-random Remove ya.make 2021-09-25 04:22:54 +03:00
readpassphrase Manipulate with -Wreserved-identifier only if HAS_RESERVED_IDENTIFIER has been detected 2021-10-03 17:42:36 +04:00
widechar_width Remove ya.make 2021-09-25 04:22:54 +03:00
CMakeLists.txt Move code around to avoid dlsym on Musl 2021-12-24 12:25:27 +03:00