-
Notifications
You must be signed in to change notification settings - Fork 52
Description
Affiliation
OpenStar Technologies
Version(s) Affected
Alpha 7.157.2 for both client and server.
Platform(s)
Ubuntu 22.04 (Server) and Mac OS Tahoe 26.3 (Client)
Installation Method(s)
Server installation method: Installed with apt from MDSplus Debian repository.
Client installation method: brew install from https://github.com/dgarnier/homebrew-plasma
Describe the bug
When displaying signals with a cyclic relationship in jScope (when the signals can be queried normally through other interfaces), the connection to the MDSplus server is dropped, and the server crashes with a segfault.
To Reproduce
- Set up a signal node which has a cyclic relation to itself, but which alternates between the value and the dimension. The example Python script below shows one way of doing this:
from MDSplus import Tree, Signal, Float32Array
shot = 260218918
tree = Tree('junior', shot)
raw_times = Float32Array([0.0, 1000.0, 2000.0])
values = Float32Array([1.0, 2.0, 3.0])
times = Signal(tree.TEST1, None, raw_times)
tree.TEST1.record = Signal(values, None, times)
tree.close()
# Check that we can successfully query the data and the dimension of the node
tree = Tree('junior', shot)
print(tree.TEST1.record)
print(tree.TEST1.data())
print(tree.TEST1.dim_of().data())
print(tree.TEST1.dim_of().dim_of().data())
tree.close()-
Open jScope, running locally on the client machine, connected to the remote server
-
Plot the signal node in jScope (see screenshot A)
-
When clicking "Ok" or "Apply" in the wave setup dialog, jScope will freeze for a few seconds, then display a connection lost error (also shown in screenshot A)
Expected behavior
Expect jScope to show the signal, as it does when explicitly writing DATA(<signal node>) in the Y field, and DIM_OF(<signal node>) in the X field (see screenshot B).
At the very least, if jScope cannot handle the cyclic node, then it should display a clear error message, stating that the node contains a cyclic reference which the user should fix, and the MDSplus server should not crash.
Screenshots
Screenshot A: The signal setup to reproduce the issue, after clicking the "Apply" button

Screenshot B: Explicitly writing DATA(.TEST1) and DIM_OF(.TEST1) do not cause the issue

Screenshot C: On the server machine, the mdsip server responsible for the connection crashes with a segfault

Additional context
What is interesting about this particular example, is that typical usage of the signal will not reveal the cyclic relationship.
Querying the data will simply return the values stored in the node (or the expression applied to the raw data values), and querying the dimension will require evaluating the data of the original node, which in theory only requires evaluating the data values stored in the node, preventing an infinite cycle.
The issue only arises when an attempt is made to resolve the entire expression tree, which it seems is a feature unique to jScope, as I am unable to reproduce this issue when querying data through the Python interface, the C interface, or with tdic directly.