** Stack Overflow ** trying to run program in WinUAE
I am trying to run a program withen WinUAE that i compiled from source code.. the program compiles fine however when ever i try and run the program i get a Stack overflow error.. digging around in the code the fuction its failing on is a function call of srandom(time(0)); any ideas on how to correct this?
Thanks, Robert |
Assuming it is compiler's startup-code that does the stack check: use stack CLI command to set larger stack. (or add it to startup-sequence, default 4k is far too small today)
It has nothing to do with emulation. |
set the stack to 9000000 bytes and still getting the stack overflow error
|
1 Attachment(s)
See Attached Screen Shot
|
If program is unix port, it may need more than 64k of stack (but not 9M, 500k should be good test value).
Or it is using some compiler specific default stack size. Check compiler settings/documentation. |
i've set it to 500k and even specified int _stack = 500000; in the config file and still get the stack over flow for whatever reason the program compiled wtih out any issues using SAS 6.5
|
This smells the infinite recursive call...
The program appears to be broken in some way. |
the program crashs when it calls the srandom() function in the source code
The srandom() function initializes the calling thread's current state array for the random() function using the value of seed. |
Doesn't mean the fault is there.
Look in the function which calls that srandom() thingy. How is this function called ? |
its called within the main() function just srandom(time(0));
|
Then there is no reason it should do a stack overflow.
Just to be sure, comment this line out and try again. Noninitialized random seed should have a minimal impact and be fine for some debug testing. |
All times are GMT +2. The time now is 15:45. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.