@DATABASE
@WIDTH 76
@AUTHOR Georg Steger
@TOC "Main"

@NODE "Main" "StackAttack"
@TOC "Main"

                           @{FG SHINE}-> StackAttack V1.3 <-@{FG TEXT}

		   (C) Copyright 1997-2001 by Georg Steger.
			    All rights reserved!

			      @{" Introduction  " LINK "Introduction"}
			      @{" Requirements  " LINK "Requirements"}
			      @{" Legal Stuff   " LINK "LegalStuff"}
			      @{" Installation  " LINK "Installation"}
			      @{" Configuration " LINK "Configuration"}
			      @{" History       " LINK "History"}

			      @{" Author        " LINK "Author"}
			      @{" Credits       " LINK "Credits"}

@ENDNODE

@NODE "Introduction" "Introduction"
@TOC "Main"

StackAttack is a little program that can kill/avoid strange or casual
GURUs. If one is running many programs that patch system routines
(many commodities and "hacks" do that) it might happen that more GURUs
than usual occure. The strange thing is that one time a certain operation
can bring up a GURU while another time nothing happens.

Very often the reason for such unmotivated GURUs is, that some or many
programs do not have enough Stack when one is running lots of system-
patches, hacks or commodities.

Each program that patches library functions increases the amount of stack
needed by these functions when they are called. If another program patches
one of these functions again the amount of needed Stack is increased again.

@{FG SHINE}Example:@{FG TEXT} Commodity "A" patches OpenWindow(). The new function has some
         variables on Stack, and therefore increases the Stack-Usage by
         30 Bytes.

	 Commodity "B" patches OpenWindow() again. Commodity "A" is still
	 running. The new function increases the Stack-Usage by 40 Byte.

	 --> The overall Stack-Usage increases by (40+30) = 70 Bytes!!

@{FG SHINE}Note:@{FG TEXT}    To be true, not all Patches might do that. For example if one
         patches OpenWindow() the following way, the Stack-Usage might
         not be altered:

	 New function jumps to a subroutine (the variables on Stack are
	 used by this subroutine), returns from it, and jumps to the
	 original Function after that.

StackAttack patches CreateProc(), CreateNewProc(), RunCommand() and
SystemTagList() and alters the stack-size passed to them (depending on
what arguments you supply).
@ENDNODE

@NODE "Requirements" "Requirements"
@TOC "Main"

At least @{FG SHINE}AmigaOS 2.0 (V36)@{FG TEXT} is required to run StackAttack.
@ENDNODE

@NODE "LegalStuff" "Legal Stuff"
@TOC "Main"

StackAttack is @{FG SHINE}Freeware@{FG TEXT}. Do anything you want with it, but remember:
I can not be held responsible for any damage that might occure when using
StackAttack!
@ENDNODE

@NODE "Installation" "Installation"
@TOC "Main"

Use the supplied installation script to install StackAttack. It will copy
StackAttack to SYS:C and add the following start line (the installation
script allows you to select at which position you want the line to be
inserted) to your S:startup-sequence

	C:StackAttack MIN=<minimal Stack> ADD=<additional Stack>

The installation script asks you what values you want to use for MIN
and ADD. If you don't know what values to pick accept the suggested
ones. Have a look at @{" Configuration " LINK "Configuration"}

@{FG SHINE}Note:@{FG TEXT}

o If you install StackAttack by hand then remember to put the start line
  after the "C:SetPatch QUIET" line.

  @{B}Experts:@{UB} There's no need to start StackAttack immediately after SetPatch.
  	   If you know that certain programs do have enough stack you can
  	   put the StackAttack line after.

