English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 18 May 2018, 20:21   #1
Audiorulz4u
 
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.
 
Old 18 May 2018, 21:38   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 23,951
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.
Toni Wilen is online now  
Old 18 May 2018, 22:10   #3
Audiorulz4u
 
Posts: n/a
set the stack to 9000000 bytes and still getting the stack overflow error
 
Old 18 May 2018, 22:57   #4
Audiorulz4u
 
Posts: n/a
See Attached Screen Shot
Attached Thumbnails
Click image for larger version

Name:	circlemud.jpg
Views:	123
Size:	103.3 KB
ID:	58287  
 
Old 19 May 2018, 09:12   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 23,951
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.
Toni Wilen is online now  
Old 21 May 2018, 17:24   #6
Audiorulz4u
 
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
 
Old 21 May 2018, 20:39   #7
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 47
Posts: 3,875
This smells the infinite recursive call...
The program appears to be broken in some way.
meynaf is offline  
Old 21 May 2018, 20:50   #8
Audiorulz4u
 
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.
 
Old 21 May 2018, 21:05   #9
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 47
Posts: 3,875
Doesn't mean the fault is there.
Look in the function which calls that srandom() thingy.
How is this function called ?
meynaf is offline  
Old 22 May 2018, 21:38   #10
Audiorulz4u
 
Posts: n/a
its called within the main() function just srandom(time(0));
 
Old 22 May 2018, 22:05   #11
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 47
Posts: 3,875
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.
meynaf is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:15.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.07787 seconds with 16 queries