PDA

View Full Version : SMART Window Crashing randomly



Mj
01-31-2016, 07:11 PM
Hey Everyone,
I had a cooking script running fine for awhile, but then wanted to make it use all reflection, I don't know where I went wrong, but now my client crashes at different points, and not sure if its related to my memory management or something else. If someone could take a look and see if they can reproduce the problem that would be awesome.

Here is also the command prompt output

formWriteln: getting box
formWriteln: moving mouse
formWriteln: clicking
formWriteln: Cooking all
formWriteln: Waiting for allRaw shark to be cooked
formWriteln: Checking for level up
formWriteln: Waiting
formWriteln: Checking for level up
formWriteln: Waiting
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call
SMART: Could Not Call

27135

KeepBotting
01-31-2016, 07:32 PM
I've had this happen before, seems to be caused when your client's socket dies. I don't know what causes that, though.

(git (https://github.com/BenLand100/SMART/blob/7b3de2d739841b68fcdef6a7a0d8ba6f73f7f224/src/SmartRemote.cpp#L120))

Had this happen once or twice, and then never again. At what frequency do you experience this issue? What is your system's uptime?

Mj
01-31-2016, 07:59 PM
It only started happening when I started doing MemoryManagement with Reflection, I try to Free every Object after I am done using it, but that is what has seemed to cause the issues, I rebooted my computer within the last day because I thought maybe that could help with whatever was going on. I Just removed all of my Free's from my script and so far its running fine (5 minutes), it normally closed within 10-15 seconds. I am pretty sure I have induced a memory leak though because the memory usage on the running java application keeps going up, slowly, but still going up. I might try to isolate which free is giving me issues. Is there a heavy debug setting I can use to see more output?

the bank
01-31-2016, 08:17 PM
It only started happening when I started doing MemoryManagement with Reflection, I try to Free every Object after I am done using it, but that is what has seemed to cause the issues, I rebooted my computer within the last day because I thought maybe that could help with whatever was going on. I Just removed all of my Free's from my script and so far its running fine (5 minutes), it normally closed within 10-15 seconds. I am pretty sure I have induced a memory leak though because the memory usage on the running java application keeps going up, slowly, but still going up. I might try to isolate which free is giving me issues. Is there a heavy debug setting I can use to see more output?

More than likely you are freeing a primitive type. You only need to deallocate pointers.

The return type of any GetObject incuding the array ones is an integer representing the memory address. Free these. Do not free any others, they are not valid memory addresses and will cause SMART to crash.

Mj
01-31-2016, 08:46 PM
Could you take a look at my script and let me know If what I am doing is correct? I don't believe I am freeing primitives, Only after I call a Find or get Method on a TReflect instance.

the bank
01-31-2016, 11:10 PM
Well - my scope of SMART's reflection functions is only from my own work, not any public reflection includes. I have no idea what a TReflect type is.

But sure, post it and I will review.

Mj
02-01-2016, 12:19 AM
Its An attachment at the bottom, or at least should be

the bank
02-01-2016, 12:36 AM
Its An attachment at the bottom, or at least should be

Easy way to debug is to add each one in again one at a time.

Whenever script starts crashing, you know you found the problem.

Kyle
02-01-2016, 02:56 AM
You actually don't have to free anything other than widgets using the reflection include mudda_fudda; Everything is handled internally to make it easier. Since you are attempting to free an already freed object, it will eventually crash smart..