Previous Thread
Next Thread
Print Thread
Docker/Ashell/Compil #32039 28 Nov 19 03:38 PM
Joined: Oct 2015
Posts: 230
S
Stuart Offline OP
Member
OP Offline
Member
S
Joined: Oct 2015
Posts: 230
We appear to be experiencing a similar problem to before (which was resloved with use of the -silo start up switch).

When running an Ashell program and making a call to run the Ashell compil program from a '.do' file, it appears to be zapping the job table.
Code
xcall AMOS, "dofile "+SOURCE'FILE, "Q"


As this is a call from within Ashell to another Ashell utility it is not clear why anything like the -silo switch would need to be used, but regardless, it is also not clear how we might be able to add it to the command arguments in the 'do' file
Code
:T
log dskn:[x,y]
compil $0 /i /rc /w:4000 /x:2 /p /px /n /lsm /so "%d%f"


As confirmation of the potential issue, if we use HOSTEX and call a Linux shell script which runs the Linux compiler we don't have the job table issue. I haven't tried but I suspect that if we used the same sort of process, but called the Ashell/Compiler from the script (using the -silo switch), then again, it would run without the issue.

As the latter option is a workable solution, this is probably not too big an issue, but it would be useful if there was a more 'direct' workaround using the AMOS call.

Re: Docker/Ashell/Compil [Re: Stuart] #32042 28 Nov 19 11:53 PM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
I'm thinking that the more direct method would be to call the compiler directly via MX_COMPIL.

That routine is actually what COMPIL.LIT uses. But reviewing the doc now, it appears that there are a few switches that haven't been documented. Here's the complete list ...

