<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/100311>100311</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Fatal glibc error: cannot get entropy for arc4random
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hongweipeng
</td>
</tr>
</table>
<pre>
The program is executed in a docker container based on `ubuntu:24.04`, `clang-format` and installed by `apt install clang-format`.
```
# clang-format --version
Ubuntu clang-format version 18.1.3 (1)
# uname -a
Linux 184ec2f67fe7 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
```
backtrace:
```
root@724b126ab6c5:/opt/src_code/csdk-5.1# bash format.sh
Fatal glibc error: cannot get entropy for arc4random
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: clang-format -i -style=file ./bindings/lua/src/lua_csdk.c ./bindings/lua/src/lua_csdk.h ./bindings/nodejs/src/addon.cpp ./bindings/nodejs/src/agent.cpp ./bindings/nodejs/src/agent.h ./bindings/nodejs/src/backendCall.cpp ./bindings/nodejs/src/backendCall.h ./bindings/nodejs/src/common.cpp ./bindings/nodejs/src/common.h ./bindings/nodejs/src/compat.h ./bindings/nodejs/src/config.cpp ./bindings/nodejs/src/config.h ./bindings/nodejs/src/error.h ./bindings/nodejs/src/span.cpp ./bindings/nodejs/src/span.h ./bindings/nodejs/src/trace.cpp ./bindings/nodejs/src/trace.h ./bindings/nodejs/src/transaction.cpp ./bindings/nodejs/src/transaction.h ./c/include/btdetail/be_call.h ./c/include/btdetail/be_call_ex.h ./c/include/btdetail/bt.h ./c/include/btdetail/bt_detail.h ./c/include/btdetail/bt_detail_ex.h ./c/include/btdetail/bt_ex.h ./c/include/common/common.h ./c/include/common/cross.h ./c/include/common/enums.h ./c/include/common/enums_ex.h ./c/include/common/structs.h ./c/include/common/structs_ex.h ./c/include/common/symbols.h ./c/include/common/tags.h ./c/include/config/app_config.h ./c/include/config/backend_config.h ./c/include/config/bt_filter_config.h ./c/include/config/business_transaction_configs.h ./c/include/config/call_graph_config.h ./c/include/config/circuit_breaker_config.h ./c/include/config/config.h ./c/include/config/custom_be_rule_config.h ./c/include/config/custom_bt_rule_config.h ./c/include/config/debug_config.h ./c/include/config/error_config.h ./c/include/config/js_config.h ./c/include/config/snapshot_gatherer_config.h ./c/include/config/socket_config.h ./c/include/config/trace_config.h ./c/include/handler/handler.h ./c/include/log/native_log_ex.h ./c/include/metric/metric.h ./c/include/trace/span.h ./c/include/trace/span_ex.h ./c/include/trace/tracer.h ./c/include/trace/tracer_ex.h ./c/include/utils/str_util.h ./c/include/sdk.h ./c/include/sdk_ex.h ./c/src/btdetail/be_call.cpp ./c/src/btdetail/bt.cpp ./c/src/btdetail/bt_detail.cpp ./c/src/config/app_config.cpp ./c/src/config/backend_config.cpp ./c/src/config/business_transaction_configs.cpp ./c/src/config/call_graph_config.cpp ./c/src/config/circuit_breaker_config.cpp ./c/src/config/config.cpp ./c/src/config/custom_be_rule_config.cpp ./c/src/config/custom_bt_rule_config.cpp ./c/src/config/debug_config.cpp ./c/src/config/error_config.cpp ./c/src/config/js_config.cpp ./c/src/config/snapshot_gatherer_config.cpp ./c/src/config/socket_config.cpp ./c/src/config/trace_config.cpp ./c/src/log/native_log.cpp ./c/src/metric/metric.cpp ./c/src/trace/span.cpp ./c/src/trace/tracer.cpp ./c/src/utils/bonree_html_parser.c ./c/src/utils/bonree_html_parser.h ./c/src/utils/str_util.cpp ./c/src/sdk.cpp ./examples/c/grpc/bonree.grpc.pb.h ./examples/c/grpc/bonree.pb.h ./examples/c/grpc/bonree_client.cpp ./examples/c/grpc/bonree_server.cpp ./examples/c/example.c ./gtest/benchs/list_vs_forward_list.cpp ./gtest/benchs/lock_vs_atomic_vs_none.cpp ./gtest/benchs/mutex_vs_recursive_mutex.cpp ./gtest/benchs/string_add_string.cpp ./gtest/common/main.cpp ./gtest/config/bt_filer_cfg_test.cpp ./gtest/config/error_cfg_test.cpp ./gtest/config/local_cfg_test.cpp ./gtest/config/local_cfg_test.in.h ./gtest/cross_req/cross_req_test.cpp ./gtest/cross_rsp/cross_rsp_test.cpp ./gtest/cross_trace_context/cross_trace_context_test.cpp ./gtest/stdbuiltin/std_test.cpp ./gtest/transaction/be_test.cpp ./gtest/transaction/bt_test.cpp ./gtest/transaction/request_attribute_test.cpp ./gtest/transaction/tx_test.cpp ./gtest/utils_test/NamingUtils_test.cpp ./gtest/utils_test/SqlUtils_test.cpp ./gtest/utils_test/utils_test.cpp ./include/config/container_info.h ./include/config/thread_dump_task.h ./include/compat.h ./src/agent/cache/message_cache.h ./src/agent/cache/message_cache_file.h ./src/agent/common/agent_info.h ./src/agent/common/brsigar.cpp ./src/agent/common/brsigar.h ./src/agent/common/modification_listener.h ./src/agent/common/type.h ./src/agent/communication/brhttp_client.cpp ./src/agent/communication/brhttp_client.h ./src/agent/communication/unix_sock_client.cpp ./src/agent/communication/unix_sock_client.h ./src/agent/communication/unix_sock_server.cpp ./src/agent/communication/unix_sock_server.h ./src/agent/config/local_config.cpp ./src/agent/config/local_config.h ./src/agent/data/error/error_aggregator.cpp ./src/agent/data/error/error_aggregator.h ./src/agent/data/event/event_aggregator.cpp ./src/agent/data/event/event_aggregator.h ./src/agent/data/metrics/metric_aggregator.cpp ./src/agent/data/metrics/metric_aggregator.h ./src/agent/data/request_attribute/request_attribute_collector.cpp ./src/agent/data/request_attribute/request_attribute_collector.h ./src/agent/data/slow_backend/slow_backend_aggregator.cpp ./src/agent/data/slow_backend/slow_backend_aggregator.h ./src/agent/data/sql_trace/sql_trace_aggregator.cpp ./src/agent/data/sql_trace/sql_trace_aggregator.h ./src/agent/data/trace/trace_aggregator.cpp ./src/agent/data/trace/trace_aggregator.h ./src/agent/data/data_aggregator.cpp ./src/agent/data/data_aggregator.h ./src/agent/log/br_log.cpp ./src/agent/log/br_log.h ./src/agent/log/br_log_level.h ./src/agent/schedule/scheduler.cpp ./src/agent/schedule/scheduler.h ./src/agent/services/abstract_service.cpp ./src/agent/services/abstract_service.h ./src/agent/services/communication_service.cpp ./src/agent/services/communication_service.h ./src/agent/services/config_service.cpp ./src/agent/services/config_service.h ./src/agent/services/ntp_service.cpp ./src/agent/services/ntp_service.h ./src/agent/services/rpc_config_service.cpp ./src/agent/services/rpc_config_service.h ./src/agent/services/rpc_server.cpp ./src/agent/services/rpc_server.h ./src/agent/services/service.h ./src/agent/services/service_manager.cpp ./src/agent/services/service_manager.h ./src/agent/services/smartfull_trace_service.cpp ./src/agent/services/smartfull_trace_service.h ./src/agent/services/smartmode_trace_service.cpp ./src/agent/services/smartmode_trace_service.h ./src/agent/services/smart_agent_service.cpp ./src/agent/services/smart_agent_service.h ./src/agent/services/upload_service.cpp ./src/agent/services/upload_service.h ./src/agent/agent.cpp ./src/agent/agent.h ./src/agent/iagent.cpp ./src/agent/iagent.h ./src/agent/tiny_agent.cpp ./src/agent/tiny_agent.h ./src/btdetail/backend_call_impl.cpp ./src/btdetail/backend_call_impl.h ./src/btdetail/bt_detail_impl.cpp ./src/btdetail/bt_detail_impl.h ./src/btdetail/business_transaction_impl.cpp ./src/btdetail/business_transaction_impl.h ./src/btdetail/http_request_and_response_data.h ./src/common/tags.cpp ./src/config/app_config_impl.h ./src/config/app_gatherer_config_impl.h ./src/config/backend_config_impl.h ./src/config/bt_filter_config_impl.h ./src/config/bt_threshold_configs_impl.h ./src/config/call_graph_config_impl.h ./src/config/circuit_breaker_config_impl.h ./src/config/config_handle_hub.cpp ./src/config/config_handle_hub.h ./src/config/config_impl.cpp ./src/config/config_impl.h ./src/config/config_request_attribute_impl.h ./src/config/custom_be_rule_config_impl.h ./src/config/custom_bt_rule_config_impl.h ./src/config/debug_config_impl.h ./src/config/error_config_impl.h ./src/config/js_config_impl.h ./src/config/naming_config_impl.cpp ./src/config/naming_config_impl.h ./src/config/smartfull_trace_config_impl.cpp ./src/config/smartfull_trace_config_impl.h ./src/config/snapshot_gatherer_config_impl.h ./src/config/socket_config_impl.h ./src/config/trace_config_impl.h ./src/cross/sw8_header.cpp ./src/cross/sw8_header.h ./src/cross/trace_context_resolver.cpp ./src/cross/trace_context_resolver.h ./src/log/native_log.cpp ./src/trace/span_impl.cpp ./src/trace/span_impl.h ./src/trace/tracer_impl.cpp ./src/trace/tracer_impl.h ./src/trace/trace_method.cpp ./src/trace/trace_method.h ./src/trace/trace_thread.cpp ./src/trace/trace_thread.h ./src/utils/minizip/ioapi.c ./src/utils/minizip/ioapi.h ./src/utils/minizip/unzip.c ./src/utils/minizip/unzip.h ./src/utils/ConditionMatchUtils.cpp ./src/utils/ConditionMatchUtils.h ./src/utils/ContainerIdDetector.cpp ./src/utils/ContainerIdDetector.h ./src/utils/FileUtils.cpp ./src/utils/FileUtils.h ./src/utils/JsonPathUtils.cpp ./src/utils/JsonPathUtils.h ./src/utils/NamingUtils.cpp ./src/utils/NamingUtils.h ./src/utils/ParserIPUtils.cpp ./src/utils/ParserIPUtils.h ./src/utils/ParserPBConditionUtils.cpp ./src/utils/ParserPBConditionUtils.h ./src/utils/ProcessUtils.cpp ./src/utils/ProcessUtils.h ./src/utils/Random.cpp ./src/utils/Random.h ./src/utils/SqlUtils.cpp ./src/utils/SqlUtils.h ./src/utils/StaticCacheUtils.cpp ./src/utils/StaticCacheUtils.h ./src/utils/ThreadPool.cpp ./src/utils/ThreadPool.h ./src/utils/TimestampUtil.cpp ./src/utils/TimestampUtil.h ./src/utils/utils.cpp ./src/utils/utils.h ./src/version/version.in.h ./src/sdk.cpp ./tests/c/t_fork.c ./lua_csdk.c
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 libLLVM.so.18.1 0x00007fc1339bf67f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 63
1 libLLVM.so.18.1 0x00007fc1339bd7b9 llvm::sys::RunSignalHandlers() + 89
2 libLLVM.so.18.1 0x00007fc1339bfdc0
3 libc.so.6 0x00007fc1327cc320
4 libc.so.6 0x00007fc132825b1c pthread_kill + 284
5 libc.so.6 0x00007fc1327cc26e gsignal + 30
6 libc.so.6 0x00007fc1327af8ff abort + 223
7 libc.so.6 0x00007fc1327b07b6
8 libc.so.6 0x00007fc132817a49
9 libc.so.6 0x00007fc1327cd585 arc4random + 133
10 libLLVM.so.18.1 0x00007fc1339b37cb llvm::sys::fs::createUniquePath(llvm::Twine const&, llvm::SmallVectorImpl<char>&, bool) + 427
11 libLLVM.so.18.1 0x00007fc1339b39dd
12 libLLVM.so.18.1 0x00007fc1339b8fd1 llvm::sys::fs::TempFile::create(llvm::Twine const&, unsigned int, llvm::sys::fs::OpenFlags) + 113
13 libLLVM.so.18.1 0x00007fc1339a3585 llvm::writeToOutput(llvm::StringRef, std::function<llvm::Error (llvm::raw_ostream&)>) + 229
14 libclang-cpp.so.18.1 0x00007fc13c4ad9d1 clang::Rewriter::overwriteChangedFiles() + 529
15 clang-format 0x00007fc13dfb83e6
16 clang-format 0x00007fc13dfb5a0f
17 libc.so.6 0x00007fc1327b11ca
18 libc.so.6 0x00007fc1327b128b __libc_start_main + 139
19 clang-format 0x00007fc13dfb2ef5
format.sh: line 48: 22 Aborted (core dumped) clang-format -i -style=file $(find $FIND_IGNORES -name '*.c' -print -o -name '*.h' -print -o -name '*.cpp' -print)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycm1tv46j7x1-Ne4Ma-ZCDc9GLTjvdndUcqmlnpf__xsKY2GwxeACn7b76n8BOYicY061GE2I-z_cBDA8EYyglKRnGN8HqU7C6v4Ktqri4qTgrXzFpMCuvcl683zxXGDSClwLWgEiA3zBqFS4AYQCCgqMXLADiTEHCsAA5lLgAnIFgHbZ5y1QbJLfxchEug3UYxHf6OqKQldc7LmqognUIINNqUkFKcQHyd83ARh2ugTN-EYT3QXjb_78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