bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Problems with shared variables


From: Juergen Sauermann
Subject: Re: [Bug-apl] Problems with shared variables
Date: Sun, 16 Feb 2014 18:09:06 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5

Hi,

I believe the problems below are fixed in SVN 128.

Ad 1) I changed the assertions Symbol.cc to short warnings visible in )MORE.

The kill() should work now as well, looking at errno rather than
just the return value of kill().

Ad 2) hopefully fixed.

Ad 3) hopefully fixed.

I could further improve the shared variables for workspace-to-workspace
communication, but this is some effort and before doing it I would like to
know if someone is seriously interested in it. The idea would be a single process
managing all shared variables and TCP rather than UDP for communication with
that process.

/// Jürgen



On 02/12/2014 12:49 PM, Kacper Gutowski wrote:
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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]