Oldschool Posted November 21, 2007 Share Posted November 21, 2007 Alright, so I got a script that I debuged and tested prior to compilation, and it ran just fine for hours. Now I went and compiled the thing with obfuscation, and now about 1 hour into it it crashes due to stack overflow. What shoud my game plan be when trying to rid of this error. How do I find out what is causing besides making small mods and recompiling and running a million times over?? Link to comment Share on other sites More sharing options...
Fossil Rock Posted November 21, 2007 Share Posted November 21, 2007 Alright, so I got a script that I debuged and tested prior to compilation, and it ran just fine for hours.Now I went and compiled the thing with obfuscation, and now about 1 hour into it it crashes due to stack overflow.What shoud my game plan be when trying to rid of this error. How do I find out what is causing besides making small mods and recompiling and running a million times over??The first thing I would do is compile without obfuscation and see if you get the same problem. Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
Oldschool Posted November 21, 2007 Author Share Posted November 21, 2007 The thing that bugs is this: My script does the same thing every minute... How/why could it crash from stack overflow an hour + into it?? Theoretically?? Link to comment Share on other sites More sharing options...
Developers Jos Posted November 21, 2007 Developers Share Posted November 21, 2007 The thing that bugs is this:My script does the same thing every minute...How/why could it crash from stack overflow an hour + into it??Theoretically??is this an recursion issue? What is the exact error message you get ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Oldschool Posted November 21, 2007 Author Share Posted November 21, 2007 (edited) Error --> Recursion level exceeded -->Autoit exited to prevent stack overflow Edited November 21, 2007 by Oldschool Link to comment Share on other sites More sharing options...
Developers Jos Posted November 21, 2007 Developers Share Posted November 21, 2007 (edited) Error --> Recusion level exceeded -->Autoit exited to prevent stack overflowthat means your script has an logic error and functions are calling eachother without them ever returning .. You need to show your script to be able to help you but the basic issue is this: ; This code will cause a recursion error UDF1() Func UDF1() Sleep(10) ; Do things UDF2() ; Do other things EndFunc Func UDF2() ; Do things UDF1() EndFunc Which should be: Func UDF1() Sleep(10) ; Do things UDF2() ; Do other things EndFunc Func UDF2() ; Do things Return EndFunc Edited November 21, 2007 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Oldschool Posted November 21, 2007 Author Share Posted November 21, 2007 (edited) that means your script has an logic error and functions are calling eachother without them ever returning ..You need to show your script to be able to help you but the basic issue is this:It's 30 pages long )I thought that might be the problem. I'll be able to fix it now...Thanks Jos Edited November 21, 2007 by Oldschool Link to comment Share on other sites More sharing options...
Oldschool Posted November 21, 2007 Author Share Posted November 21, 2007 (edited) Hey what about this syntax UDF1() Func UDF1() While $var < 10 ; do some stuff UDF2() WEnd While $var1 < 20 ; do some stuff UDF3() WEnd While $var2 > 5 ; do some stuff UDF4() WEnd UDF1() EndFunc Edited November 21, 2007 by Oldschool Link to comment Share on other sites More sharing options...
Developers Jos Posted November 21, 2007 Developers Share Posted November 21, 2007 (edited) Now do me a favor and reread your last post but now assuming you do not know anything about what it is this person is asking or wanting to accomplish... I guess you will agree that it doesn't make much sense ... EDIT: ahh i see you editied it already: Rule 1: you never have a func Always call itself ... this will always leads to a recursion level error. There has to be a condition that will return to the previous called level. Edited November 21, 2007 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Oldschool Posted November 21, 2007 Author Share Posted November 21, 2007 There has to be a condition that will return to the previous called level.May I have a quick example please... Link to comment Share on other sites More sharing options...
Oldschool Posted November 21, 2007 Author Share Posted November 21, 2007 (edited) In other words a better way to write this would be: UDF1() Func UDF1() While 1 While $var < 10 ; do some stuff UDF2() WEnd While $var1 < 20 ; do some stuff UDF3() WEnd While $var2 > 5 ; do some stuff UDF4() WEnd Wend EndFunc And then of course have the UDF2() - UDF4() Return I can just use a blank Return? or it has to return a value? Edited November 21, 2007 by Oldschool Link to comment Share on other sites More sharing options...
Developers Jos Posted November 21, 2007 Developers Share Posted November 21, 2007 (edited) yes.. this will work fine ... (here is a version ran through tidy.exe UDF1() Func UDF1() While 1 While $var < 10 ; do some stuff UDF2() WEnd While $var1 < 20 ; do some stuff UDF3() WEnd While $var2 > 5 ; do some stuff UDF4() WEnd WEnd EndFunc ;==>UDF1 its the same as doing it this way : Global $var, $var1, $var2 While 1 While $var < 10 ; do some stuff UDF1() WEnd While $var1 < 20 ; do some stuff UDF2() WEnd While $var2 > 5 ; do some stuff UDF3() WEnd WEnd Func UDF1() ; do stuff EndFunc ;==>UDF1 Func UDF2() ; do stuff EndFunc ;==>UDF2 Func UDF3() ; do stuff EndFunc ;==>UDF3 Edited November 21, 2007 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Oldschool Posted November 21, 2007 Author Share Posted November 21, 2007 Many thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now