www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/19/12:50:13

Message-Id: <199806191649.AA10176@gcef.gc.maricopa.edu>
Date: Fri, 19 Jun 1998 09:49:16 -0700 (MST)
From: "Joshua James Turpen" <44699 AT ef DOT gc DOT maricopa DOT edu>
To: djgpp AT delorie DOT com
Subject: Re: Allegro + LWP

> > > My Allegro based program crash when running under DOS+CWSDPMI. It works
> > > fine under Win95 and seem to be bug free (a bad pointer reference should
> > > produce some strange effect either unser Win95).
> >
> > No, Windows 95 doesn't catch null pointer dereferences, so it lets your
> > program run.  But CWSDPMI catches such atrocities and aborts your
> > program.
> >
> > > Symify report a page fault at line 572 lwp.c.
> > >
> > > Any ideas ?
> >
> > I have an idea: debug your program starting at line lwp.c.  You have a
> > bug.
> 
>  Send me your copy of lwp.c and I try to help you (I don't know which version
> of LWP are you runnig).
> BTW, from my expirience with LWP such things happens then you write behind
> allocated lwp-stack.
> For example, you run self-recurrent  function, or call too many sub-functions
> with large number of parameters.
> So, first suggestion - increase stack size then you do lwp_spawn(...) and see
> what changes.
> 

You can't really trust the call traceback when using LWP (only the
actual place that crashed) since a task switch could have made the rest of
the stack trace invalid.  

You need at least an 8k stack (the example programs are wrong) to use
printf() in a thread.  You get all kinds of strange behavior from stack
overflows, so eliminate that possibility first.   


Josh
 

- Raw text -


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