The-OpenROAD-Project / OpenSTA

OpenSTA engine
GNU General Public License v3.0
399 stars 172 forks source link

Splash TCL causes Tcl error and immediately halts the program #1

Closed RTimothyEdwards closed 5 years ago

RTimothyEdwards commented 5 years ago

I found that attempting to run OpenSTA crashed immediately on a TCL error. By printing out the decoded string passed to Tcl_Eval(), I discovered that tcl/Splash.tcl procedure "show_warranty" has non-ASCII characters representing the double quotes around the term "AS IS". In effect, this effectively terminated the string at the non-ASCII component and the input to Tcl_Eval became bad syntax.

The very easy solution is to replace the non-ASCII characters with escaped ASCII quote characters.

I'm not sure what it is about my system (Fedora, perhaps, or maybe just the version of Tcl/Tk) causes the issue to show up, but it's definitely one of those cases where the ounce of prevention is worth the pound of cure.

---Tim

jjcherry56 commented 5 years ago

nasty. not sure why it didn't barf on my end. fixed now.

RTimothyEdwards commented 5 years ago

Please revisit this. You changed the outer quotes to braces but the non-ASCII (unicode?) quotes around the text "AS IS" remain, which does not solve the problem. The non-ASCII characters are apparently the nice typographical quotes from the ISO-Latin1 set, but they are non-ASCII, and Tcl does not like them (at least some versions of Tcl. Mine throws an error; your mileage may vary). Just replace them with normal ASCII quotes, backslash-escaped since it is in a tcl "puts" command. Like this:

PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND

That should keep all versions of Tcl happy.

---Tim

jjcherry56 commented 5 years ago

I took another swipe at this with 'od -c' to see the non-printing characters. Let me know if it works this time.

RTimothyEdwards commented 5 years ago

Looks okay now, thanks.