overture icon indicating copy to clipboard operation
overture copied to clipboard

Unanticipated project name prevents model from being executed

Open peterwvj opened this issue 10 years ago • 2 comments

It's possible to create a project with a name that prevents any launch configuration based on this project be executed. The error messages you get indicate some internal crash. To demonstrate this, create a new project with the name "Dots & Boxes".

Now, create a small spec like the one shown below:

functions

f : () -> nat
f () == 1;

Try to set up a launch configuration and run it. You should get a message in the error log similar to that shown below. The same happens if you run the model in console mode. It seems like the DBGP protocol is not able to cope with "special characters" in file names.

org.overture.ide.debug.core.dbgp.exceptions.DbgpProtocolException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 207; The entity name must immediately follow the '&' in the entity reference.
    at org.overture.ide.debug.core.dbgp.internal.utils.DbgpXmlParser.parseXml(DbgpXmlParser.java:101)
    at org.overture.ide.debug.core.dbgp.internal.DbgpRawPacket.getParsedXml(DbgpRawPacket.java:125)
    at org.overture.ide.debug.core.dbgp.internal.packets.DbgpPacketReceiver.workingCycle(DbgpPacketReceiver.java:165)
    at org.overture.ide.debug.core.dbgp.internal.DbgpWorkingThread$1.run(DbgpWorkingThread.java:48)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 207; The entity name must immediately follow the '&' in the entity reference.
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
    at org.overture.ide.debug.core.dbgp.internal.utils.DbgpXmlParser.parseXml(DbgpXmlParser.java:95)
    ... 4 more

peterwvj avatar Nov 02 '15 17:11 peterwvj

What's the best solution for this? Do we normalise/denormalise the message before sending/receiving it (in order to get rid of problematic characters), or do we simply disallow these characters when the project name is created?

peterwvj avatar Jan 19 '16 20:01 peterwvj

Ban problematic project names. This is extremely common in other tools and not a big deal for users.

They shouldn't be using &s in their names anyway :)

ldcouto avatar Jan 21 '16 11:01 ldcouto