Code
    define COMPIL_A    = &h00000001    ! /A large program switch
    define COMPIL_M    = &h00000002    ! /M unmapped variable check switch
    define COMPIL_O    = &h00000004    ! /O optimization switch
    define COMPIL_13   = &h00000008    ! /13 AlphaBASIC 1.3 `switch'
    define COMPIL_S    = &h00000010    ! /S silent ++includes
    define COMPIL_N    = &h00000020    ! /N no compilation statistics
    define COMPIL_X1   = &h00000040    ! /X:1 AlphaBASIC+ syntax supported
    define COMPIL_D    = &h00000080    ! /D dBasic support
    define COMPIL_X2   = &h00000100    ! /X:2 A-Shell extensions
    define COMPIL_V1   = &h00000200    ! /V:1 Basic 1.4a compat [108]
    define COMPIL_T    = &h00000400    ! /T Trace [109]
    define COMPIL_I    = &h00000800    ! /I Old isam [110]
    define COMPIL_AV   = &h00001000    ! /AV 24 bit variable indexing [112]
    define COMPIL_B    = &h00002000    ! /B background mode [113]
    define COMPIL_MX   = &h00004000    ! /MX unmapped variable check [114]
    define COMPIL_X3   = &h00008000    ! /X:3 SBX compil [115]
    define COMPIL_DBG  = &h00010000    ! /DEBUG [116]
    define COMPIL_RC   = &h00020000    ! /RC [117]
    define COMPIL_G    = &h00040000    ! /G [118]
    define COMPIL_LSM  = &h00040000    ! /LSM [128] (same as /G)
    define COMPIL_LF   = &h00080000    ! /LF [119]
    define COMPIL_CI   = &h00100000    ! /CI [120]
    define COMPIL_C    = &h00200000    ! /C:sym=value [121]
    define COMPIL_IEEE = &h00400000    ! /IEEE [122]
    define COMPIL_VC   = &h00800000    ! /VC:pattern [123]
    define COMPIL_LI   = &h01000000    ! /LI  [123]
    define COMPIL_P    = &h02000000    ! /P [126]
    define COMPIL_CTAGS= &h08000000    ! /CTAGS [130] 
    define COMPIL_XTAGS= &h10000000    ! /XTAGS [131]     
    define COMPIL_PX   = &h20000000    ! /PX [132]
    define COMPIL_IGOO = &h40000000    ! /IGOO [133]
    define COMPIL_L    = &h80000000    ! (-l applies only to compil.exe)
    define COMPIL_NOTRC= &h100000000   ! /NOTRC [135]
    define COMPIL_F1   = &h200000000   ! /F1 [136]


Re: Docker/Ashell/Compil [Re: Stuart] #32044 29 Nov 19 12:21 PM
Joined: Oct 2015
Posts: 230
S
Stuart Offline OP
Member
OP Offline
Member
S
Joined: Oct 2015
Posts: 230
It may be the more direct method, however, it may not be so straighforward (at least for me). When trying the MIAMEX call I get a 'segmentation fault'.

The ashlog doesn't appeat to help that much. The last location is the line after the MIAMEX call. (uprep is the calling program)
Code
29-Nov-19 11:34:04 [p67250-0]<:0> ----------------
29-Nov-19 11:34:04 [p67250-0]<:0> A-Shell 6.4.1552.0 launched on pts/0:1060003 by root
29-Nov-19 11:34:04 [p67250-0]<:0> jcbrebuild #0
29-Nov-19 11:34:04 [p67250-3]<:0> In: Nodes=2/3/30 [P], ip=0.0.0.0 0:0:0:0:0:0, (root) inodes:  si=0,sm=0, j=140027,q=140026, rc=0
29-Nov-19 11:45:22 [p67250-3]<UPREP:1029> SIGSEGV trapped on: TSKAAC (root)
29-Nov-19 11:45:22 [p67250-3]<UPREP:1029> Last instr: 0x1f, line #: 0, location counter: 1048, last sbr: MIAMEX, last file #2
29-Nov-19 11:45:22 [p67250-3]<UPREP:1029> cp /vm/miame/sys/ashlog.log /vm/miame/sys/corelog.0
29-Nov-19 11:45:57 [p433-0]<:0> ----------------
29-Nov-19 11:45:57 [p433-0]<:0> A-Shell 6.4.1552.0 launched on pts/0:62797 by root
29-Nov-19 11:45:57 [p433-0]<:0> jcbrebuild #0
29-Nov-19 11:45:57 [p433-4]<:0> In: Nodes=2/4/30 [L], ip=0.0.0.0 0:0:0:0:0:0, (root) inodes:  si=0,sm=1, j=140027,q=140026, rc=0
29-Nov-19 11:47:42 [p70496-0]<:0> ----------------


Prior to running UPREP (located in DSK10:[77,7]), I have logged to the source directory:
Code
LOG DSK10:[77,4]


UPREP is then run:
Code
run [77,7]uprep prog.new


The following switches were used with the following xcall within UPREP:
Code
MAP1 SOURCE'NAME,S,100
MAP1 COMPIL'SWITCHES,F,6
...
SOURCE'NAME = "PROG.NEW"
COMPIL'SWITCHES = COMPIL_I
COMPIL'SWITCHES += COMPIL_RC
COMPIL'SWITCHES += COMPIL_X2
COMPIL'SWITCHES += COMPIL_B
COMPIL'SWITCHES += COMPIL_P
COMPIL'SWITCHES += COMPIL_PX
COMPIL'SWITCHES += COMPIL_N
COMPIL'SWITCHES += COMPIL_LSM
COMPIL'SWITCHES += COMPIL_S
COMPIL'SWITCHES += COMPIL_O
XCALL MIAMEX, MX_COMPIL, SOURCE'NAME, COMPIL'SWITCHES, "", "%d%f", STATUS


I have presumed that I can use the same switches as used with the 'external' command, but it may be that they are not all appropriate.

Re: Docker/Ashell/Compil [Re: Stuart] #32045 29 Nov 19 04:20 PM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
Yes, that should be the case. (This is, after all, exactly how COMPIL.LIT operates.) The only detail that doesn't seem quite right is the "%d%f" argument, which should be the xxx in what would otherwise be the /VC:xxx switch, but you're not setting that switch. Still, that would be ignored, so I don't think it's an issue.

I tried reproducing the problem here with a couple of my programs and also with your notorious ashdevxtr.lsx test program (change the switches in that case), but it all seems ok at least under Windows and el5, but I can't quite get to my Docker setup just now, so maybe that's the only place it occurs (in which case I'll get to it a bit later today.)

Other thoughts:

1. This is one place where the memory partition size is critical, but in testing here, I get the "out of memory" compilation error just like I would expect.

2. Since this is how COMPIL.LIT works, you should get the same results, given the same parameters passed. Assuming that the COMPIL command works from the dot prompt, then you can set the XCALL and XDEBUG traces and see the exact parameter list as passed (in the ashlog.log file). Maybe that will reveal some difference we're overlooking.

Re: Docker/Ashell/Compil [Re: Stuart] #32046 29 Nov 19 04:44 PM
Joined: Oct 2015
Posts: 230
S
Stuart Offline OP
Member
OP Offline
Member
S
Joined: Oct 2015
Posts: 230
Well I don't know if that helped or not.

I ran the same compil plus arguments from the dot prompt and got the same result. However, using a slightly different set of switches, it ran through OK.

so this worked:
Code
compil prog.new /i /rc /w:4000 /a /px /x:2 /n /lf /b /l


this didn't:
Code
compil prog.new /i /rc /w:4000 /p /px /x:2 /n /lsm /so


Don't spend too much time on this Jack, as I am actually happy enough with the first set of switches. The first set is what I use most of the time, but the second set was already in the .do file, so I just re-created them in the MX_COMPIL call without really thinking about them.

Last edited by Stuart; 29 Nov 19 05:06 PM.
Re: Docker/Ashell/Compil [Re: Stuart] #32047 29 Nov 19 05:48 PM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
A couple of further notes:

- The /W: switch doesn't do anything in COMPIL.LIT (which instead uses the current job's partition for the memory work area, so you'd need to use MEMORY.LIT or the MEMORY directive in the miame.ini to set it to a sufficient size). I should probably modernize the switch handling so that it complains about any unrecognized switch.

- /L is the same as /LF

- /LSM is the oddball one here (and maybe the culprit). I can't say that I've ever used it with this version of the compiler (since the lsm file is primarily only of interest to APN, which would use the Windows standalone compiler).

Re: Docker/Ashell/Compil [Re: Stuart] #32051 03 Dec 19 05:29 PM
Joined: Oct 2015
Posts: 230
S
Stuart Offline OP
Member
OP Offline
Member
S
Joined: Oct 2015
Posts: 230
I can confirm that the /lsm switch was the cause of the problem. I don't know why this was being used and doesn't appear to be needed. I certainly haven't used it.

You commented that /l and /lf are the same. Is this just with the internal compil call, as there is a difference listed in the docs?


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3