Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #500

Task Obey madness

From Martin Bazley <martin.bazley@blueyonder.co.uk>
Newsgroups comp.sys.acorn.programmer
Subject Task Obey madness
Message-ID <6353b0ed51.martin@blueyonder.co.uk> (permalink)
Organization virginmedia.com
Date 2011-07-04 21:44 +0100

Show all headers | View raw


This is a most peculiar set of symptoms which I've never experienced
before a couple of weeks ago, but which I've now experienced on both RO5
and RO6.

I have a command-line BASIC program which converts from one file format
to another.  In the process it opens two more, temporary, files in the
same directory as the output, which it deletes when the process is
complete.  I batch-convert a lot of files in one go by means of a Task
Obey script, which does not produce any VDU output.  This normally runs
as expected.  However, sometimes it doesn't...

Very occasionally, the Task Obey will stop partway down with a "This
file is already open" error.  The cause is random, and certainly not
caused by any open files.  The last time it happened, I was running two
different Task Obeys at once, outputting into different directories and
getting input from the same directory, but this shouldn't have made a
difference, as input-only files are allowed to be opened any number of
times, and all I was doing was one call to OS_File 16.  It's also
occurred when I was only running one instance.

What happens next seems equally random.  On one occasion, immediately
after giving the error, the Task Obey then skated drunkenly down all the
remaining star-commands in the file, executed about 30% of them
completely at random, and then forcibly terminated them all, leaving a
large assortment of temporary files still open.  I cannot possibly
imagine what could have caused this unique and demented behaviour.

Just now, the Task Obey simply terminated after giving the error, but
left its sister still running successfully.  Wondering if I could
reproduce it, I decided to run the crashed script again (with the other
one still going), but I mistakenly ran another instance of the uncrashed
script instead of restarting the crashed one.  Whoops, thought I, and
took to the Task Manager to rectify the situation.

When I selected 'Quit' for what I assumed was the new task (although it
may have been the old one), the computer locked up for about thirty
seconds, frantically thrashing the hard disc.  When the task finally
exited and I got control back, I discovered why.  Inside the output
directory were hundreds of temporary files, all completely blank, all
still open, for every single input file specified on every line in the
Task Obey file, up to a certain line - which I later learnt was due to
the fact that at that point it had run out of file handles.  Not that it
complained it had run out of file handles - it simply exited silently
without doing anything else, which was of course what it was supposed to
have done in the first bloody place.

Now, let's get one thing quite clear.  The Task Obey does not open any
files.  The Task Obey is nothing more than a list of start-commands, all
calling the BASIC file for different input values (via an alias to take
out the repetitive bits).  All OPENOUT commands are in the BASIC file,
and quite deep within the BASIC file at that.  In order to open each two
of those temporary files, the Task Obey must have executed each of its
remaining lines, processed the alias, and called the BASIC file with the
correct parameters for each one.  The BASIC file must then have
validated its parameters, loaded the input file into memory, interpreted
and generated quite a large number of complex data structures, done an
entire first pass over most of the input data to define variable limits,
and DIMensioned an ungodly number of arrays, before it even got close to
the output procedure in which the two temporary files were created.
(The final files, which didn't appear, are left until after the
temporary files are finished.)  And since it isn't that long after the
creation that the first bytes of output are written, the Task Obey must
have seeked through the whole (not inconsiderable) initialisation
process until it discovered two OPENOUT commands, after which it
immediately moved onto the next input command, without going through the
automatic closure in the error handler or indeed generating an error.

What caused this?  I do not have a clue.  It is the single most bizarre
thing I have observed RISC OS do, and in my time as a programmer, I've
seen it do many.

Does anyone have any idea what was going on at all?  Especially WRT the
earlier incident, in which only some non-consecutive lines in the script
were executed?  Furthermore, does anyone have any idea what may cause a
program to throw a "This file is already open" error for no reason at
all?

-- 
  __<^>__   "Start off every day with a smile and get it over with."
 / _   _ \  - W.C. Fields
( ( |_| ) )
 \_>   <_/  ======================= Martin Bazley ==========================

