linux-test-project / ltp

Linux Test Project (mailing list: https://lists.linux.it/listinfo/ltp)
https://linux-test-project.readthedocs.io/
GNU General Public License v2.0
2.32k stars 1.01k forks source link

memcg_test_3: don't send signal when parent unexpectedly exited #934

Closed ZhangHongchen1 closed 10 months ago

ZhangHongchen1 commented 2 years ago

When the parent process exits abnormally for some reason, the parent process of the child process will become process 1. In this case, the child process should not send signal to process 1.

So we compare the realy parent pid and the saved parent pid,the child process should exit when they has mismatched.

Signed-off-by: Lingling Li lilingling@loongson.cn Signed-off-by: Hongchen Zhang zhanghongchen@loongson.cn

richiejp commented 1 year ago

Hello, looks good, but needs to be rebased on latest HEAD.

pevik commented 1 year ago

Out of curiosity, can you share steps how to reproduce the problem?

ZhangHongchen1 commented 1 year ago

Hello, looks good, but needs to be rebased on latest HEAD.

@richiejp Sorry to reply too late. OK, let me rebase to the latested HEAD.

ZhangHongchen1 commented 1 year ago

Out of curiosity, can you share steps how to reproduce the problem?

@pevik When I test runltp,I observed the/varllog/messages file, which records a large number of signal send from memcg_test_3 to the systemd process.