Recently,I got some errors When I excute dio module test.
for example:
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:
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:)
Recently,I got some errors When I excute dio module test. for example:
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:
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:)