Back to comp.sys.acorn.programmer | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Task Obey madness Martin Bazley <martin.bazley@blueyonder.co.uk> - 2011-07-04 21:44 +0100
  Re: Task Obey madness Vince M Hudd <vinceh@softrock.co.uk> - 2011-07-04 22:35 +0100
    Re: Task Obey madness "John Williams (News)" <UCEbin@tiscali.co.uk> - 2011-07-05 08:07 +0200
      Re: Task Obey madness Rob Davison <nospamthanks@invalid.invalid> - 2011-07-05 19:59 +1200
        Re: Task Obey madness Paul Sprangers <Paul@sprie.nl> - 2011-07-05 10:28 +0200
          Re: Task Obey madness "John Williams (News)" <UCEbin@tiscali.co.uk> - 2011-07-05 12:08 +0200
          Re: Task Obey madness Vince M Hudd <vinceh@softrock.co.uk> - 2011-07-05 11:36 +0100
            Re: Task Obey madness Paul Sprangers <Paul@sprie.nl> - 2011-07-05 12:43 +0200
              Re: Task Obey madness "John Williams (News)" <UCEbin@tiscali.co.uk> - 2011-07-05 12:51 +0200
                Re: Task Obey madness Ian Hamilton <Ian.Hamilton@AAUG.net> - 2011-07-05 12:03 +0100
                Re: Task Obey madness "John Williams (News)" <UCEbin@tiscali.co.uk> - 2011-07-05 13:32 +0200
                Re: Task Obey madness Vince M Hudd <vinceh@softrock.co.uk> - 2011-07-05 12:57 +0100
                Re: Task Obey madness "John Williams (News)" <UCEbin@tiscali.co.uk> - 2011-07-05 14:17 +0200
                Re: Task Obey madness Paul Sprangers <Paul@sprie.nl> - 2011-07-05 14:39 +0200
              Re: Task Obey madness Vince M Hudd <vinceh@softrock.co.uk> - 2011-07-05 12:22 +0100
          Re: Task Obey madness Rob Davison <nospamthanks@invalid.invalid> - 2011-07-06 08:27 +1200
          Re: Task Obey madness Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-07-06 08:15 +0200
            Re: Task Obey madness jgharston <jgh@arcade.demon.co.uk> - 2011-07-06 18:48 -0700
              Re: Task Obey madness "Ste (news)" <steve@revi11.plus.com> - 2011-07-07 13:55 +0100
              Re: Task Obey madness Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-07-12 20:07 +0200
      Re: Task Obey madness cferris@freeRemoveuk.com.invalid - 2011-07-05 09:09 +0100
        Re: Task Obey madness Steve Drain <steve@kappa.me.uk> - 2011-07-05 10:19 +0100
    Re: Task Obey madness Martin Bazley <martin.bazley@blueyonder.co.uk> - 2011-07-05 12:40 +0100
      Re: Task Obey madness Martin <News03@avisoft.f9.co.uk> - 2011-07-05 16:19 +0100
        Re: Task Obey madness Alan Adams <alan@adamshome.org.uk> - 2011-07-05 17:31 +0100
          Re: Task Obey madness Ian J Hartley <Ian.Hartley@sky.com> - 2011-07-06 12:35 +0100
            Re: Task Obey madness "Ste (news)" <steve@revi11.plus.com> - 2011-07-07 13:57 +0100
              Re: Task Obey madness Alan Adams <alan@adamshome.org.uk> - 2011-07-07 21:18 +0100
              Re: Task Obey madness Ian J Hartley <Ian.Hartley@sky.com> - 2011-07-13 12:36 +0100
                Re: Task Obey madness "Ste (news)" <steve@revi11.plus.com> - 2011-07-14 15:58 +0100
                Re: Task Obey madness Ian Hamilton <Ian.Hamilton@AAUG.net> - 2011-07-14 16:10 +0100
                Re: Task Obey madness Ian J Hartley <Ian.Hartley@sky.com> - 2011-07-17 12:30 +0100
                Re: Task Obey madness "Ste (news)" <steve@revi11.plus.com> - 2011-07-17 14:23 +0100
                Re: Task Obey madness Ian J Hartley <Ian.Hartley@sky.com> - 2011-07-17 16:14 +0100
                Re: Task Obey madness druck <news@druck.org.uk> - 2011-07-14 19:23 +0100
                Re: Task Obey madness Ian J Hartley <Ian.Hartley@sky.com> - 2011-07-17 14:17 +0100
  Re: Task Obey madness Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> - 2011-07-05 22:15 +0100
    Re: Task Obey madness Rainer Schubert <dl6hbo@dl6hbo.inka.de> - 2011-07-08 17:14 +0200

csiph-web