delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/05/09/12:16:03

To: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (DJGPP Mailing List)
Subject: Re: OEmacs 4.1
Date: Mon, 09 May 1994 08:17:39 -0700
From: Darryl Okahata <darrylo AT sr DOT hp DOT com>

Pieter Kunst (kunst AT prl DOT philips DOT nl) writes:

> How do you mean 'DPMI support is too buggy' ?

Charles Sandmann (sandmann AT clio DOT rice DOT edu) writes:

> If you send me specific examples, I'll try to fix any bugs.  We can't fix
> the ones we don't know about.

[ Here's a re-munged version of a message that I send back in March. ]

     Well, I must admit that I have not yet tried 1.11m5, but the
following program crashes under 1.11m4 if you press Ctrl-Break *very*
rapidly.  I'll have to try this under 1.11m5 sometime soon.  Thanks to
Morten Welinder (terra AT diku DOT dk) for first bringing it up.  The bug is
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