www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/21/08:38:35

Date: Tue, 21 Feb 1995 07:45:40 +0500
From: ld AT netrix DOT com
To: djgpp AT sun DOT soe DOT clarkson DOT edu, OKRA AT max DOT tiac DOT net
Subject: Re: interrupt handlers

> From djgpp-bounces AT sun DOT soe DOT clarkson DOT edu Thu Feb 16 19:57 EST 1995
> Date: Thu, 16 Feb 1995 19:24:44 -0500 (EST)
> From: Kimberley Burchett <OKRA AT max DOT tiac DOT net>
> Subject: interrupt handlers
> To: DJGPP Mailing List <djgpp AT sun DOT soe DOT clarkson DOT edu>
> Mime-Version: 1.0
> 
> 
>   I have a kind of interrupt handler.  It's for the mouse so what happens 
> is the mouse driver is called (in real mode) and then it calls my handler 
> (via a real mode callback).  All of this works just fine until I call 
> another function from inside my handler.
>   This is my function.

[Code deleted]
 
  Look at the stack selector, you'll see that it's pointed to some stack other
than your program's, so if you do a lot of fuction calls, it'll crash. One
possible way to solve this problem is to do a stack swap. Another way is to
limit stack usage :-(.

>   When it prints out the stack retrace, the first retrace points to
> AddEvent or MouseHandler, then it SIGSEGVs and ends up pointing to a
> different function I have.  I have a feeling this is the result of it
> being in an interrupt, though. 
>   There is no paging going on - this is just a test prog and it only uses
> 76k according to topline.
>   This is pretty urgent - I really need it to continue with my project.
> 
>   btw: is it okay to call malloc from an interrupt?  AddEvent() calls 
> malloc.  (but that's not the problem since I can comment it out and still 
> crash...)

   It'd seem that malloc is not the problem then... :-)

Hope that helps,
Long.

==============================================================
Long Doan                                        ld AT netrix DOT com     
Netrix Corporation                         ldoan1 AT osf1 DOT gmu DOT edu
13595 Dulles Technology Drive                               
Herndon Va 22071
==============================================================

- Raw text -


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