o If you have already used StackAttack (it's also part of PowerWindows) then
  change the "run <>NIL: C:StackAttack ..." line to "C:StackAttack ..."
  "Run" is no more required because now StackAttack allocs memory for a copy
  of the required routines and quits immediately. Now StackAttack only eats
  some hundred Bytes!!!
@ENDNODE

@NODE "Configuration" "Configuration"
@TOC "Main"
The first time you can configure StackAttack with the installation script.
All other times you have to edit s:startup-sequence. The line with
"StackAttack" in it is the one you have to edit.

StackAttack has the following argument template:

	@{FG SHINE}MINSTACK=MIN/N/K,ADDSTACK=ADD/N/K@{FG TEXT}

@{FG SHINE}MINSTACK@{FG TEXT} is the minimum amount of stack in bytes a new process shall have.
The default of the operating system is 4000 (or was it 4096?). The value
suggested by the installation script is 5000. If you are still encountering
strange/casual GURUs try increasing @{FG SHINE}ADDSTACK@{FG TEXT} first.

With @{FG SHINE}ADDSTACK@{FG TEXT} you can specify how many bytes you want to be added to the old
value (the amount of Stack that would be used when StackAttack is not
running eventually corrected to @{FG SHINE}MINSTACK@{FG TEXT} (if it was lower))

@{FG SHINE}____________________________________________________________________________@{FG TEXT}
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

@{FG SHINE}Examples:@{FG TEXT}

You start a program that usually uses a Stack-Size of 10000 Bytes:

@{B}Program     Arguments                   @{UB}|@{B} New Stack Size@{UB}
----------------------------------------+-----------------
                                        |
StackAttack MINSTACK=11000              |      11000
                                        |
StackAttack ADDSTACK=200                |      10200
                                        |
StackAttack MINSTACK=13000 ADDSTACK=400 |      13400
                                        |
StackAttack MINSTACK=5000               |      10000
                                        |
StackAttack MINSTACK=5000 ADDSTACK=600  |      10600
                                        |

@{FG SHINE}____________________________________________________________________________@{FG TEXT}
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

If you are still encountering strange/casual/unmotivated GURUs try increa-
sing @{FG SHINE}ADDSTACK@{FG TEXT}, let's say by 100 or 200 Bytes. I think it is not necessary/
advisable setting @{FG SHINE}MINSTACK@{FG TEXT} to a higher value than 6000.

Of course you cannot expect StackAttack to kill every GURU. It can only kill
the ones which are caused by a too low stack!!
@ENDNODE


@NODE "History" "History"
@TOC "Main"
@{B}V 0.x@{UB}   @{FG SHINE}??.??.??@{FG TEXT}: - StackAttack was only part of PowerWindows


@{B}V 0.9@{UB}   @{FG SHINE}17.08.97@{FG TEXT}: - First release outside from PowerWindows


@{B}V 1.0@{UB}   @{FG SHINE}06.09.97@{FG TEXT}: - Fixed a stupid bug in CreateNewProc() patch

		  - SystemTagList() patch will no longer do anything if
		    no taglist was supplied or no NP_StackSize tag was
		    found. C:ICONX and SYS:SYSTEM/SHELL did not get the
		    correct stack if the STACK tooltype was used!? If you
		    are a programmer please have a look at the "HELP ME!!"
		    file!


@{B}V 1.1@{UB}   @{FG SHINE}11.09.97@{FG TEXT}: - CreateProc() and RunCommand() patch no longer trash
		    the "stack-register" (d4 for CreateProc() and d2 for
		    RunCommand(). The registers were not really trashed,
		    they just kept the corrected value.


@{B}V 1.2@{UB}   @{FG SHINE}03.11.97@{FG TEXT}: - Specifying only ADDSTACK but no MINSTACK caused very
		    big trouble!

		  - The patches for CreateNewProc() and SystemTagList() no
		    longer change the original taglist but make a clone,
		    change it, and pass it to the old (ROM) routine. Anyway,
		    if cloning fails, the original taglist will be patched,
		    but this should only happen if you are very low on
		    memory.

@{B}V 1.3@{UB}   @{FG SHINE}08.09.01@{FG TEXT}: - Fixed my email address in docs

@ENDNODE

@NODE "Author" "Author"
@TOC "Main"

@{FG SHINE}StackAttack was created by:@{FG TEXT}

Georg Steger
Hochlercher 30

I-39030 St. Johann

SOUTH TYROL - ITALY


@{FG SHINE}Send bug reports, comments, to:@{FG TEXT}

EMail: georg.steger@rolmail.net

Write in german (prefered), italian or english!
@ENDNODE


@NODE "Credits" "Credits"
@TOC "Main"

@{FG SHINE}Thanks fly to:@{FG TEXT}

- @{B}Llorenç 'Llor69' Grau@{UB} for the català translation of the FileAttack
  (installation utility) catalog
@ENDNODE


