Page 1 of 1
Unable to save workspace
Posted: Sun Jun 18, 2023 8:25 am
by nicholas.small
I'd been using ]Runtime and then got
)save
Cannot perform operation when # is referenced by session namespace.
Reached via:
⎕SE.SALTUtils...dmx...EN
What does this mean and how do I recover from it?
Re: Unable to save workspace
Posted: Sun Jun 18, 2023 9:14 am
by Morten|Dyalog
It means that there is a namespace reference somewhere in ⎕SE (most probably in ⎕SE.SALTUtils.dmx) that points to something in the root namespace #. The workspace cannot be saved when references exist between any subspace ⎕SE and any subspace of # (in either direction).
We'll look at whether the ]runtime command can be a bit more careful about this. Meanwhile, you may be able to work around it by expunging ('⎕SE.SALTUtils.dmx') to see whether that clears it up.
Re: Unable to save workspace
Posted: Sun Jun 18, 2023 9:20 am
by Phil Last
Somewhere in ⎕SE there has been created a namespace (or object or an array that contains such) that is a reference to # or a namespace within it.
If you have a non-empty )si stack then )clearing it might well remove the problem because the reference will almost certainly be localised in one of the ⎕SE functions.
Alternatively it may be that your function has created a global reference in ⎕SE to # or a namespace within it. In this case it will be necessary to examine your code to find and eliminate the offending reference perhaps by localisation and to remove the reference from ⎕SE.
Re: Unable to save workspace
Posted: Sun Jun 18, 2023 8:41 pm
by nicholas.small
Thanks, Morten - that resolved the issue.
A couple of other accompanying factors:
1. I had a 'Find' window open when I last ran ]Runtime and when I first tried )save.
2. There were what appeared to me to be spurious blank lines produced after the result of ]Runtime:
]runTime "((200⍴ns)SSASSIGNtest (20⍴'\abc\defg\hi\jkl\mno') (2×⍳5))" "(200⍴ns)SSASSIGNI (20⍴'\abc\defg\hi\jkl\mno') (2×⍳5)" -c
((200⍴ns)SSASSIGNtest (20⍴'\abc\defg\hi\jkl\mno') (2×⍳5)) → 9.3E¯6 | 0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
(200⍴ns)SSASSIGNI (20⍴'\abc\defg\hi\jkl\mno') (2×⍳5) → 1.1E¯5 | +13% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
]runTime "((200000⍴ns)SSASSIGNtest (20000⍴'\abc\defg\hi\jkl\mno') (2×⍳5000))" "(200000⍴ns)SSASSIGN (20000⍴'\abc\defg\hi\jkl\mno') (2×⍳5000)" -c
((200000⍴ns)SSASSIGNtest (20000⍴'\abc\defg\hi\jkl\mno') (2×⍳5000)) → 6.7E¯4 | 0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
(200000⍴ns)SSASSIGN (20000⍴'\abc\defg\hi\jkl\mno') (2×⍳5000) → 5.9E¯4 | -12% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
FNS←⎕NL 3 4
The first line is empty and the next three have seven blanks.
I've just twice repeated the commands above. The first time the output was as above, the second time there were no spurious blank lines.
Re: Unable to save workspace
Posted: Sun Jun 25, 2023 4:52 am
by Adam|Dyalog
I should add that this ⎕SE.SALTUtils.dmx is a clone of ⎕DMX, stored in SALTUtils as a record of any error that happened during user command execution. It could indeed contain problematic references. In version 19.0, we've ensured that that it doesn't have such issues.
Re: Unable to save workspace
Posted: Mon Jun 26, 2023 11:11 am
by Vince|Dyalog
Hi Nicholas,
If this happens to you again, please try a )reset and see if that helps.
Also, in general, you can create create an aplcore-like file with
+2 ⎕nq '.' 'dumpws' 'c:\tmp\mycor.cor'
where c:\tmp\ is an existing directory of your choice.
If you open another instance of Dyalog, you should be able to copy code and other objects from this mycor.cor file.
e.g.
)copy c:\tmp\mycor.cor
Regards,
Vince