www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/10/14:08:26

Date: Sun, 10 Jan 1999 19:08:12 +0000 (GMT)
From: George Foot <george DOT foot AT merton DOT oxford DOT ac DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: Possible bug in Allegro 3.1
In-Reply-To: <77ag71$s0j$1@news5.svr.pol.co.uk>
Message-ID: <Pine.OSF.4.05.9901101848200.15278-100000@sable.ox.ac.uk>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Sat, 9 Jan 1999, Chris Jones wrote:

> Having just upgraded from Allegro 3.0 to 3.1, I re-compiled a program which
> uses it. The program was still a bit buggy - it used to occasionally cause
> SIGSEGVs and the like. Since upgrading to 3.1, it now just crashes with
> 'Shutting down Allegro' repeatedly printing on the screen.
> I investigated this, and found that my program was calling allegro_init()
> twice by accident. This was not a problem with Allegro 3.0, but it seems
> that 3.1's allegro_init() saves the old signal handlers to call when a fault
> occurs (which, of course, on the second call to allegro_init() are its own
> handlers). Therefore on a SIGSEGV it calls its own handler recursively, and
> never exits.

Oops.  It's me that asked Shawn to make it save the old
handlers.  Sorry! :)

I think your fix would work fine, but I'd prefer a slightly
different one.  IMHO the signal handlers ought to be reset to
their original values in `allegro_exit'.  If this is done then
your fix wouldn't work though.  My suggestion of a better fix
would be to make Allegro complain bitterly if you try to
initialise it more than once without calling `allegro_exit' in
between.  I'm fairly sure that calling `allegro_init' twice like
this is pretty useless and perhaps dangerous.

I think Shawn said he was on holiday at the moment, so we'll
have to wait until he comes back for his answer.


> For example, compiling this program under 3.1 will hang the system:

I think you mean `running this program'. ;)  Just being
pedantic.


-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

ko cilre fi la lojban  --  http://xiron.pc.helsinki.fi/lojban/

- Raw text -


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