Analyzers
Support for Analyzers (Intel VTune™ Profiler, Intel Advisor, Intel Inspector)
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
4790 Discussions

VTune breaks program arguments with escaped double quotes

MikeWhatever
Beginner
688 Views

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
7 Replies
Kirill_U_Intel
Employee
680 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

MikeWhatever
Beginner
677 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.

MikeWhatever
Beginner
675 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 \".

ChithraJ_Intel
Moderator
654 Views

Hi Mike,


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


Regards,

Chithra


ChithraJ_Intel
Moderator
629 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


MikeWhatever
Beginner
624 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.

MikeWhateverr
Beginner
223 Views

Couple of years later and I'm stilling hoping this will be fixed at some point...

Reply