Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mdstcl segfaults for a tree that doesn't carry a shot number #2751

Open
sflanagan opened this issue Apr 26, 2024 · 2 comments
Open

Mdstcl segfaults for a tree that doesn't carry a shot number #2751

sflanagan opened this issue Apr 26, 2024 · 2 comments
Assignees
Labels
branch/alpha This is present on or relates to the alpha branch bug An unexpected problem or unintended behavior core Relates to the core libraries and scripts tool/tcl Relates to the Tree Control Language or mdstcl prompt US Priority

Comments

@sflanagan
Copy link

Affiliation
GA / DIII-D

Version(s) Affected
Observed in: alpha 7.139.59 +

Platform
RHEL

Describe the bug
A mdstcl show current segfaults when there is no shotid for the specified tree, e.g.

[flanagan]$ mdstcl show version
MDSplus version: 7.139.59
----------------------
  Release:  HEAD_release_7.139.59
  Browse:   https://github.com/MDSplus/mdsplus/tree/HEAD_release_7.139.59
  Download: https://github.com/MDSplus/mdsplus/archive/HEAD_release_7.139.59.tar.gz

[flanagan]$ mdstcl show current bogus_tree
Segmentation fault (core dumped)

Expected behavior
I found an older server that produces a "Failed to get shotid." message (which I presume is still the intended response?).

[flanagan]$ mdstcl show version
MDSplus version: 7.96.9
----------------------
  Release:  stable_release-7-96-9
  Browse:   https://github.com/MDSplus/mdsplus/tree/stable_release-7-96-9
  Download: https://github.com/MDSplus/mdsplus/archive/stable_release-7-96-9.tar.gz
  Build date: Tue Feb 11 17:40:00 UTC 2020

[flanagan]$ mdstcl show current bogus_tree
Failed to get shotid.

Note
I only discovered this via "fat-fingering" the name of a tree that does carry a shot number. I don't expect d3d users to encounter this bug, so it's good to get fixed but of low priority.

@sflanagan sflanagan added the bug An unexpected problem or unintended behavior label Apr 26, 2024
@mwinkel-dev mwinkel-dev self-assigned this Apr 26, 2024
@mwinkel-dev
Copy link
Contributor

Hi @sflanagan -- I'll investigate this issue later today.

@mwinkel-dev mwinkel-dev added US Priority branch/alpha This is present on or relates to the alpha branch core Relates to the core libraries and scripts labels Apr 27, 2024
@mwinkel-dev
Copy link
Contributor

mwinkel-dev commented Apr 27, 2024

Hi @sflanagan,

Experiments revealed two results . . .

  • The segfault only occurs when the tree path is undefined.
  • However, when the tree path is defined and points to a directory that doesn't have the shotid.sys file, then it does produce the Failed to get shotid message.

The issue is probably in the TreeGetCurrentShotId() function. I will fix it in the coming days.

The behavior might also depend on the access method: local, thin-client, thick-client, or distributed.

@mwinkel-dev mwinkel-dev added the tool/tcl Relates to the Tree Control Language or mdstcl prompt label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch/alpha This is present on or relates to the alpha branch bug An unexpected problem or unintended behavior core Relates to the core libraries and scripts tool/tcl Relates to the Tree Control Language or mdstcl prompt US Priority
Projects
None yet
Development

No branches or pull requests

2 participants