Hello,
There are multiple problems with shared variables facility.
1. Shared variable protocol is not safe in multi user environment.
When user starts apl with shared variables enabled, it removes all
other users' sessions from shared database as “stale” so currently
even honest user without malicious intent will disrupt all the other
users' work if they use shared variables (their programs will fail
assertions at Symbol.cc:156 or 695).
It happens because users can't kill one another's processes. But
please note that trying to work around this won't do any good as
there should be no reliable way of determining if other user's
process is alive. But I don't think we want variables to be shared
between users in the first place (despite of what comment at
Svar_DB.cc:678 says). I think that shm name should be suffixed
with UID or username and permissions should be set appropriately (0600).
If we really need it shared between users, it should not be possible to
destroy everything with simple dd if=/dev/urandom of=/dev/shm/apl-svars.
I don't know how it was technically done in APL2, but User's Guide
mentions some configuration file that described which shares were
allowed so presumably there was some control over it.
2. Annoying warnings about missing APs on general offer.
0 ⎕SVO 'X'
No binary found for AP 0 (interpreter path = /usr/bin)
1
And also:
⎕SVQ⍬
Could not open /usr/bin/APs : No such file or directory
3. Shared variables not working correctly:
• When number of elements on their ravel list exceeds 255,
vectors are truncated to their length modulo 256 while higher
rank arrays cause errors on reference.
0⎕SVO'X'
No binary found for AP 0 (interpreter path = /usr/bin)
1
X←⍳260
X
1 2 3 4
⍴X
4
X←16 16⍴0
⍴X
16 16
X
DOMAIN ERROR
X
^
→
5↑,X
==============================================================================
Assertion failed: 0
in Function: init
in file: Cell.cc:47
Call stack:
----------------------------------------
-- Stack trace at Cell.cc:47
----------------------------------------
0x7f83c299c995 __libc_start_main
0x434105 main
0x51caed Workspace::immediate_execution(bool)
0x4613cd Command::process_line()
0x46032b Command::process_line(UCS_string&)
0x469128 Executable::execute_body() const
0x4dc660 StateIndicator::run()
0x48941a Prefix::reduce_statements()
0x4853e4 Prefix::reduce_MISC_F_B_()
0x4dd33f StateIndicator::eval_B(Token&, Token&)
0x490546 Bif_F12_COMMA::eval_B(Value_P)
0x490388 Bif_COMMA::ravel(Shape const&, Value_P)
0x458a11 Cell::init(Cell const&)
0x44293f do_Assert(char const*, char const*, char const*, int)
========================================
SI stack:
Depth: 0
Exec: 0x1feb4c0
Pmode: ◊ 5↑,X
PC: 3 VALUE3«5»
Stat: 5↑,X
err_code: 0x0
thrown: at StateIndicator.cc:39
e_msg_1: 'No Error'
e_msg_2: ''
e_msg_3: ''
==============================================================================
----------------------------------------
-- Stack trace at StateIndicator.cc:674
----------------------------------------
0x7f83c299c995 __libc_start_main
0x434105 main
0x51caed Workspace::immediate_execution(bool)
0x4613cd Command::process_line()
0x46032b Command::process_line(UCS_string&)
0x469128 Executable::execute_body() const
0x4dc660 StateIndicator::run()
0x48941a Prefix::reduce_statements()
0x4853e4 Prefix::reduce_MISC_F_B_()
0x4dd4aa StateIndicator::eval_B(Token&, Token&)
========================================
• When array is not simple.
X←'abc' 'def'
⍴X
2
X
DOMAIN ERROR
X
^
X←⊂1
X
0
-k