mdsplus
mdsplus copied to clipboard
mdsplus8: the v7 versions of MDSplus should check to see if accessing a v8 tree
Affiliation MIT PSFC
Version(s) Affected All versions other than the mdsplus8 branch.
Platform Found in Ubuntu 20.04, but applies to all platforms.
Describe the bug The mdsplus8 branch supports long node names (up to 63 characters) so has a different file format. If a v7 version of MDSplus attempts to open a v8 tree, the v7 MDSplus segfaults.
To Reproduce Steps to reproduce the behavior:
- Using the mdsplus8 version of mdstcl create a model tree named, "mytree". And add a numeric node, "NUM".
- Switch to a v7 version of MDSplus (e.g., the "alpha" branch).
- Run a Python program to open "mytree" and get the "NUM" node. (See example program below.)
- Program immediately segfaults.
Expected behavior Instead of a segfault, the v7 versions of MDSplus should display an error message stating that v7 cannot read/write v8 trees.
Screenshots n/a
Additional context This example Python program triggers the segfault.
import MDSplus as mds
# Prior to running this program, use the mdsplus8 version of mdstcl to
# create "mytree". Then switch to a v7 version of MDSplus ("alpha" or "stable")
# and run this program.
shot = -1
tree = mds.Tree("mytree", shot, "edit")
# This statement triggers the segfault
node = tree.getNode("NUM");
# node.putData(20.5);
tree.write()
tree.close()
Many customers will not be able to switch all of their mdsip servers and client workstations to mdsplus8 at once. Some sites thus will have a mixture of both versions of MDSplus (v7 and v8) and also both tree formats (12-char and 63-char). Thus, it is important to add features to v7 to ensure it informs the user that v7 cannot use 63-char format trees.
Note that this means testing all v7 features / components (mdsip client/server communication, mdstcl, jTraverser, actions, events, devices, etc.) with 63-char trees. No segfaults should occur. Instead there should be meaningful error messages / warnings as soon as it is detected that v7 is dealing with a 63-char tree.