AminetAminet
Search:
84782 packages online
About
Recent
Browse
Search
Upload
Setup
Services

util/boot/ConsoleFix.lha

Mirror:Random
Showing: i386-aros icongeneric icon
No screenshot available
Short:Fix a bug in the console.device
Author: thor at math.tu-berlin.de (Thomas Richter)
Uploader:thor math tu-berlin de (Thomas Richter)
Type:util/boot
Version:1.01.1
Architecture:m68k-amigaos
Date:1999-10-22
Requires:Os 3.0 (V39) or better
Download:util/boot/ConsoleFix.lha - View contents
Readme:util/boot/ConsoleFix.readme
Downloads:667

_____________________________________________________________________________

Changes made in release 1.01.1:

- Included the updated assembly source of the 1.01 release. Ooops.

_____________________________________________________________________________

Changes made in release 1.01:

-ConsoleFix 1.00 failed from time to time if the console.device main task was, 
due to some unfortune, not waiting in its main loop. Added a workaround
that checks several times.

-Added a version tag.
_____________________________________________________________________________


Purpose of this program:

This little patch fixes possible crashes of the console.device task, which,
luckely, do not show up under "normal" circumstances. However, as soon as
the console.device supervisor task takes more stack than usual, or this
stack is filled by more than just zeros, the console device will crash on
window resizes.

The reason for this crash is that the console.device main task uses a
faulty algorithm to traverse an exec style list: The list header is
also processed as a "node". Due to some lucky coincidences, the only data
that gets querried by this faulty node is on the stack of the console device,
and again due to some coincidence, this points to an area of the stack which
is usually set to zero. All provided the stack of the console.device doesn't 
grow too much.

For the experts: 

	The main loop of the console device looks like this:

	lea WindowList(a6),a2		;get the head of the window list
.loop:
	bsr ProcessWindow		;re-calcutes the window on a resize

	move.l (a2),a2			;get next node
	tst.l (a2)			;end of list?
	bne.s .loop

Hence, the list header is processed as a first node. Urgh!


The correct method would have been:


	lea WindowList(a6),a2		;get the head of the window list
	bra.s .into
.loop:
	bsr ProcessWindow		;re-calcutes the window on a resize
.into:
	move.l (a2),a2			;get next node
	tst.l (a2)			;end of list?
	bne.s .loop


This program fixes this bug by "hacking in" a new main loop for the console
device, the source code is included.

I'm sorry for the uglyness of this patch, it was designed at 2 a.m. in the
night and I was all than awake. It currently works like it is, but I'd really
prefer if someone could write a "nicer" fix, or if AI would include this fix
in the "SetPatch" program.

_____________________________________________________________________________

Credits:

Thanks goes to Nils Goers and his StackSnoop program. This console.device
problem showed up while Nils was beta-testing his program, and I was
curious what could have caused the crash. Stack-Snoop fills the application
stack with a "magic cookie" to find out the true stack size a program re-
quires, and this magic cookie caused the buggy code above to get mad.
Always interested in the true reason for a crash, I found the above bug...

_____________________________________________________________________________

Copyright:

	None, this is freeware, public domain. Do whatever you want to do
	with it.

_____________________________________________________________________________


Thomas,
	October 1999


Contents of util/boot/ConsoleFix.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO     CRC       STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic]                  555     700  79.3% -lh5- 76b4 Sep 25  1999 ConsoleFix/ConsoleFix
[generic]                 1823    6908  26.4% -lh5- e95f Oct 16  1999 ConsoleFix/ConsoleFix.asm
[generic]                 1355    3341  40.6% -lh5- cb4a Oct 16  1999 ConsoleFix/ConsoleFix.readme
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total         3 files    3733   10949  34.1%            Oct 21  1999
Page generated in 0.03 seconds
Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>