Previous Thread
Next Thread
Print Thread
ulink error message #34153 13 Apr 21 03:13 PM
Joined: Sep 2002
Posts: 5,471
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,471
Good day -

One of our ashlog files is inundated with these messages, causing the log to flip almost daily. Can you please tell me what this is and why it is logged? TIA

07-Apr-21 15:11:33 [p86507-53]<EDHL7S:0x142c9> unlink(/hosting/rcms/vm/dermcare/dsk1/050007/dermup.53) returns -1 (2)

Re: ulink error message [Re: Frank] #34154 13 Apr 21 03:43 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
A-Shell/Linux uses the native unlink command to erase files, under the theory that it handles a lot of extra conditions that would otherwise require superfluous investment in redundant wheel invention. If the unlink command returns an error, A-Shell logs it, under that theory that we really don't expect any errors from an erase operation. The most likely error, and the one in this case (2 or ENOENT) is file-not-found, but ERASE.LIT checks for that condition in advance, and presumably most applications would as well.

You can easily trigger this error message by executing a single-line program consisting of :
Code
KILL "NOSUCHFILE.XYZ"

The question is why are you getting so many of these? Since the filespec looks like some kind of sequentially-generated work file, I would first check to see if you are perhaps trying to KILL it twice? (Note that if you SET TRACE FOPENS ON, then you'll get the trace message for every such operation whether it returns an error or not, making it easy to check if you are in fact trying to erase it twice.) It could also be that something other than the application is deleting the file before you get a chance to.

Another possibility is that there is something strange about the path, perhaps it contains more than one symbolic link or a broken one? I would start with ls -l to see if the file exists, and perhaps to examine each level in the path to see if there is something strange with hard or soft links. I've see situations where a single physical directory might be reached under multiple paths due to links, and that can lead to all kinds of confusion.

Re: ulink error message [Re: Frank] #34156 13 Apr 21 04:03 PM
Joined: Sep 2002
Posts: 5,471
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,471
I think that answers the question, thanks Cap.

Re: ulink error message [Re: Frank] #34163 15 Apr 21 03:13 PM
Joined: Sep 2002
Posts: 5,471
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,471
We have programs that perform:

LOOKUP FILE$,BLOCKS
IF BLOCKS>0 KILL FILE$

That are creating unlink errors to be reported in the ashlog.

Can you think of any situations where this could be true? Or why this would occur?

In these cases the files would absolutely not reside in the [,0] ppn which could trigger a false positive.

Re: ulink error message [Re: Frank] #34164 15 Apr 21 04:43 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
The one possibility that comes to mind is that you do not have the ABSLOOKUP option set, in which case if the file size happened to be a multiple of 512, the size would be reported as negative (matching the legacy AMOS scheme of differentiating 'contiguous' from 'sequential' files). I would suggest instead using:
Code
IF LOOKUP(FILE$) KILL FILE$


But if that's not it, it seems like it should be easy enough to reproduce the problem with a very short test program by trying out the various possibilities. (After all, we know from the log messages what files KILL is trying to erase; and presumably you've narrowed it down to the relevant source code, so it seems like we should be able to work to the middle from both ends.) Also note that SET TRACE FOPENS ON will trace the LOOKUP operations, which should further shine light on any dark corners in your investigation.

Re: ulink error message [Re: Frank] #34165 15 Apr 21 04:51 PM
Joined: Sep 2002
Posts: 5,471
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,471
Will do.. try to create a re-usable recipe.

These are always sequential files. (note above if BLOCKS>0 expression)

PS: It did dawn on me that in a multi-user scenario there might be a SLIM chance someone is executing the same logic and that a LOOKUP might find a file that someone has already erased... though unlikely given the amt of time in between the LOOKUP and KILL statements.

Last edited by Frank; 15 Apr 21 04:54 PM.
Re: ulink error message [Re: Frank] #34166 16 Apr 21 01:10 AM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
(Sorry, I thought I posted this about 8 hours ago, but apparently forgot to hit the Post button).

That was my point about the BLOCKS>0 expression. Since there is no distinction between so-called contiguous and sequential files outside the AMOS world, A-Shell attempted to simulate it (with 511 out of 512 accuracy) by guessing that if the file size is a multiple of 512, it's likely to have been created as a "contiguous" file (i.e. with ALLOCATE or CREATE.LIT) and legacy programs might be expecting LOOKUP to return a negative value.

Obviously that's a flimsy model to rely on, which is why I suggest that if LOOKUP is being used exclusively to determine file existence, then the test should be IF LOOKUP(FILE) {# 0} rather than > 0. If it's being used to actually get the size of the file in blocks, then you should use the ABSLOOKUP option. Or, considering that 512 byte "blocks" are not exactly a meaningful unit of measure any more, perhaps XCALL SIZE?

Re: ulink error message [Re: Frank] #34169 16 Apr 21 01:23 PM
Joined: Sep 2002
Posts: 5,471
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,471
Happy Friday,

Learn something every day! Had no idea that LOOKUP used "pseudo science" to determine +/- file sizes.

I will work on replacing these statements per your suggestion.

Re: ulink error message [Re: Frank] #34170 16 Apr 21 01:25 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline
Member
Offline
Member
Joined: Sep 2003
Posts: 4,158
cool


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3