• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[vJASS] Allocation Stack Corruption

Status
Not open for further replies.
Level 31
Joined
Jul 10, 2007
Messages
6,306
So, I've had a problem recently that I haven't been able to solve.


1. There is no thread crash going on
2. There are no leaks
3. When the number of operations grows, the stack becomes corrupted. However, the thread does not crash.
4. The stack does not become corrupted when doing these operations in a separate thread. Once again, the thread isn't crashing when everything is just on the original thread. I don't understand what the difference is if the thread doesn't crash either way.

It has been verified with absolute certainty that the resource does not leak and that the operations do not cause stack corruption. It has also been verified with absolute certainty that the thread never crashes.


The culprit is this set of lines in ListHtNt at line 469.

JASS:
			debug private method clearNode takes thistype end returns nothing
				debug loop
					debug call clearAddress()
				
					debug exitwhen this == end
					debug set this = this.p_next
				endloop
			debug endmethod

The code being run is Untitled Trigger 001



Please help me figure this problem out. I'm at a total loss.
 

Attachments

  • Booolean Expression.w3m
    116.8 KB · Views: 23
Level 26
Joined
Aug 18, 2009
Messages
4,097
Something does crash or is on the precipe. You seem to forget that jasshelper inserts TriggerEvaluates when calling methods downwards. I added counters in calculateFreeMemoryLoop__$STACK$, calculateFreeMemoryLoop__$STACK$__main and clearNode like

JASS:
function abc...
    set udg_c=udg_c+1
    ...do stuff
    set udg_c=udg_c-1
endfunction

and at a point it was 1 after your "memory leaks" output.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
I just realized what leaks

JASS:
	private static method clearCollections takes nothing returns nothing
		loop
			exitwhen collectionCount == 0
			set collectionCount = collectionCount - 1
			
			call thistype(collections[collectionCount]).destroy()
		endloop
	endmethod

This is not part of the crash detection test... heh


All of those errors indicated nothing but a crash occurring somewhere.

My bad ;D


Helps to not code when I'm not dead tired o-o


edit
test success! : D
 
Status
Not open for further replies.
Top