Commit Graph

105 Commits

Author SHA1 Message Date
Alexey Milovidov
d8cda3dbb8 Remove PVS-Studio 2023-02-19 23:30:05 +01:00
Robert Schulze
27f5aad49e
What happens if I remove 156 lines of code? 2023-01-03 18:51:16 +00:00
Boris Kuschel
623f23f55d OpenSSL cmake changes 2022-12-07 13:22:46 -05:00
Raúl Marín
aaf8cc6ca8 Revert "Add global flags to base/ libraries"
This reverts commit 43e065c18e.
2022-11-10 11:32:27 +01:00
Raúl Marín
39f4120655 Fix broken build 2022-11-09 13:21:59 +01:00
Raúl Marín
43e065c18e Add global flags to base/ libraries 2022-11-09 11:24:20 +01:00
Raúl Marín
050f3ca7cf Fix msan warning 2022-11-08 17:25:03 +01:00
Amos Bird
4c2b3de93d
Fix msan error 2022-11-04 22:08:14 +08:00
Amos Bird
a89e847514
Fix getauxval for sanitizer builds 2022-11-04 22:08:13 +08:00
BoloniniD
0df426d329 Corrosion fixes + review fixes 2022-09-16 00:05:21 +03:00
BoloniniD
e8bcbcd016
Merge branch 'master' into BLAKE3 2022-09-09 11:48:31 +03:00
BoloniniD
c08b41b611 Clean files and compatibility code 2022-09-08 09:34:59 +03:00
BoloniniD
069fbdd7c5 Fix broken builds 2022-09-05 20:56:03 +03:00
BoloniniD
69588bcebf Added statx to glibc_compatibility 2022-09-04 20:21:13 +03:00
Ilya Golshtein
74561b40ae stylecheck renewed 2022-09-02 17:42:18 +03:00
Antonio Andelic
e64436fef3 Fix typos with new codespell 2022-09-02 08:54:48 +00:00
BoloniniD
cba94e106f Remove posix_spawn for now, add execvpe impl 2022-09-01 20:36:47 +03:00
BoloniniD
8e6dcf18df Add posix_spawn for posix_file_actions_ 2022-08-30 20:18:08 +03:00
BoloniniD
cb32fa4512 Add all posix_spawn_file_actions_ functions 2022-08-30 21:03:45 +03:00
Suzy Wang
cad4eeb891 Correct __dup3() to dup3() 2022-08-28 18:03:07 -07:00
BoloniniD
14216d1dc0 Move statx to glibc-compatibility 2022-08-28 16:40:10 +03:00
BoloniniD
d1e2267f58
Move statx to glibc-compatibility 2022-08-26 15:18:24 +03:00
BoloniniD
de45f7cf5d
Delete fstatat.c 2022-08-26 15:17:18 +03:00
BoloniniD
4ee1b52116 Move copy_file_range to glibc_compat 2022-08-25 20:59:52 +03:00
BoloniniD
78d00c3371 Add glibc symbols to glibc_compatibility 2022-08-24 21:30:48 +03:00
Suzy Wang
7a190f84c8 Remove weak_alias 2022-08-19 11:59:47 -07:00
Suzy Wang
1171ba9095 Add dup3() and inotify_init() from musl 1.2.3 2022-08-18 13:25:50 -07:00
Azat Khuzhin
a4f9e1da5b Fix getauxval() by using procfs with fallback to environ
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]).

  Also note, that fixing setenv() will not fix LSan,
  since the culprit is getauxval()

  [1]: https://bugzilla.redhat.com/show_bug.cgi?id=1163404
  [2]: ClickHouse#32928 (comment)

- 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]: ClickHouse#33840

Fix this by using /proc/self/auxv with fallback to environ solution to
make it compatible with environment that does not allow reading from
auxv (or no procfs).

v2: add fallback to environ solution
v3: fix return value for __auxv_init_procfs()
(cherry picked from commit f187c3499a)
v4: more verbose message on errors, CI founds [1]:
    AUXV already has value (529267711)
    [1]: https://s3.amazonaws.com/clickhouse-test-reports/39103/2325f7e8442d1672ce5fb43b11039b6a8937e298/stress_test__memory__actions_.html
v5: break at AT_NULL
v6: ignore AT_IGNORE
v7: suppress TSan and remove superior check to avoid abort() in case of race
v8: proper suppressions (not inner function but itself)
Refs: #33957
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-25 01:22:04 +03:00
Alexey Milovidov
72dda35108
Revert "[RFC] Fix LSan by fixing getauxval()" 2022-07-21 04:34:04 +03:00
Azat Khuzhin
f187c3499a Fix getauxval() by using procfs with fallback to environ
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]).

  Also note, that fixing setenv() will not fix LSan,
  since the culprit is getauxval()

  [1]: https://bugzilla.redhat.com/show_bug.cgi?id=1163404
  [2]: ClickHouse#32928 (comment)

- 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]: ClickHouse#33840

Fix this by using /proc/self/auxv with fallback to environ solution to
make it compatible with environment that does not allow reading from
auxv (or no procfs).

v2: add fallback to environ solution
v3: fix return value for __auxv_init_procfs()
Refs: #33957
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-18 16:49:49 +03:00
alesapin
b838a7dcb0 Remove outdated links from CI 2022-03-28 15:53:22 +02:00
Alexey Milovidov
7135ff448f Revert #33957 2022-01-30 01:09:15 +03:00
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
Maksim Kita
c1db61b4ed
Merge pull request #33946 from azat/build-cleanup
Remove MAKE_STATIC_LIBRARIES (in favor of USE_STATIC_LIBRARIES)
2022-01-24 23:42:04 +01:00
Azat Khuzhin
4a0facd341 Remove MAKE_STATIC_LIBRARIES (in favor of USE_STATIC_LIBRARIES)
There is no more MAKE_*, so remove this alias.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-24 17:28:33 +03:00
Azat Khuzhin
37dbff7587 Revert glibc compatibility (via .symver) in favor of hermetic build (bundled libc)
This patch reverts glibc compatibility (via .symver) #29594,
in favor of hermetic build (that provides bundled libc version) #30011

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-24 16:03:56 +03:00
Alexey Milovidov
8196f89481 Remove trash from CMake 2021-10-11 06:58:08 +03:00
Azat Khuzhin
cab0551c5b Add ability to compile using newer version fo glibc w/o using new symbols
In glibc 2.32 new version of some symbols had been added [1]:

    $ nm -D clickhouse | fgrep -e @GLIBC_2.32
                     U pthread_getattr_np@GLIBC_2.32
                     U pthread_sigmask@GLIBC_2.32

  [1]: https://www.spinics.net/lists/fedora-devel/msg273044.html

Right now ubuntu 20.04 is used as official image for building
ClickHouse, however once it will be switched someone may not be happy
with that fact that he/she cannot use official binaries anymore because
they have glibc < 2.32.

To avoid this dependency, let's force previous version of those
symbols from glibc.

Note, that I've tested this by compiling with glibc 2.32 and verifying
that output ELF does not have @GLIBC_2.32 symbols and also running that
binary inside ubuntu:20.04 image (that has glibc 2.31).

v1: -Wl,--wrap
v2: -Wl,--defsym
v3: -include
v4: fix versioning for aarch64
2021-10-01 21:01:59 +03:00
alexey-milovidov
c6f40c5c2d
Revert "Revert "less sys calls #2: make vdso work again"" 2021-08-25 14:19:20 +03:00
alexey-milovidov
3db3b40b5e
Revert "less sys calls #2: make vdso work again" 2021-08-19 01:38:12 +03:00
Alexey Milovidov
9a4a8d3943 Fix build with clang-13 2021-08-16 03:16:45 +03:00
Vitaly Baranov
213e6366c2
Update getauxval.c 2021-08-12 13:44:09 +03:00
Vitaly Baranov
3d9a4adfbf
Better handling case when __environ is null 2021-08-12 13:43:06 +03:00
Vitaly Baranov
9243e89150
Update getauxval.c 2021-08-12 12:10:37 +03:00
Vitaly Baranov
242d8e1861
__auxv_init lazy initialization 2021-08-12 11:06:12 +02:00
Mikhail Filimonov
2c01e2789a
make vdso work again 2021-08-12 11:06:06 +02:00
Azat Khuzhin
4dcbf3a5c5 Replace __pthread_get_minstack() with a const 2021-06-20 14:03:04 +03:00
Azat Khuzhin
0286673f8f Fix __pthread_get_minstack()
This is the function that should take into account TLS block, and 1MB is
too high, since it will be used for sigaltstack() on SIGSEGV

v0: copy-paste glibc __pthread_get_minstack()
v2: return static 16K instead of 1MB
2021-06-19 21:27:02 +03:00
alexey-milovidov
1ea637d996
Merge pull request #23970 from ClickHouse/pvs-studio-fixes-6
PVS-Studio fixes, part 6
2021-05-09 21:45:19 +03:00
Alexey Milovidov
367f7fe6c9 Fix warnings by PVS-Studio 2021-05-08 23:57:08 +03:00