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.28k stars 999 forks source link

I got some errors When I excuted dio module test #1048

Closed LinuxVWQH closed 11 months ago

LinuxVWQH commented 1 year ago

Recently,I got some errors When I excute dio module test. for example: image image When I got some expection,I guessed maybe these bin file were ran much times firstly.But I soon found out that my guess was wrong,becase I added some log in these C files and the log telled me the progess`s PID was same!!! for example: image Next,I analysed ltp-pan.c,I found ltp-pan made associate stdout with a log file! I thought will be a buffer problem and I analysed diotest6.c/diotest3.c. It's almost certain here,this is a typetical buffer problem.The author did not realized the buffer copy when user appointed the output log file, The diotest6/diotes3 was designed third steps whole programe,every step will fork lots of process,If the cache subprocess is not cleaned up, the cache generated in the previous step will be copied, and then when each process exits, a large number of repeated prints will be generated.Every coder should know that when stdout is associated with a file, the output is placed in the buffer. Lastely,I designed two tests,one was not appointed log file and another was appointed log file.As expected, the results validated my analysis. Now,I already commit my fugfix: https://github.com/linux-test-project/ltp/pull/1052#issue-1793147199,I think it can be help everyone whether you are ltp coder or a user:)