06 June 2019, 20:02 | #61 |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,030
|
You are very funny. You never heard about programs or OS updates? You dont tell me single example which program can be break. I can say noone program will be break. Seems you dont heard about updated documentation. Your dirty method is not well documented too. Which tools handled your stack method? Maybe Resource? Simple you think that you know better than others, but this is not TRUE.
|
06 June 2019, 21:07 | #62 | ||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,537
|
Quote:
Quote:
|
||
06 June 2019, 21:19 | #63 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,352
|
Quote:
Quote:
But nobody will disassemble all startup code of every existing compiler to verify they actually do it this way... Even if they do, we can still inadvertently end up in a situation where the stack size is smaller as given by the cookie, than what the startup code will set. Like the 10k above, if the programmer doesn't know and sets the cookie for 8k. |
||
06 June 2019, 21:25 | #64 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,537
|
When you find out that your compiler is crap you can either remove the stack cookie again or write your own startup code.
|
06 June 2019, 21:31 | #65 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,352
|
|
06 June 2019, 21:34 | #66 | |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,304
|
Quote:
|
|
06 June 2019, 21:36 | #67 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,304
|
text You do not need to put the cookie into the startup code. Putting it into the first translation unit is usually good enough. You can put it into the startup code. But there is no need to.
|
06 June 2019, 22:38 | #68 |
Registered User
|
The best way probably is having just small startup code in the program which checks if stack is large enough and if not, allocate large enough and then start with it. Works starting at OS1.x.
Also there are compilers which not only check if the stack is large enough, but expand it on the fly, as well. I think the $STACK is a new nice addition which is esp. useful on modern AmigaOS invocations. If that's your audience, go for it! But if you also target 1.x/2.x/3.0/3.1 you should allocate the stack yourself or inform the user to use the stack cmd. EDIT: Are the any precautions about ambigious usage of $STACK, e.g. if it's an unlucky coincidence of characters from older software? |
07 June 2019, 08:37 | #69 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,352
|
The stack cookie would have been quite acceptable if it could replace stack swap in every case. But it can't. Even if your program *requires* OS v3.9 and you're sure it will be supported. Even if you are 100% sure it is located at the right place. The reason is that it may still fail to be seen (like in the case of crunched code) or, worse, not looked for at all (if your prg isn't run from cli or wb).
Here is real life example. When i run HOMM2 in my debugger, it does LoadSeg and then hands its stack inherited from cli to the program. Therefore to be able to debug a program using a big stack (HOMM2 uses 32k) i'd need to type "stack" command every time. I don't want to do that ! The stack cookie can't help me : it's gonna be ignored in this case. And we're not supposed to update existing tools to use it. So even if i did run OS V3.9 it wouldn't be able to help me. However my asm startup code can optionnally change the stack and this is what my HOMM2 port hopefully does. I can now debug without any special care. Problem solved, but stack cookie useless for it. Do you like solutions that solve a problem only in a limited number of cases ? Personnally, i don't. |
08 June 2019, 16:10 | #70 | |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,030
|
Quote:
|
|
08 June 2019, 23:32 | #71 | |||
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,304
|
Quote:
Quote:
Quote:
|
|||
09 June 2019, 01:36 | #72 | |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,030
|
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Moving supervisor stack | roondar | Coders. Asm / Hardware | 6 | 18 July 2017 17:13 |
Stack available | mritter0 | Coders. General | 4 | 03 August 2014 18:31 |
TCP/IP Stack | redneon | Amiga scene | 18 | 24 July 2005 16:01 |
Stack Up | Galaxy | request.Old Rare Games | 5 | 08 September 2004 03:06 |
Who wants a stack of originals? | FromWithin | Games images which need to be WHDified | 41 | 31 July 2003 09:31 |
|
|