delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/03/16/03:59:19

To: babcock AT cfa DOT harvard DOT edu
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Distributing a recompiled GO32
Date: Tue, 15 Mar 1994 23:56:40 -0800
From: Darryl Okahata <darrylo AT sr DOT hp DOT com>

> Posting a summary of the known problems might inspire someone to fix them.
> For example, it was only from a private message that I found out that go32
> left the control-break and divide by zero vectors hanging on exit.  After I

     Well, I finally upgraded to 1.11m4, and some of the problems have
gone away.  However, the "big" problem still exists: the following
program crashes if you press Ctrl-Break *very* rapidly (it's easier to
reproduce if your keyboard's auto-repeat is cranked way up):

-------------------------------------------------------------------------------
/* Modified samples/ctrlbrk.c */
#include <stdio.h>
#include <pc.h>
#include <go32.h>
#include <dos.h>

int main()
{
  char c;

  printf("waiting and polling - press Ctrl-Break to step a counter,\n");
  printf("any other key to go on, 's' to stop.\n");
  do
    {
      _go32_want_ctrl_break(1);
      while (!kbhit())
	{
	  union REGS regs;
	  regs.h.ah = 1; /* Harmless check for stroke.  */
	  int86 (0x16, &regs, &regs);
	  _go32_was_ctrl_break_hit();	/* works without this line */
	}
      printf("Ctrl-break was pressed %d time(s).\n", 
	     _go32_was_ctrl_break_hit());
      c= getkey();
    } 
  while (c != 's');
  return 0;
}
-------------------------------------------------------------------------------

Note the call to _go32_was_ctrl_break_hit() within the while() loop;
this call is the key.  Without the call, everything appears to work;
with the call, the program crashes, often with an unexpected interrupt
0x0d (I think it's 0x0d, but I'm not 100% positive).  It appears that
there is some window of vulnerability in the call to
_go32_was_ctrl_break_hit(); if a Ctrl-break press occurs during this
window, the system goes bye-bye ....

     With OEmacs, _go32_was_ctrl_break_hit() is called *VERY* often
(just as in the above example), and pressing Ctrl-break can often kill
OEmacs ....  If this problem could be solved, I should be able to do
away with requiring a special version of go32 for OEmacs.

     -- Darryl Okahata
	Internet: darrylo AT sr DOT hp DOT com

DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion or policy of Hewlett-Packard or of the
little green men that have been following him all day.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019