**To compile clickhouse on Mac, the steps are as follows：**

`$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

$ brew install cmake ninja libtool gettext

git clone --recursive git@github.com:ClickHouse/ClickHouse.git

cd ClickHouse

mkdir build

cd build

cmake .. -DCMAKE_CXX_COMPILER=`which clang++` -DCMAKE_C_COMPILER=`which clang`

ninja

cd ..
`

**Execute     clickhouse-server, the error is as follows：**


`Processing configuration file 'config.xml'.
There is no file 'config.xml', will use embedded config.
Logging trace to console
2021.06.23 21:01:58.031513 [ 75789 ] {} <Information> : Starting ClickHouse 21.7.1.1 with revision 54452, no build id, PID 2615
2021.06.23 21:01:58.041521 [ 75789 ] {} <Information> Application: starting up
2021.06.23 21:01:58.041572 [ 75789 ] {} <Information> Application: OS name: Darwin, version: 19.6.0, architecture: x86_64
2021.06.23 21:01:58.041713 [ 75789 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.053761 [ 75789 ] {} <Information> StatusFile: Status file ./status already exists - unclean restart. Contents:
PID: 2605
Started at: 2021-06-23 21:00:49
Revision: 54452

2021.06.23 21:01:58.053888 [ 75789 ] {} <Debug> Application: rlimit on number of file descriptors is 547504
2021.06.23 21:01:58.053904 [ 75789 ] {} <Debug> Application: Initializing DateLUT.
2021.06.23 21:01:58.053910 [ 75789 ] {} <Trace> Application: Initialized DateLUT with time zone 'Asia/Shanghai'.
2021.06.23 21:01:58.053922 [ 75789 ] {} <Debug> Application: Setting up ./tmp/ to store temporary data in it
2021.06.23 21:01:58.053997 [ 75789 ] {} <Debug> Application: Initiailizing interserver credentials.
2021.06.23 21:01:58.056298 [ 75789 ] {} <Debug> ConfigReloader: Loading config 'config.xml'
Processing configuration file 'config.xml'.
There is no file 'config.xml', will use embedded config.
Saved preprocessed configuration to './preprocessed_configs/config.xml'.
2021.06.23 21:01:58.056663 [ 75789 ] {} <Debug> ConfigReloader: Loaded config 'config.xml', performing update on configuration
2021.06.23 21:01:58.056893 [ 75789 ] {} <Information> Application: Setting max_server_memory_usage was set to 14.40 GiB (16.00 GiB available * 0.90 max_server_memory_usage_to_ram_ratio)
2021.06.23 21:01:58.057069 [ 75789 ] {} <Debug> ConfigReloader: Loaded config 'config.xml', performed update on configuration
2021.06.23 21:01:58.057153 [ 75791 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.059350 [ 75789 ] {} <Debug> ConfigReloader: Loading config 'config.xml'
Processing configuration file 'config.xml'.
There is no file 'config.xml', will use embedded config.
Saved preprocessed configuration to './preprocessed_configs/config.xml'.
2021.06.23 21:01:58.059672 [ 75789 ] {} <Debug> ConfigReloader: Loaded config 'config.xml', performing update on configuration
2021.06.23 21:01:58.060292 [ 75789 ] {} <Debug> ConfigReloader: Loaded config 'config.xml', performed update on configuration
2021.06.23 21:01:58.060561 [ 75789 ] {} <Debug> Access(user directories): Added users.xml access storage 'users.xml', path: config.xml
2021.06.23 21:01:58.060781 [ 75789 ] {} <Information> Application: Loading metadata from ./
2021.06.23 21:01:58.061208 [ 75789 ] {} <Information> DatabaseAtomic (system): Total 0 tables and 0 dictionaries.
2021.06.23 21:01:58.061221 [ 75789 ] {} <Information> DatabaseAtomic (system): Starting up tables.
2021.06.23 21:01:58.063974 [ 75789 ] {} <Information> DatabaseAtomic (default): Total 0 tables and 0 dictionaries.
2021.06.23 21:01:58.064004 [ 75789 ] {} <Information> DatabaseAtomic (default): Starting up tables.
2021.06.23 21:01:58.064172 [ 75789 ] {} <Information> DatabaseAtomic (test): Total 0 tables and 0 dictionaries.
2021.06.23 21:01:58.064183 [ 75789 ] {} <Information> DatabaseAtomic (test): Starting up tables.
2021.06.23 21:01:58.064229 [ 75789 ] {} <Information> DatabaseCatalog: Found 0 partially dropped tables. Will load them and retry removal.
2021.06.23 21:01:58.064245 [ 75789 ] {} <Information> BackgroundSchedulePool/BgSchPool: Create BackgroundSchedulePool with 128 threads
2021.06.23 21:01:58.064730 [ 75811 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.064839 [ 75805 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.064934 [ 75796 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.064959 [ 75802 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.065060 [ 75799 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.065152 [ 75797 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.065170 [ 75806 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.065273 [ 75810 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.065294 [ 75803 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.065443 [ 75795 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.065464 [ 75804 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.065497 [ 75809 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.065565 [ 75820 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.065592 [ 75822 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.065744 [ 75807 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.065772 [ 75814 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.065886 [ 75812 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.065930 [ 75828 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066004 [ 75834 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066033 [ 75816 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066120 [ 75832 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066149 [ 75815 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066235 [ 75819 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066260 [ 75813 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066334 [ 75829 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066456 [ 75826 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066526 [ 75801 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066626 [ 75844 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066686 [ 75851 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066756 [ 75843 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066826 [ 75827 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066841 [ 75817 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.066931 [ 75821 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067010 [ 75824 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067082 [ 75823 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067123 [ 75853 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067186 [ 75842 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067244 [ 75833 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067302 [ 75849 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067364 [ 75841 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067432 [ 75830 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067473 [ 75798 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067582 [ 75800 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067883 [ 75890 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067926 [ 75846 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067887 [ 75860 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067825 [ 75845 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067724 [ 75808 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067957 [ 75847 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067842 [ 75835 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067973 [ 75893 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067932 [ 75837 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.067978 [ 75852 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068073 [ 75818 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068226 [ 75874 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068216 [ 75838 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068278 [ 75839 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068097 [ 75850 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068246 [ 75836 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068089 [ 75825 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068312 [ 75831 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068303 [ 75840 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068288 [ 75848 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068438 [ 75866 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068559 [ 75904 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068663 [ 75861 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068797 [ 75789 ] {} <Debug> Application: Loaded metadata.
2021.06.23 21:01:58.068808 [ 75789 ] {} <Information> Application: Query Profiler and TraceCollector are disabled because they cannot work without bundled unwind (stack unwinding) library.
2021.06.23 21:01:58.068818 [ 75789 ] {} <Information> Application: Query Profiler and TraceCollector are disabled because they require PHDR cache to be created (otherwise the function 'dl_iterate_phdr' is not lock free and not async-signal safe).
2021.06.23 21:01:58.068835 [ 75789 ] {} <Information> Application: TaskStats is not implemented for this OS. IO accounting will be disabled.
2021.06.23 21:01:58.068917 [ 75891 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.068969 [ 75923 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069018 [ 75892 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069055 [ 75895 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069051 [ 75894 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069078 [ 75875 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069091 [ 75877 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069022 [ 75865 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069114 [ 75864 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069112 [ 75896 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069137 [ 75898 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069172 [ 75859 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069262 [ 75897 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069383 [ 75789 ] {} <Information> Application: Listening for http://[::1]:8123
2021.06.23 21:01:58.069276 [ 75878 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069366 [ 75900 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069424 [ 75879 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069518 [ 75899 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069524 [ 75903 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069541 [ 75902 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069405 [ 75901 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069517 [ 75880 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069395 [ 75867 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069626 [ 75854 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069654 [ 75857 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069694 [ 75905 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069677 [ 75881 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069683 [ 75906 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069682 [ 75882 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069806 [ 75868 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069931 [ 75884 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070059 [ 75855 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.069920 [ 75907 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070090 [ 75908 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070116 [ 75911 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070000 [ 75869 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070254 [ 75910 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070242 [ 75909 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070278 [ 75885 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070318 [ 75887 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070098 [ 75883 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070155 [ 75870 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070278 [ 75913 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070319 [ 75912 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070162 [ 75886 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070363 [ 75862 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070410 [ 75915 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070478 [ 75888 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070506 [ 75914 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070492 [ 75871 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070559 [ 75917 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070609 [ 75916 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070642 [ 75858 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070717 [ 75889 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070723 [ 75919 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070720 [ 75872 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070739 [ 75863 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070751 [ 75918 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070811 [ 75920 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070825 [ 75873 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070876 [ 75921 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070914 [ 75922 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070943 [ 75876 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.070947 [ 75856 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.071230 [ 75789 ] {} <Information> Application: Listening for connections with native protocol (tcp): [::1]:9000
2021.06.23 21:01:58.071430 [ 75789 ] {} <Trace> MySQLHandlerFactory: Failed to create SSL context. SSL will be disabled. Error: Poco::Exception. Code: 1000, e.code() = 0, e.displayText() = SSL Exception: Configuration error: no certificate file has been specified (version 21.7.1.1)
2021.06.23 21:01:58.071458 [ 75789 ] {} <Trace> MySQLHandlerFactory: Failed to read RSA key pair from server certificate. Error: Code: 139, e.displayText() = DB::Exception: Certificate file is not set. (version 21.7.1.1)
2021.06.23 21:01:58.071464 [ 75789 ] {} <Trace> MySQLHandlerFactory: Generating new RSA key pair.
2021.06.23 21:01:58.156967 [ 75789 ] {} <Information> Application: Listening for MySQL compatibility protocol: [::1]:9004
2021.06.23 21:01:58.157066 [ 75789 ] {} <Information> Application: Listening for http://127.0.0.1:8123
2021.06.23 21:01:58.157106 [ 75789 ] {} <Information> Application: Listening for connections with native protocol (tcp): 127.0.0.1:9000
2021.06.23 21:01:58.157160 [ 75789 ] {} <Trace> MySQLHandlerFactory: Failed to create SSL context. SSL will be disabled. Error: Poco::Exception. Code: 1000, e.code() = 0, e.displayText() = SSL Exception: Configuration error: no certificate file has been specified (version 21.7.1.1)
2021.06.23 21:01:58.157177 [ 75789 ] {} <Trace> MySQLHandlerFactory: Failed to read RSA key pair from server certificate. Error: Code: 139, e.displayText() = DB::Exception: Certificate file is not set. (version 21.7.1.1)
2021.06.23 21:01:58.157182 [ 75789 ] {} <Trace> MySQLHandlerFactory: Generating new RSA key pair.
2021.06.23 21:01:58.190719 [ 75789 ] {} <Information> Application: Listening for MySQL compatibility protocol: 127.0.0.1:9004
2021.06.23 21:01:58.192686 [ 75789 ] {} <Information> DNSCacheUpdater: Update period 15 seconds
2021.06.23 21:01:58.192822 [ 75789 ] {} <Information> Application: Available RAM: 16.00 GiB; physical cores: 6; logical cores: 12.
2021.06.23 21:01:58.192807 [ 75925 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.192833 [ 75926 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.192840 [ 75924 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.192862 [ 75927 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.192847 [ 75811 ] {} <Debug> DNSResolver: Updating DNS cache
2021.06.23 21:01:58.192936 [ 75811 ] {} <Debug> DNSResolver: Updated DNS cache
2021.06.23 21:01:58.193031 [ 75928 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:01:58.193104 [ 75789 ] {} <Information> Application: Ready for connections.
2021.06.23 21:02:02.828409 [ 75792 ] {} <Trace> TCPHandlerFactory: TCP Request. Address: [::1]:60203
2021.06.23 21:02:02.828494 [ 75792 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:02:02.828628 [ 75792 ] {} <Debug> TCPHandler: Connected ClickHouse client version 21.7.0, revision: 54449, user: default.
2021.06.23 21:02:02.829333 [ 75792 ] {} <Trace> ContextAccess (default): Settings: readonly=0, allow_ddl=true, allow_introspection_functions=false
2021.06.23 21:02:02.829640 [ 75792 ] {} <Trace> ContextAccess (default): List of all grants: GRANT ALL ON *.* WITH GRANT OPTION
2021.06.23 21:02:02.829651 [ 75792 ] {} <Trace> ContextAccess (default): List of all grants including implicit: GRANT ALL ON *.* WITH GRANT OPTION
2021.06.23 21:02:02.830153 [ 75793 ] {} <Trace> TCPHandlerFactory: TCP Request. Address: [::1]:60204
2021.06.23 21:02:02.830225 [ 75793 ] {} <Warning> ThreadStatus: Cannot set alternative signal stack for thread, errno: 12, strerror: Cannot allocate memory
2021.06.23 21:02:02.830275 [ 75793 ] {} <Debug> TCPHandler: Connected ClickHouse client version 21.7.0, revision: 54449, user: default.
2021.06.23 21:02:02.832660 [ 75793 ] {213681aa-79f1-4869-aeae-b2b07d23ee30} <Debug> executeQuery: (from [::1]:60204, using production parser) SELECT DISTINCT arrayJoin(extractAll(name, '[\\w_]{2,}')) AS res FROM (SELECT name FROM system.functions UNION ALL SELECT name FROM system.table_engines UNION ALL SELECT name FROM system.formats UNION ALL SELECT name FROM system.table_functions UNION ALL SELECT name FROM system.data_type_families UNION ALL SELECT name FROM system.merge_tree_settings UNION ALL SELECT name FROM system.settings UNION ALL SELECT cluster FROM system.clusters UNION ALL SELECT macro FROM system.macros UNION ALL SELECT policy_name FROM system.storage_policies UNION ALL SELECT concat(func.name, comb.name) FROM system.functions AS func CROSS JOIN system.aggregate_function_combinators AS comb WHERE is_aggregate UNION ALL SELECT name FROM system.databases LIMIT 10000 UNION ALL SELECT DISTINCT name FROM system.tables LIMIT 10000 UNION ALL SELECT DISTINCT name FROM system.dictionaries LIMIT 10000 UNION ALL SELECT DISTINCT name FROM system.columns LIMIT 10000) WHERE notEmpty(res)
2021.06.23 21:02:02.834377 [ 75793 ] {213681aa-79f1-4869-aeae-b2b07d23ee30} <Error> executeQuery: Code: 306, e.displayText() = DB::Exception: Stack size too large. Stack address: 0x700001a58000, frame address: 0x700001a53f40, stack size: 540864, maximum stack size: 524288 (version 21.7.1.1) (from [::1]:60204) (in query: SELECT DISTINCT arrayJoin(extractAll(name, '[\\w_]{2,}')) AS res FROM (SELECT name FROM system.functions UNION ALL SELECT name FROM system.table_engines UNION ALL SELECT name FROM system.formats UNION ALL SELECT name FROM system.table_functions UNION ALL SELECT name FROM system.data_type_families UNION ALL SELECT name FROM system.merge_tree_settings UNION ALL SELECT name FROM system.settings UNION ALL SELECT cluster FROM system.clusters UNION ALL SELECT macro FROM system.macros UNION ALL SELECT policy_name FROM system.storage_policies UNION ALL SELECT concat(func.name, comb.name) FROM system.functions AS func CROSS JOIN system.aggregate_function_combinators AS comb WHERE is_aggregate UNION ALL SELECT name FROM system.databases LIMIT 10000 UNION ALL SELECT DISTINCT name FROM system.tables LIMIT 10000 UNION ALL SELECT DISTINCT name FROM system.dictionaries LIMIT 10000 UNION ALL SELECT DISTINCT name FROM system.columns LIMIT 10000) WHERE notEmpty(res)), Stack trace (when copying this message, always include the lines below):

<Empty trace>

2021.06.23 21:02:02.834456 [ 75793 ] {213681aa-79f1-4869-aeae-b2b07d23ee30} <Error> TCPHandler: Code: 306, e.displayText() = DB::Exception: Stack size too large. Stack address: 0x700001a58000, frame address: 0x700001a53f40, stack size: 540864, maximum stack size: 524288, Stack trace:

<Empty trace>

2021.06.23 21:02:02.834494 [ 75793 ] {213681aa-79f1-4869-aeae-b2b07d23ee30} <Debug> MemoryTracker: Peak memory usage (for query): 0.00 B.
2021.06.23 21:02:02.834504 [ 75793 ] {} <Debug> TCPHandler: Processed in 0.003573 sec.
2021.06.23 21:02:02.835023 [ 75793 ] {} <Debug> TCPHandler: Done processing connection.
2021.06.23 21:02:13.193784 [ 75811 ] {} <Debug> DNSResolver: Updating DNS cache
2021.06.23 21:02:13.193856 [ 75811 ] {} <Debug> DNSResolver: Updated DNS cache
^C2021.06.23 21:02:15.645344 [ 75790 ] {} <Trace> BaseDaemon: Received signal 2
2021.06.23 21:02:15.645422 [ 75790 ] {} <Information> Application: Received termination signal (Interrupt: 2)
2021.06.23 21:02:15.645446 [ 75789 ] {} <Debug> Application: Received termination signal.
2021.06.23 21:02:15.645463 [ 75789 ] {} <Debug> Application: Waiting for current connections to close.
2021.06.23 21:02:16.875950 [ 75789 ] {} <Information> Application: Closed all listening sockets. Waiting for 1 outstanding connections.
^C2021.06.23 21:02:17.870402 [ 75790 ] {} <Trace> BaseDaemon: Received signal 2
2021.06.23 21:02:17.870432 [ 75790 ] {} <Information> Application: Received termination signal (Interrupt: 2)
2021.06.23 21:02:17.870461 [ 75790 ] {} <Information> Application: Received second signal Interrupt. Immediately terminate.`



**Execute clickhouse-client, the error is as follows:**

`ClickHouse client version 21.7.1.1.
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 21.7.1 revision 54449.

qihoodemacbook-pro.local :) Cannot load data for command line suggestions: Code: 306, e.displayText() = DB::Exception: Received from localhost:9000. DB::Exception: Stack size too large. Stack address: 0x700001a58000, frame address: 0x700001a53f40, stack size: 540864, maximum stack size: 524288. (version 21.7.1.1)`

How should i solve this problem？

void * getData() const { return data; }
private:
    static constexpr size_t size = 16 << 10; 
    void * data;
};
}
static thread_local ThreadStack alt_stack;
static thread_local bool has_alt_stack = false;
#endif
ThreadStatus::ThreadStatus()
    : thread_id{getThreadId()}
{
    last_rusage = std::make_unique<RUsageCounters>();
    memory_tracker.setDescription("(for thread)");
    log = &Poco::Logger::get("ThreadStatus");
    current_thread = this;
    
    
    
    
    
#if !defined(SANITIZER) && !defined(ARCADIA_BUILD)
    if (!has_alt_stack)
    {
        
        has_alt_stack = true;