Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#5804 closed defect (fixed)

Profiling blocks+html is broken again in OMEdit

Reported by: casella Owned by: adrpo
Priority: blocker Milestone: 1.16.0
Component: OMEdit Version:
Keywords: Cc:

Description

It seems that we really cannot keep profiling to work for more than half a year (see #4708, #5030).

Steps to reproduce:

  • open OMEdit 1.16.0-dev
  • open Modelica.Blocks.Examples.PID_Controller
  • enable blocks+html profiling in the Simulation Setup | Simulation window
  • run the simulation

The following error messages are reported

Plot command failed: C:/Program Files/OpenModelica1.16.0-dev-64bit//lib/omc/libexec/gnuplot/binary/gnuplot.exe d:/temp/OMEdit/Modelica.Blocks.Examples.PID_Controller/Modelica.Blocks.Examples.PID_Controller_prof.plt

Failed to generate html version of profiling results: C:/Program Files/OpenModelica1.16.0-dev-64bit//lib/omc/libexec/xsltproc/xsltproc.exe -o d:/temp/OMEdit/Modelica.Blocks.Examples.PID_Controller/Modelica.Blocks.Examples.PID_Controller_prof.html C:/Program Files/OpenModelica1.16.0-dev-64bit//share/omc/scripts/default_profiling.xsl d:/temp/OMEdit/Modelica.Blocks.Examples.PID_Controller/Modelica.Blocks.Examples.PID_Controller_prof.xml

Time measurements are stored in d:/temp/OMEdit/Modelica.Blocks.Examples.PID_Controller/Modelica.Blocks.Examples.PID_Controller_prof.html (human-readable) and d:/temp/OMEdit/Modelica.Blocks.Examples.PID_Controller/Modelica.Blocks.Examples.PID_Controller_prof.xml (for XSL transforms or more details)
"C:/Program" non è riconosciuto come comando interno o esterno, 
 un programma eseguibile o un file batch. 

"C:/Program" non è riconosciuto come comando interno o esterno, 
 un programma eseguibile o un file batch. 

and of course the HTML file is not produced, nor any data is visualized in the declarative debugger.

I guess this is yet another case of space in an executable path (the damn Program Files breaking a Windows script. May them be damned.

The other options that do not produce an html file work fine, and the profiling results are eventualy loaded in the debugger.

Can you please fix this ASAP?

Change History (11)

comment:1 Changed 4 years ago by sjoelund.se

@adeel: can Windows escape paths in the system call using double quotes? some of these issues affect Linux as well (if spaces are in the install path)

comment:2 Changed 4 years ago by adeas31

Yes of course escaping the path using double quotes is the way to go

comment:3 Changed 4 years ago by casella

Sorry to push you, I badly need this stuff to prepare the keynote next week. Any chance to get it fixed by today or tomorrow?

comment:6 Changed 4 years ago by adrpo

Tested the fix and is not working. Seems you need to also quote the entire thing send to system!?
https://stackoverflow.com/questions/2642551/windows-c-system-call-with-spaces-in-command
I have an additional fix for this.

comment:7 Changed 4 years ago by adrpo

Fixed via: https://github.com/OpenModelica/OpenModelica/pull/702
Also tested it. Hopefully will work fine in the tomorrow's build.

comment:8 Changed 4 years ago by casella

Thank you folks!

BTW, it was not only an OMEdit issue, the thing was broken also from command line scripts.

I guess we should put some profiling stuff in the testsuite so that we catch when it gets broken, though I'm not 100% sure if and how this could be done.

comment:9 Changed 4 years ago by adrpo

  • Resolution set to fixed
  • Status changed from accepted to closed

Of course, this will also work from command line. The call to gnuplot and xsltproc is done by the simulation executable so the fix will work for any qt client or omc.

Fixed in 6589c8/OpenModelica.

comment:10 Changed 4 years ago by sjoelund.se

We do have profiling stuff in the test suite, but no spaces in the install path :)

comment:11 Changed 4 years ago by casella

See #5811 :)

Note: See TracTickets for help on using tickets.