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

[PAN] runltp flow gets stuck when executing some Linux utilities/binaries #951

Open mcm187 opened 2 years ago

mcm187 commented 2 years ago

While testing SOF firmware I noticed that when trying to calculate audio file duration using "ffmpeg" command LTP flow gets stuck until the test reaches test timeout [ABT]. Running the "ffmpeg" command directly on the system, without LTP flow, works as expected.

Steps:

  1. Execute directly: ffmpeg -i audio24k32M.wav -f null - 2>&1 | grep -Poa "time=(\d{2}.){3}\d{2}" | tail -1 | cut -d "=" -f 2 Output: 00:00:04.94
  1. Create ffmpeg command file and execute to perform the test through LTP: ffmpeg_test_file:
Test1  uname -r
Test2  ffmpeg -i audio24k32M.wav -f null - 2>&1 | grep -Poa "time=(\d{2}.){3}\d{2}" | tail -1 | cut -d "=" -f 2
Test3  pwd
  1. run: ./runltp -p -l ffmpeg.log -f ltp_command_file -t 5m Output: Unable to be handled by LTP flow/Stuck at "ffmpeg" execution:
    
    <<<test_start>>>
    tag=Test2 stime=1647174343
    cmdline="ffmpeg -i audio24k32M.wav -f null - 2>&1 | grep -Poa "time=(\d{2}.){3}\d{2}" | tail -1 | cut -d "=" -f 2"

contacts="" analysis=exit <<>>

[ 2391.204936] audit: type=1006 audit(1647174601.956:6): pid=1889 uid=0 old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=3 r1 [ 2391.217395] audit: type=1300 audit(1647174601.956:6): arch=c00000b7 syscall=64 success=yes exit=1 a0=3 a1=ffffd0dade00 a2=1 a3=ffffbc) [ 2391.243215] audit: type=1327 audit(1647174601.956:6): proctitle=2F7573722F7362696E2F63726F6E64002D6E PAN stop Alarm was received



**Additional info:**
-Valid issue for other Linux utilities
Log attached:
[LTP_flow_ffmpeg.log](https://github.com/linux-test-project/ltp/files/9173983/LTP_flow_ffmpeg.log)
pevik commented 2 years ago

Thanks for your report, but I guess this has very little priority for us, because we're working on a python rewrite (https://github.com/acerv/runltp-ng) which will replace previous attempt in perl (https://github.com/metan-ucw/runltp-ng). It eventually replaces runltp. But you're welcome to try to fix it yourself and send a patch to our mailing list.

mcm187 commented 2 years ago

Thank you for your honest input on this issue. Since the problem has an impact on multiple tests and is reproducible with other commands than "ffmpeg" and can you please try this scenario on the new ng framework that you are working for?

Below you can find other similar issues related to the framework handle failure:

1. the "~" sign isn't recognize inside of the script as an existent folder. The workaround Solution is to replace it with absolute path: /home/root/ (since root is the user that will run the test)

2. The last "&" sign it is not recognized inside of the script. modetest -M imx-drm -s 90@38:1920x1080-60.00@AR24 >& tmplog.txt &

3. Others taken directly from the ltp log:

TGE-0-vtest_check_existence type vtest 
pan(1355): execvp of 'type' (tag TGE-0-vtest_check_existence) failed. errno:2 No such file or directory
TGE-0-ecdsa-lib-imx_checkbin type ecdsa_tester
pan(1355): execvp of 'type' (tag TGE-0-ecdsa-lib-imx_checkbin) failed. errno:2 No such file or directory
TGE-0-hsm_check_seco-lib ls /dev/seco_mu*
ls: cannot access '/dev/seco_mu': No such file or directory*
TGE-0-hsm_check_existence type hsm_test
pan(1355): execvp of 'type' (tag TGE-0-hsm_check_existence) failed. errno:2 No such file or directory

When the commands are executed directly on the device without runltp, commands are executed with success.

pevik commented 2 years ago

@acerv FYI

acerv commented 2 years ago

Hi @mcm187 , thank you for your feedback!

Referring to your last comment:

To sum up things, I would suggest to create a test using LTP Shell test API and link that test to a runtest file.

mcm187 commented 2 years ago

Hi @acerv

Thank you for the detailed explanation of the test template design, we'll try to take into account all these rules in our test environment from now on. Regarding the proposed actions will try to run the tests according to your input and let you know if this solution elucidates our problem. I'll get back to you with an update on this topic soon.

acerv commented 2 years ago

@mcm187 I'm glad that you find it useful. Just to point out one thing: I was in error when I said that ltp-pan doesn't execute shell built-in commands. It does, since it's converting any command having spaces into a command for the shell that has to be executed with sh -c. Beside this, all of the other statements are correct and we suggest using shell scripting in any case. Thanks!