* The procedure OS_set_working_dir_pathname in "os2env.c" had a
serious bug: passing it a string like "d:\\" caused it to signal a
Scheme error. What was serious was that this could occur while
spawning a subprocess, which for some as-yet unexplained reason
would crash Scheme with no error message. To compound matters, the
bug appeared to be unreproduceable under a debugger (not true). The
remaining changes were side effects of the blind debugging process:
* Added OS2_initialize_early to "boot.c" and "os2top.c". This allows
the microcode to do the initialization necessary to put up dialog
boxes. Which in turn is needed to report boot-time errors, such as
non-existent band file names.
* "option.c" calls outf but did not include "outf.h". Under ANSI C,
since outf takes a variable number of arguments, this results in
unspecified behavior. Under OS/2 with IBM's compiler, this causes a
mismatch in calling conventions, which can result in bizarre errors.
* Modified "os2.c" to have an alternate implementation of OS_malloc
and related procedures. This was generated while attempting to
track down a nasty bug that appeared to be a memory-allocation
error. The alternate implementation is #ifdef'ed out, but left in
place should it be useful in the future.
* Improved the definition of OS2_logic_error_1 so that it treats
errors in non-essential subthreads as non-fatal. Also improved the
wording of the error messages produced, and included more
information for future reference.
* All subthreads now have exception handlers and PM message queues, so
they can catch and report any exceptions that occur in them.
Previously, an exception occurring in a subthread would crash Scheme
with no explanation.
* Enhanced the acknowledgement messages sent to a channel readahead
thread to carry a flag indicating whether the thread is being asked
to read some more or to kill itself. This eliminates a race
condition associated with closing of the channel.
* Changed the input-pipe readahead thread to accept its arguments in a
freshly malloc'ed structure that the thread is responsible for
freeing. Previously, the arguments were accepted in a channel,
which contained a context structure which in turn contained the
arguments. The previous implementation had a race condition in that
the argument data structures were owned by the Scheme thread, and
could be deallocated before the readahead thread had a chance to
dereference them.
* In "os2proc.c", moved the allocation of the structure representing
the child process into the locked region of the process
initialization. This is necessary because the child-wait thread
accesses the same structures as the allocator.
* In "os2proc.c", the working directory was being saved and later
restored. But this was a static string, and there weren't good
guarantees as to it retaining its value -- so now it is copied
before being stored.
* When putting up a message box for a fatal error, the buffer used to
compose the message was static. This caused garbling when the two
threads attempted to produce fatal errors at the same time (this was
occurring regularly during the debugging process). Now the message
box uses a per-thread static buffer.
17 files changed: