Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
112 Views

VTune breaks program arguments with escaped double quotes

To demonstrate this problem I have the following (Windows) program which just prints its arguments:

c:\dev>print_args.exe "{\"foo\": 123}"
arg[0]: print_args.exe
arg[1]: {"foo": 123}

If I run this using VTune (GUI or command line doesn't matter, I'll use the command line for demonstration purposes):

c:\dev>vtune -collect hotspots -- c:\dev\print_args.exe "{\"foo\": 123}"
vtune: Warning: Hardware collection of CPU events is not possible on this system. Microarchitecture performance insights will not be available.
vtune: Warning: To collect microarchitecture performance insights, run the product as administrator.
vtune: Collection started. To stop the collection, either press CTRL-C or enter from another console window: vtune -r c:\dev\r000hs -command stop.
arg[0]: c:\dev\print_args.exe
arg[1]: {foo: 123}
...

We can see that the double quotes around "foo" have been stripped from the arguments sent to the program. This is breaking our actual application which expects to receive a valid JSON string as input.

Is there a better way to report this issue other than the forum? This is quite a big deal for us.

0 Kudos
6 Replies
Highlighted
Employee
104 Views

Hi.

As fast workaround, could you wrap your application with params by batch script?

run.bat

c:\dev\print_args.exe "{\"foo\": 123}"
vtune -collect hotspots -- RUN_BAT_DIR\run.bat

    Thanks, Kirill

0 Kudos
Beginner
101 Views

It seems there is a difference between the command-line and GUI handling of this.

The GUI workaround is to use \\" instead of \" but this requires hacking/changing the command line options if you are inheriting the settings from Visual Studio.

0 Kudos
Highlighted
Beginner
99 Views

My use case currently is using VTune in combination with the Visual Studio plugin/add-on so these command-line arguments come from the project's Debugger settings. It seems we can workaround this by manually overriding the inherited settings and adding extra \ to the \".

0 Kudos
Highlighted
Moderator
78 Views

Hi Mike,


Has the solution provided by Kirill worked for you. Please let us know if the issue still persists.


Regards,

Chithra


0 Kudos
Highlighted
Moderator
53 Views

Hi Mike,


We are assuming that the issue got resolved with your workaround itself. So, we would discontinue monitoring this issue. Please raise a new thread if you have further issues.


Regards,

Chithra J


0 Kudos
Highlighted
Beginner
48 Views

I have been able to work around the problem, but I still consider this a bug that should be fixed. Thanks for the suggestions all.

0 Kudos