Common Problems

You may also wish to look in the Design/CPN bug list.

Accidental Use of Symbolic Identifiers

In Standard ML you are allowed to use symbolic identifiers, i.e., you can create an identifier by combining the symbols:
  ! % & $ # + - / : < = > ? @ \ ~ ` ^ | *
Often users write record expressions and get strange syntax errors. E.g., watch out for record expressions like
  {field1= #field2 myrecord}
Remember a space between "#" and "=" above. Otherwise you get a syntax error.

Old Design/CPN Diagrams

If you have used Design/CPN for several years, you may have some old diagrams which originally are created with Design/CPN version 1.9 (or earlier). Some of these diagrams cause Design/CPN 3.0 to crash when loaded. However, there is an easy work-around: Open the diagrams in Design/CPN 2.0 and save them there. Then open the new versions in Design/CPN 3.0.

Diagram Backwards Non-compatibility

In general there is not backwards compatibility between versions of Design/CPN, which means that one cannot expect to take a new diagram and load it with an old version of the tool. When one accidentally tries anyway then the tool will indicate via a number of dialogs that there is diagram compatibility problems. Unfortunately in the specific case of version 3.0.1, if a diagram from a newer version of the tool is loaded as a result of starting 3.0.1 with a file name command line argument, then the tool will crash. The crash can be avoided by just using the File Open menu instead - but of course the tool will still indicate that the newer diagram cannot be loaded.

In particular we recommend to be careful when exchanging diagrams between users, where it typically is not obvious which versions of Design/CPN are in use.

See also bug report [960823b0004].


Truncated ML Values

Some times you will see an ML result value written with "#" or "...", where the value seems to be somehow truncated. E.g., you might see a string written as
  "abcdefghijklm#",
a list written as
  [1,2,3,4,5,...],
or a deep nesting of constructors written as
  node (node (node #,node #),node (node #,node #)).
If you wish to see the whole result value you can adjust one of the following ML reference values.

For Design/CPN version 3.x:

  (* depth of nested values *)
  System.Control.Print.printDepth  := 200 ;

  (* length of lists *)
  System.Control.Print.printLength := 100 ;

  (* length of strings *)
  System.Control.Print.stringDepth := 100 ;
For Design/CPN version 4.x:
  (* depth of nested values *)
  Compiler.Control.Print.printDepth  := 200 ;

  (* length of lists *)
  Compiler.Control.Print.printLength := 100 ;

  (* length of strings *)
  Compiler.Control.Print.stringDepth := 100 ;
The numbers written above are default settings. You can modify any of the reference values by typing in the appropriate line above into an auxiliary object (the Aux menu) and then use ML Evaluate (also the Aux menu).

Keyboard Mapping

The Design/CPN documentation refers to the ALT key as key equvivalent/short-cut. Your system may use a differt key mapping, e.g., the LEFT key rather than the ALT key. Internally, design/CPN is reacting to the META_L key. You can configure the standard X Windows utilities xev and xmodmap to re-configure your system to produce the prefered mapping.

Element Selectors of Long Tuples

Appart from pattern matching, it is possible to get components of tuples with pre-defined tuple element selectors #<integer> <tuple>. E.g., #3 (1,2,0,4) returns the value 0.

Unfortunately there is a problem with the ML engine we are using, which is SML/NJ version 0.93. In this version there is a limit of only 9 pre-defined tuple element selectors: #1...#9. Thus, e.g., #10 (1,2,3,4,5,6,7,8,9,0) is illegal.

The work-around is to declare you own selectors by means of pattern matching. E.g., the following function will simulate a non-polymorphic version of #10:

  fun sel10 ((_,_,_,_,_,_,_,_,_,_,k):CS) = k;
The only limitation of this solution is that you need to give the type, here called CS, and thus sel10 will not be a polymorph function.

Enter Occ Graph Fails

The following is a trouble-shooting guide in case the switch to the Occurrence Graph Tool fails (invoked by the menu File->Enter Occ Graph).

We assume that you are in the simulator mode of Design/CPN, and that you have made a syntax check with the OG Tool Violations checked in the Optional Syntax Restrictions dialog (see the menu Set->Syntax Options...). Follow the steps below:

  1. Attempt to enter the Occurrence Graph Tool (OGT) by invoking the menu File->Enter Occ Graph.
  2. The switch to OGT fails. You will see the dialog box "Error: Attempt to Enter OG Graph failed".
  3. Create an auxiliary box (invoke the menu Aux->Box) and type in the text:
      use (ogpath^"OGswitch.sml");
  4. Evaluate the box by invoking the menu Aux->ML Evaluate. You will see that the auxiliary box gets a gray pattern, and a rounded box to the right of the auxiliary box is created (the response box).
  5. ML Evaluate has completed when the gray pattern disappears. Now select the response box (the rounded box) and invoken the menu File->Save Text... - at the file dialog, provide and appropriate file name.
  6. Investigate the text file just saved. At the end of the file, look for error messages. If you do not understand the error message you can send the entire text file to Design/CPN technical support.
One of the most common problems that makes the switch to the OGT fail is accidental use of names already used by OGT. Thus if the response text indicates some kind of error in relation with a name you use in the CP-net model, then you might be able to fix the problem by changing the name. This name could be identifier names, and even names of places and transitions.

Another common cause of OGT failures is carriage return characters in colour set regions. Be sure that no colour set regions contain any carriage returns. (Other non-printable characters can also cause problems like, e.g., the tab character.)


PostScript Figures Clipped

If your PostScript figures seems to be clipped erroneously, e.g., when used as EPS in LaTeX or Word, then you may solve the problem as follows. Take your diagram into Design/CPN and check that all graphical objects are located inside the page border. (You may need to make the page border visible via the Page Attributes dialog.) If not then select all objects and move them inside the page border. In case the objects do not fit within the page border then you can enlarge the page temporarely while creating PostScript output via the Page Attributes dialog (remember to use scale to fit in the Page Setup dialog). More information is available on the topic How to Produce PostScript Output.

Degenerate Defaults

Degenerate or corrupted defaults may lead to strange behaviour of Design/CPN, e.g., when creating objects. In some cases the tool may crash just by creating a new object. If you suspect that the defaults are somehow bad then look at Tips'n'Tricks under the section on "How to Get Fresh Defaults".

Defaults and Running Multiple Copies Concurrently

On UNIX it is easy to have multiple copies of Design/CPN running concurrently with the same user id. (On the Macintosh it is neither easy nor common.) Under such a scenario the default settings file will be shared between the two applications. This will cause problems when using Copy defaults (the Set menu), i.e., when one wants to transfer defaults between running applications. If system defaults are saved in the first application, then Copy defaults (system to diagram) in the second application will have no effect. The most recent defaults will only be loaded correctly if the second application is restarted - it is not sufficient to invoke new or revert.

In general on UNIX one may experience problems with sharing of files. Of course the outcome of two users saving to the same diagram file is unpredictable.

See also bug report [960823b0005].


"ML could not be started"

On UNIX you may see various error messages when the ML-engine cannot be started. One common message is:
  Network not responding. 
  Connection with host could not be established.
This typically happens when the settings in the ML Configuration Options dialog (Set menu) are not right. Check the host name and port number. If you are convinced that the settings are right, check that the cpnmld daemon is running on the target machine (specified by the host name). Login on this machine and list the processes, e.g., with the UNIX command called "ps". If it is running you will see something like:
  root   163     1 80   Dec 06 ?    0:02 /usr/local/lib/cpnmld 2000
In case such a line is not printed by ps, you should contact the person who is responsible for the installation of Design/CPN to fix the problem.

Another common message is:

  ML could not be started.
  Check available memory and presence of default ML file.
In this case you should check the ML image name and path in the ML Configuration Options. Be sure that the cpn.ML file is accessible on the machine indicated by the host name. Try logging in into the machine and check that the cpn.ML file is visible in that file system.

There can be many other causes to why the ML-engine will not start. One is memory, insufficient execution permissions, password problems, and many other possibilities. If you cannot solve the problem, then it would be most helpful that the error report is as complete as possible. Tell us what exactly you did and which machine configuration you have. Furthermore, the cpnmld daemon creates a log file on the machine it is running. Log into the machine where you tried to start the ML-engine on and send us a copy of the text file located as:

  /usr/tmp/cpnmld.log.#
where '#' is the port number. You may also try to look in the file by yourself. The indication of a possible cause of error is typically found at the end of the file.

"CPN FAM could not be started"

On the Macintosh you may see the message
  CPN FAM could not be started.
  Check available memory and presence of CPN.ML file.
This may happen if you try starting the ML engine (the CPN FAM), e.g., when invoking the syntax check or entering the simulator. The message typically occurs if the CPN FAM does not have sufficient memory to start.

You should check the following: Go to the Finder and invoke "About this Macintosh" from the Apple menu. There you can see how big the largest chunk of available memory is. Then select the CPN FAM and invoke Get Info. The size of the CPN FAM should be less than available memory in the Finder.

See also CPN FAM Memory Usage on Macintosh in Tips'n'Tricks.


Non-ASCII Character Trouble

On the UNIX platform only characters between " " (space) and "~" are visible in the graphics. There is currently no work-around for this.

On the Macintosh platform characters outside the range " " (space) and "~" are visible in the graphics, but if used inside strings of ML they will disappear in the resulting graphical output. The work-around is to escape the characters inside ML strings. Thus if you wish to use the bullet character, which has the character value 165, then the following backslash notation should be used:

  val my_string = "This is a bullet: \165" ;

ByteArray Structure on Linux

On Linux there is a problem with the ByteArray structure, more precisely the ByteArray.update function. The update function has the form:
  ByteArray.update(ba,i,n)
where ba is a byte array, i an index, and n is the new integer value. If n is in the range 127-255, then the ML-engine will generate the internal error:
  Error: Compiler bug: i386/i386mcode.sml: movb:
    immediate value is not byte-sized
After such a message the ML-engine may be in an inconsistent state. The work-around is to use the update function for values of n only in the range 0-127, or alternatively to use the Array structure instead of ByteArray.

Load Subdiagram Side-effects

The load subdiagram feature does not preserve the original semantics of a page stored with save subdiagram. Some auxiliary and other objects may be converted into CPN objects. Box-shaped objects will be converted into transitions and round-shaped objects will be converted into places. This means, e.g., that the global declaration node will become a transition.

Therefore, if you enter a diagram page with load subdiagram, then you need to go through a number of objects and change their type. E.g., if your page loaded originally contained a global declaration node then you need to select the object which erroneously has become a transition. First invoke Convert to Aux from the Aux menu and then invoke Convert to CPN and select Global Declaration Node in the dialog.

Another side-effect is that Load Subdiagram changes the type of port nodes to General Port. This can be fixed by selecting each port node and then invoke Port Place from the CPN menu. A dialog is presented where you can change the port node type.


ML-interface to Simulator

The ML-interface to the simulation structure is documented in the Programmer's Manual. Although not mentioned in the manual, these functions are not integrated with the graphical interface. This means that use of these functions, e.g., GetChangeMarkingCode, do not tell the interface of the simulator to update its graphics. This must be handled explicitly via the user interface.

Char Range Colour Sets

Declaring colour sets with char ranges over 127 does not work with the Edinburgh ML-engine, i.e., Design/CPN on the Mac. For instance, the following declaration works fine:
  color CHAR = string with "\000".."\127"  and 1..1;
but the following does not:
  color CHAR = string with "\000".."\128"  and 1..1;
Both of these declarations work fine with SML/NJ, i.e., Design/CPN on UNIX.

"An ML exception has been raised during Automatic Run"

During automatic simulation you may encounter the following dialog message:
  An ML exception has been raised during Automatic Run.
  We propose that you call Enter Editor or Initial State.
Such a message can have many causes and can be difficult to find without more information. Of course exceptions can be raised due to unknown bugs in Design/CPN, but it is more likely that it is an exception raised by a function or expression declared by the user. To get more information about the exception do the following: Enter the simulator and be sure the Automatic Run entry in the Sim menu is enabled. Once in the simulator create a box (Aux menu) on a page and type in the following text:
  sac_step();
(Use "fast_sac_step();" if running in fast automatic mode.) Leave text mode and then invoke the Aux menu item ML Evaluate. As a result a rounded box will be created to the right of the box. When the gray pattern disappears the rounded box may contain the text:
  Unhandled Exception: <exception name>
where <exception name> is the name you are looking for. If this name does not make sense to you then get help from Design/CPN technical support and remember to include the name of the exception (and other details that may be of help to us).

However, if you in the rounded box see "Error: No more enabled transitions" then it means that the simulator did not meet the exception in this run. You may wish to try again, i.e., invoke Initial State from the Sim menu and select the box with "sac_step()" and invoke ML Evaluate from the Aux menu. Note that you may not experience the exception in every run due to non-determinism in your model.


Trouble with the Declaration Nodes

There are three kinds of declaration nodes available: global, temporary, and local. A Design/CPN diagram can have at most one Global Declaration Node and at most one Temporary Declaration Node, while you can have more Local Declaration Nodes, however at most one for each page.

The Temporary Declaration Node should be used with great care. NEVER use a Temporary Declaration Node to change an existing declaration (Design/CPN will NOT recheck and reswitch the net inscriptions where the declaration is used). We recommend to add new declarations only.

The only declarations which can be used in a Local Declaration Node are Page Reference Variables and Instance Reference Variables. (For more information see the Design/CPN CPN ML Reference under reference variables.) Global Reference Variables can only be used in the Global Declaration Node.

See also How to Speed Up Your Syntax Check on the Tips'n'Tricks page.


Transition Log Regions

Transition log regions does only work properly when used in interactive simulation mode and does not work at all in any of the automatic simulation modes.

It is the plan that support for transition log regions will discontinue in future versions of Design/CPN.

We suggest that you alternatively try investigating, e.g., streams (i.e., writing to files), reports (see the General Simulation Options in the Set-menu), or even the Mimic library.


The cpn.ML could not find libc.so.4

This problem arises because the NJ/SML93 compiler used for Linux is dynamically linked. On many newer Linux installations this library is not installed.

In case you use RedHat 5.x the needed file is in a rpm in the distribution.

Redhat 5.0

aout-libs-1.4-8.i386.rpm

Redhat 5.1

aout-libs-1.4-9.i386.rpm

Otherwise look for libc-4.7.6.bin.tar.gz or libc-4.7.6.tar.gz (or newer) on a ftp site.


Unable to start cpn.ML with kernel 2.2.x (RedHat 6.0)

The cpn.ML program is a aout binary.

From kernel 2.2.x the aout binary format is not compiled into the kernel by default. Usually you will want to have aout binary format configured as a module. You will have to add the following line:

alias binfmt-0064 binfmt_aout

to

/etc/conf.modules

in order to make your system recognise that it has to use the aout module to run cpn.ML.


Save XML does not save Charts

The Save XML command in the File menu saves the diagram as an XML file, however Charts are not saved. This is a limitation of the Save XML function.

The workaround is to save the source code in the chart region (select node and invoke Save Text), then save the rest of the diagram as XML. When loaded you must recreate the chart and load the source code from the chart region and copy/paste it into the new chart region.


Occurrence Graph Tool Stopped Working Since January 10, 2004

The Occurrence Graph Tool has a critical problem as it depends on the time-of-day function (tod()). This function returns the number of seconds since January 1, 1970, but since SML/NJ represents integers with 2^30 bits the tod() function raises an overflow exception on January 10, 2004 (Sat Jan 10 13:36:42 GMT 2004) and henceforth.

The workaround is to apply a patch for the tod() function. Please use the following file: tod.sml. The installation instructions are embedded in the header of the mentioned patch file.


Last modified: Fri Jan 16 10:28:49 2004 -- Design/CPN Online admin