18 May 2018, 20:21 | #1 |
Posts: n/a
|
** 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 Last edited by Audiorulz4u; 18 May 2018 at 22:06. |
18 May 2018, 21:38 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
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. |
18 May 2018, 22:10 | #3 |
Posts: n/a
|
set the stack to 9000000 bytes and still getting the stack overflow error
|
18 May 2018, 22:57 | #4 |
Posts: n/a
|
See Attached Screen Shot
|
19 May 2018, 09:12 | #5 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
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. |
21 May 2018, 17:24 | #6 |
Posts: n/a
|
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
|
21 May 2018, 20:39 | #7 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,322
|
This smells the infinite recursive call...
The program appears to be broken in some way. |
21 May 2018, 20:50 | #8 |
Posts: n/a
|
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. |
21 May 2018, 21:05 | #9 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,322
|
Doesn't mean the fault is there.
Look in the function which calls that srandom() thingy. How is this function called ? |
22 May 2018, 21:38 | #10 |
Posts: n/a
|
its called within the main() function just srandom(time(0));
|
22 May 2018, 22:05 | #11 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,322
|
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. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
WinUAE hangs, possible input buffer overflow? | mark_k | support.WinUAE | 2 | 22 September 2016 17:27 |
External windows program communicating with program running inside WinUAE | xxxxx | support.WinUAE | 10 | 19 February 2013 09:27 |
Best Stack Program? | dannyp1 | support.Other | 2 | 01 January 2012 19:43 |
"Stack overflow": any way to solve that problem? | Paulisse | New to Emulation or Amiga scene | 10 | 27 January 2008 13:45 |
Blitz Basic - Gosub - Stack Overflow | Tony Landais | Coders. General | 10 | 08 May 2003 20:35 |
|
|