diff --git a/0227-bugfix-for-sem_wait-call-when-errno-is-EINTR.patch b/0227-bugfix-for-sem_wait-call-when-errno-is-EINTR.patch new file mode 100644 index 0000000000000000000000000000000000000000..4e1da1352a250611fd526b2d1f6ccd2d236dab6d --- /dev/null +++ b/0227-bugfix-for-sem_wait-call-when-errno-is-EINTR.patch @@ -0,0 +1,233 @@ +From 0f5906dc1a2f5d5e9eb901c8be47267ac9026ab1 Mon Sep 17 00:00:00 2001 +From: zhongtao +Date: Tue, 5 Nov 2024 03:15:04 +1400 +Subject: [PATCH 14/19] bugfix for sem_wait call when errno is EINTR + +Signed-off-by: zhongtao +--- + src/cmd/isula/base/start.c | 4 +++- + src/cmd/isula/client_console.c | 4 +++- + src/cmd/isula/stream/attach.c | 8 ++++++-- + src/cmd/isula/stream/exec.c | 4 +++- + src/cmd/isulad-shim/process.c | 4 +++- + src/cmd/isulad/main.c | 8 ++++++-- + src/daemon/entry/connect/grpc/grpc_containers_service.cc | 8 ++++++-- + src/daemon/entry/cri/websocket/service/attach_serve.cc | 4 +++- + src/daemon/entry/cri/websocket/service/ws_server.cc | 5 ++++- + src/daemon/modules/events/collector.c | 8 ++++++-- + src/daemon/modules/service/io_handler.c | 4 +++- + 11 files changed, 46 insertions(+), 15 deletions(-) + +diff --git a/src/cmd/isula/base/start.c b/src/cmd/isula/base/start.c +index 1d0f1256..7052317a 100644 +--- a/src/cmd/isula/base/start.c ++++ b/src/cmd/isula/base/start.c +@@ -193,7 +193,9 @@ out: + void client_wait_fifo_exit(const struct client_arguments *args) + { + if (args->custom_conf.attach_stdin || args->custom_conf.attach_stdout || args->custom_conf.attach_stderr) { +- sem_wait(&g_console_waitexit_sem); ++ while(sem_wait(&g_console_waitexit_sem) == -1 && errno == EINTR) { ++ continue; ++ } + } + } + +diff --git a/src/cmd/isula/client_console.c b/src/cmd/isula/client_console.c +index 1c087d24..3ddedd0d 100644 +--- a/src/cmd/isula/client_console.c ++++ b/src/cmd/isula/client_console.c +@@ -259,7 +259,9 @@ int start_client_console_thread(struct command_fifo_config *console_fifos, bool + return -1; + } + +- sem_wait(console_fifos->wait_open); ++ while(sem_wait(console_fifos->wait_open) == -1 && errno == EINTR) { ++ continue; ++ } + + return 0; + } +diff --git a/src/cmd/isula/stream/attach.c b/src/cmd/isula/stream/attach.c +index ff49af92..3cbf2431 100644 +--- a/src/cmd/isula/stream/attach.c ++++ b/src/cmd/isula/stream/attach.c +@@ -282,7 +282,9 @@ static int container_wait_thread(struct client_arguments *args, uint32_t *exit_c + (void)sem_destroy(&sem_started); + return -1; + } +- (void)sem_wait(&sem_started); ++ while(sem_wait(&sem_started) == -1 && errno == EINTR) { ++ continue; ++ } + (void)sem_destroy(&sem_started); + return 0; + } +@@ -362,7 +364,9 @@ static int client_attach(struct client_arguments *args, uint32_t *exit_code) + } + + #ifndef GRPC_CONNECTOR +- sem_wait(&g_attach_waitexit_sem); ++ while(sem_wait(&g_attach_waitexit_sem) == -1 && errno == EINTR) { ++ continue; ++ } + #endif + + if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { +diff --git a/src/cmd/isula/stream/exec.c b/src/cmd/isula/stream/exec.c +index 209610be..218fb653 100644 +--- a/src/cmd/isula/stream/exec.c ++++ b/src/cmd/isula/stream/exec.c +@@ -380,7 +380,9 @@ static int local_cmd_exec(struct client_arguments *args, uint32_t *exit_code) + ret = client_exec(args, command_fifos, exit_code); + if (ret == 0 && + (args->custom_conf.attach_stdin || args->custom_conf.attach_stdout || args->custom_conf.attach_stderr)) { +- sem_wait(&g_command_waitexit_sem); ++ while(sem_wait(&g_command_waitexit_sem) == -1 && errno == EINTR) { ++ continue; ++ } + } + out: + delete_command_fifo(command_fifos); +diff --git a/src/cmd/isulad-shim/process.c b/src/cmd/isulad-shim/process.c +index d7127d0c..56025a8c 100644 +--- a/src/cmd/isulad-shim/process.c ++++ b/src/cmd/isulad-shim/process.c +@@ -818,7 +818,9 @@ int process_io_start(process_t *p, pthread_t *tid_epoll) + if (ret != SHIM_OK) { + return SHIM_SYS_ERR(errno); + } +- (void)sem_wait(&p->sem_mainloop); ++ while(sem_wait(&p->sem_mainloop) == -1 && errno == EINTR) { ++ continue; ++ } + (void)sem_destroy(&p->sem_mainloop); + + return SHIM_OK; +diff --git a/src/cmd/isulad/main.c b/src/cmd/isulad/main.c +index 7c7421b4..44815578 100644 +--- a/src/cmd/isulad/main.c ++++ b/src/cmd/isulad/main.c +@@ -1619,7 +1619,9 @@ static void *do_shutdown_handler(void *arg) + + prctl(PR_SET_NAME, "Shutdown"); + +- sem_wait(&g_daemon_shutdown_sem); ++ while(sem_wait(&g_daemon_shutdown_sem) == -1 && errno == EINTR) { ++ continue; ++ } + + daemon_shutdown(); + +@@ -1829,7 +1831,9 @@ int main(int argc, char **argv) + + server_common_start(); + +- sem_wait(&g_daemon_wait_shutdown_sem); ++ while(sem_wait(&g_daemon_wait_shutdown_sem) == -1 && errno == EINTR) { ++ continue; ++ } + + DAEMON_CLEAR_ERRMSG(); + return 0; +diff --git a/src/daemon/entry/connect/grpc/grpc_containers_service.cc b/src/daemon/entry/connect/grpc/grpc_containers_service.cc +index c31137bf..43cab31a 100644 +--- a/src/daemon/entry/connect/grpc/grpc_containers_service.cc ++++ b/src/daemon/entry/connect/grpc/grpc_containers_service.cc +@@ -416,7 +416,9 @@ Status ContainerServiceImpl::RemoteStart(ServerContext *context, + // close pipe 1 first, make sure io copy thread exit + close(read_pipe_fd[1]); + if (container_req->attach_stderr && ret == 0) { +- (void)sem_wait(&sem); ++ while(sem_wait(&sem) == -1 && errno == EINTR) { ++ continue; ++ } + } + (void)sem_destroy(&sem); + close(read_pipe_fd[0]); +@@ -1031,7 +1033,9 @@ Status ContainerServiceImpl::Attach(ServerContext *context, ServerReaderWriterattach_stderr && ret == 0) { +- (void)sem_wait(&sem_stderr); ++ while(sem_wait(&sem_stderr) == -1 && errno == EINTR) { ++ continue; ++ } + } + (void)sem_destroy(&sem_stderr); + close(pipefd[0]); +diff --git a/src/daemon/entry/cri/websocket/service/attach_serve.cc b/src/daemon/entry/cri/websocket/service/attach_serve.cc +index 336ec1bc..91330128 100644 +--- a/src/daemon/entry/cri/websocket/service/attach_serve.cc ++++ b/src/daemon/entry/cri/websocket/service/attach_serve.cc +@@ -149,7 +149,9 @@ int AttachServe::ExecuteStreamCommand(SessionData *lwsCtx, void *request) + WsWriteStdoutToClient(lwsCtx, message.c_str(), message.length()); + } else { + // wait io copy thread complete +- (void)sem_wait(&attachSem); ++ while(sem_wait(&attachSem) == -1 && errno == EINTR) { ++ continue; ++ } + } + + (void)sem_destroy(&attachSem); +diff --git a/src/daemon/entry/cri/websocket/service/ws_server.cc b/src/daemon/entry/cri/websocket/service/ws_server.cc +index a85e4a02..0ef21b13 100644 +--- a/src/daemon/entry/cri/websocket/service/ws_server.cc ++++ b/src/daemon/entry/cri/websocket/service/ws_server.cc +@@ -315,7 +315,10 @@ void WebsocketServer::CloseWsSession(int socketID) + close(session->pipes.at(1)); + session->pipes.at(1) = -1; + } +- (void)sem_wait(session->syncCloseSem); ++ ++ while(sem_wait(session->syncCloseSem) == -1 && errno == EINTR) { ++ continue; ++ } + (void)sem_destroy(session->syncCloseSem); + delete session->syncCloseSem; + session->syncCloseSem = nullptr; +diff --git a/src/daemon/modules/events/collector.c b/src/daemon/modules/events/collector.c +index 2729c6be..0b73da6c 100644 +--- a/src/daemon/modules/events/collector.c ++++ b/src/daemon/modules/events/collector.c +@@ -929,7 +929,9 @@ int add_monitor_client(char *name, const types_timestamp_t *since, const types_t + goto sem_free; + } + +- sem_wait(&context_info->context_sem); ++ while(sem_wait(&context_info->context_sem) == -1 && errno == EINTR) { ++ continue; ++ } + + sem_free: + sem_destroy(&context_info->context_sem); +@@ -999,7 +1001,9 @@ static int start_monitored() + goto out; + } + +- sem_wait(msync.monitord_sem); ++ while(sem_wait(msync.monitord_sem) == -1 && errno == EINTR) { ++ continue; ++ } + sem_destroy(msync.monitord_sem); + if (monitored_exitcode) { + isulad_set_error_message("Monitored start failed"); +diff --git a/src/daemon/modules/service/io_handler.c b/src/daemon/modules/service/io_handler.c +index 474fa650..f3b47737 100644 +--- a/src/daemon/modules/service/io_handler.c ++++ b/src/daemon/modules/service/io_handler.c +@@ -485,7 +485,9 @@ static int start_io_copy_thread(int sync_fd, bool detach, struct io_copy_arg *co + return -1; + } + +- sem_wait(&thread_arg.wait_sem); ++ while(sem_wait(&thread_arg.wait_sem) == -1 && errno == EINTR) { ++ continue; ++ } + sem_destroy(&thread_arg.wait_sem); + return 0; + } +-- +2.23.0 + diff --git a/0228-apply-patch-for-lib-shim-v2-install.patch b/0228-apply-patch-for-lib-shim-v2-install.patch new file mode 100644 index 0000000000000000000000000000000000000000..58ee7fbeef24d40d9ceef109129554aba99b8cce --- /dev/null +++ b/0228-apply-patch-for-lib-shim-v2-install.patch @@ -0,0 +1,25 @@ +From 771f3d4c2e13a0359d59f9cb7457f320bb46360f Mon Sep 17 00:00:00 2001 +From: zhongtao +Date: Sun, 19 Jan 2025 18:09:59 +0800 +Subject: [PATCH 15/19] apply patch for lib shim v2 install + +Signed-off-by: zhongtao +--- + CI/install_depends.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CI/install_depends.sh b/CI/install_depends.sh +index df0474c7..046d91b1 100755 +--- a/CI/install_depends.sh ++++ b/CI/install_depends.sh +@@ -152,6 +152,7 @@ cd lib-shim-v2 + tar xf lib-shim-v2-* + dname=$(tar -tf lib-shim-v2-*.tar.gz | head -1) + cd $dname ++git apply ../0* + mkdir .cargo + cat >> ./.cargo/config << EOF + [source.crates-io] +-- +2.23.0 + diff --git a/0229-modify-the-dependent-lib-shim-v2-branch.patch b/0229-modify-the-dependent-lib-shim-v2-branch.patch new file mode 100644 index 0000000000000000000000000000000000000000..4edfebde8c15526afd23625267be7d4344b55f01 --- /dev/null +++ b/0229-modify-the-dependent-lib-shim-v2-branch.patch @@ -0,0 +1,25 @@ +From 9184cf120a53c2102d72133f3a219bfb4f6b0f68 Mon Sep 17 00:00:00 2001 +From: zhongtao +Date: Mon, 20 Jan 2025 16:58:44 +0800 +Subject: [PATCH 16/19] modify the dependent lib shim v2 branch + +Signed-off-by: zhongtao +--- + CI/install_depends.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CI/install_depends.sh b/CI/install_depends.sh +index 046d91b1..b6bdab50 100755 +--- a/CI/install_depends.sh ++++ b/CI/install_depends.sh +@@ -149,6 +149,7 @@ cd ~ + rm -rf lib-shim-v2 + git clone https://gitee.com/src-openeuler/lib-shim-v2.git + cd lib-shim-v2 ++git checkout openEuler-22.03-LTS-SP1 + tar xf lib-shim-v2-* + dname=$(tar -tf lib-shim-v2-*.tar.gz | head -1) + cd $dname +-- +2.23.0 + diff --git a/0230-no-need-to-apply-patch-when-build-lib-shim-v2-for-cu.patch b/0230-no-need-to-apply-patch-when-build-lib-shim-v2-for-cu.patch new file mode 100644 index 0000000000000000000000000000000000000000..857181288a9aa08f400bef88ffcb1c6670af71f8 --- /dev/null +++ b/0230-no-need-to-apply-patch-when-build-lib-shim-v2-for-cu.patch @@ -0,0 +1,28 @@ +From 6764e64090972ab1edcc7c939486c525e22382ea Mon Sep 17 00:00:00 2001 +From: zhongtao +Date: Tue, 21 Jan 2025 09:29:00 +0800 +Subject: [PATCH 17/19] no need to apply patch when build lib shim v2 for + current patch was arch related + +Signed-off-by: zhongtao +--- + CI/install_depends.sh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CI/install_depends.sh b/CI/install_depends.sh +index b6bdab50..4fd7daa8 100755 +--- a/CI/install_depends.sh ++++ b/CI/install_depends.sh +@@ -153,7 +153,8 @@ git checkout openEuler-22.03-LTS-SP1 + tar xf lib-shim-v2-* + dname=$(tar -tf lib-shim-v2-*.tar.gz | head -1) + cd $dname +-git apply ../0* ++# no need to apply patch for current patch was arch related ++# git apply ../0* + mkdir .cargo + cat >> ./.cargo/config << EOF + [source.crates-io] +-- +2.23.0 + diff --git a/0231-followlocation-only-not-with-head.patch b/0231-followlocation-only-not-with-head.patch new file mode 100644 index 0000000000000000000000000000000000000000..610592787c9ae6ddb8a7789f33e44eb8494ed083 --- /dev/null +++ b/0231-followlocation-only-not-with-head.patch @@ -0,0 +1,28 @@ +From b3685b5af7b1e36ad7d7a08c95e961ab1de36792 Mon Sep 17 00:00:00 2001 +From: jikai +Date: Sat, 27 Apr 2024 14:38:58 +0800 +Subject: [PATCH 18/19] followlocation only not with head + +Signed-off-by: jikai +--- + src/utils/http/http.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/utils/http/http.c b/src/utils/http/http.c +index 52b05fa3..976ef041 100644 +--- a/src/utils/http/http.c ++++ b/src/utils/http/http.c +@@ -478,7 +478,9 @@ int http_request(const char *url, struct http_get_options *options, long *respon + if (options->resume) { + curl_easy_setopt(curl_handle, CURLOPT_RESUME_FROM_LARGE, (curl_off_t)fsize); + } +- curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L); ++ if (!options->with_head) { ++ curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L); ++ } + curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, pagefile); + curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, fwrite_file); + } else { +-- +2.23.0 + diff --git a/0232-Fix-memory-leak-issues-in-grpc_containers_client.cc.patch b/0232-Fix-memory-leak-issues-in-grpc_containers_client.cc.patch new file mode 100644 index 0000000000000000000000000000000000000000..ba18f91e65112abe2de7abf000df194cb4753a52 --- /dev/null +++ b/0232-Fix-memory-leak-issues-in-grpc_containers_client.cc.patch @@ -0,0 +1,28 @@ +From 6494342b70f580da160ddefdeb72228bef229c10 Mon Sep 17 00:00:00 2001 +From: wujichao +Date: Wed, 30 Jul 2025 10:22:33 +0800 +Subject: [PATCH 19/19] Fix memory leak issues in grpc_containers_client.cc + +Signed-off-by: wujichao +--- + src/client/connect/protocol_type.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/client/connect/protocol_type.c b/src/client/connect/protocol_type.c +index 64576d1e..55b4477a 100644 +--- a/src/client/connect/protocol_type.c ++++ b/src/client/connect/protocol_type.c +@@ -730,6 +730,10 @@ void isula_stats_response_free(struct isula_stats_response *response) + for (i = 0; i < response->container_num; i++) { + free(response->container_stats[i].id); + response->container_stats[i].id = NULL; ++ free(response->container_stats[i].name); ++ response->container_stats[i].name = NULL; ++ free(response->container_stats[i].status); ++ response->container_stats[i].status = NULL; + } + free(response->container_stats); + response->container_stats = NULL; +-- +2.23.0 + diff --git a/iSulad.spec b/iSulad.spec index d8c7188221e26dcecc9682ad4a459ff776aa74d9..e009684a1bf2eeb86b498dd9fe12275b141f08fa 100644 --- a/iSulad.spec +++ b/iSulad.spec @@ -1,5 +1,5 @@ %global _version 2.0.18 -%global _release 19 +%global _release 20 %global is_systemd 1 %global enable_shimv2 1 %global is_embedded 1 @@ -226,19 +226,25 @@ Patch0210: 0210-allow-env-variable-has-an-empty-value.patch Patch0211: 0211-bugfix-for-hostname-env-set-only-once.patch Patch0212: 0212-fix-bug-for-invalid-env-write.patch Patch0213: 0213-change-fork-process-exit-mode.patch -Patch0214: 0214-skip-test-rely-on-docker.io.patch -Patch0215: 0215-add-skip-test-rely-on-docker.io.patch -Patch0216: 0216-bugfix-for-null-pointer-reference.patch -Patch0217: 0217-move-shutdown-handle-after-init-module.patch -Patch0218: 0218-bugfix-for-file-param-verify.patch -Patch0219: 0219-bugfix-of-background-execution-exec-error-command.patch -Patch0220: 0220-bugfix-for-setting-cpu-rt-to-a-negative-value-when-e.patch -Patch0221: 0221-fix-error-log-for-verify_cpu_realtime.patch -Patch0222: 0222-code-improve.patch -Patch0223: 0223-fix-bug-in-ci-test.patch -Patch0224: 0224-change-pull-registry-to-hub.oepkgs.net.patch -Patch0225: 0225-Synchronize-changes-from-the-master-branch-to-the-st.patch -Patch0226: 0226-fix-synchronize-changes-from-the-master-branch-to-th.patch +Patch0214: 0214-skip-test-rely-on-docker.io.patch +Patch0215: 0215-add-skip-test-rely-on-docker.io.patch +Patch0216: 0216-bugfix-for-null-pointer-reference.patch +Patch0217: 0217-move-shutdown-handle-after-init-module.patch +Patch0218: 0218-bugfix-for-file-param-verify.patch +Patch0219: 0219-bugfix-of-background-execution-exec-error-command.patch +Patch0220: 0220-bugfix-for-setting-cpu-rt-to-a-negative-value-when-e.patch +Patch0221: 0221-fix-error-log-for-verify_cpu_realtime.patch +Patch0222: 0222-code-improve.patch +Patch0223: 0223-fix-bug-in-ci-test.patch +Patch0224: 0224-change-pull-registry-to-hub.oepkgs.net.patch +Patch0225: 0225-Synchronize-changes-from-the-master-branch-to-the-st.patch +Patch0226: 0226-fix-synchronize-changes-from-the-master-branch-to-th.patch +Patch0227: 0227-bugfix-for-sem_wait-call-when-errno-is-EINTR.patch +Patch0228: 0228-apply-patch-for-lib-shim-v2-install.patch +Patch0229: 0229-modify-the-dependent-lib-shim-v2-branch.patch +Patch0230: 0230-no-need-to-apply-patch-when-build-lib-shim-v2-for-cu.patch +Patch0231: 0231-followlocation-only-not-with-head.patch +Patch0232: 0232-Fix-memory-leak-issues-in-grpc_containers_client.cc.patch %ifarch x86_64 aarch64 Provides: libhttpclient.so()(64bit) @@ -483,6 +489,12 @@ fi %endif %changelog +* Fri Sep 30 2025 jingxiaolu - 2.0.18-20 +- Type: bugfix +- ID: NA +- SUG: NA +- DESC: sync patches from upstream + * Fri Oct 18 2024 wujichao - 2.0.18-19 - Type: bugfix - ID: NA