You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry to open a bug report this close to the weekend and especially around Christmas 馃巹 There might be a minor bug which has floated around for quite some time.
Describe the bug
LIKWID's CLI parsing does not correctly forward all empty arguments to the profiled application. An empty argument is only passed on correctly if it is the very last argument in the argument list. I only tested this behaviour for likwid-perfctr although this bug might be present in other LIKWID tools as well due to the shared code base.
To Reproduce
The following shell commands act as a reproducer and use taskset's argument forwarding as a reference:
:> test.sh
chmod +x test.sh
cat >> test.sh <<EOFecho "Number of Arguments: \${#}"for argument in "\${@}"; do echo "--> '\${argument}'"doneEOFecho'Running taskset...'
taskset -c 0 test.sh -a '' -b '' -c ''
taskset -c 0 test.sh -a '' -b '' -c 'argument'echo'Running likwid-perfctr...'
likwid-perfctr -C 0 -g MEM -o output.txt -- test.sh -a '' -b '' -c ''
likwid-perfctr -C 0 -g MEM -o output.txt -- test.sh -a '' -b '' -c 'argument'
rm -f test.sh output.txt
We can see that LIKWID deviates from taskset's behaviour in the resulting output:
Running taskset...
Number of Arguments: 6
--> '-a'
--> ''
--> '-b'
--> ''
--> '-c'
--> ''
Number of Arguments: 6
--> '-a'
--> ''
--> '-b'
--> ''
--> '-c'
--> 'argument'
Running likwid-perfctr...
Number of Arguments: 4
--> '-a'
--> '-b'
--> '-c'
--> ''
Number of Arguments: 4
--> '-a'
--> '-b'
--> '-c'
--> 'argument'
This was tested with the following LIKWID version:
$ likwid-perfctr -v
likwid-perfctr -- Version 5.0.2 (commit: 233ab943543480cd46058b34616c174198ba0459)
OS version (probably not relevant):
$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.8.2003 (Core)
Release: 7.8.2003
Codename: Core
The bug is not specific to an application.
The bug is not specific to a hardware architecture.
The bug is not associated with GPUs
The bug is not associated with the MarkerAPI.
To Reproduce with a LIKWID command
If you need the complete output of likwid-perfctr with -V 3, I can supply the full output. But since the bug is not associated to the perfmon infrastructure, I have only pasted the relevant parts below:
Running taskset...
Number of Arguments: 6
--> '-a'
--> ''
--> '-b'
--> ''
--> '-c'
--> ''
Number of Arguments: 6
--> '-a'
--> ''
--> '-b'
--> ''
--> '-c'
--> 'argument'
# start LIKWID debug output
Running likwid-perfctr...
# more LIKWID debug output
Executing: test.sh -a -b -c
# more LIKWID debug output
Number of Arguments: 4
--> '-a'
--> '-b'
--> '-c'
--> ''
# more LIKWID debug output
# start LIKWID debug output
Executing: test.sh -a -b -c argument
# more LIKWID debug output
Number of Arguments: 4
--> '-a'
--> '-b'
--> '-c'
--> 'argument'
# more LIKWID debug output
Additional context
I suspect that the bug occurs due to the interaction of these three parts of the code:
Can confirm that the fix pushed to the empty_cli_args branch fixes this issue 馃憣
Other tests with nested quotes as arguments ("''" or '""') also work fine 馃憤
Thanks Thomas 馃帀
Hi Thomas,
Sorry to open a bug report this close to the weekend and especially around Christmas 馃巹 There might be a minor bug which has floated around for quite some time.
Describe the bug
LIKWID's CLI parsing does not correctly forward all empty arguments to the profiled application. An empty argument is only passed on correctly if it is the very last argument in the argument list. I only tested this behaviour for
likwid-perfctr
although this bug might be present in other LIKWID tools as well due to the shared code base.To Reproduce
The following shell commands act as a reproducer and use
taskset
's argument forwarding as a reference:We can see that LIKWID deviates from
taskset
's behaviour in the resulting output:This was tested with the following LIKWID version:
OS version (probably not relevant):
The bug is not specific to an application.
The bug is not specific to a hardware architecture.
The bug is not associated with GPUs
The bug is not associated with the MarkerAPI.
To Reproduce with a LIKWID command
If you need the complete output of likwid-perfctr with
-V 3
, I can supply the full output. But since the bug is not associated to theperfmon
infrastructure, I have only pasted the relevant parts below:Additional context
I suspect that the bug occurs due to the interaction of these three parts of the code:
However, you probably know best where to look 馃憤 Hope the descriptions helps in bug hunting nevertheless 馃悰
Greetings,
Christian
Edit: Also verified that the same bug occurs for the latest 5.1.0 LIKWID release
The text was updated successfully, but these errors were encountered: