Crashes by overwritten adresses

We have a serious problem. We use NETOS 5.0. Ge get a lot of crashes by overwritten addresses. The point is that its not always the same location but always the same context. At the end of a routine when the houskeeping functions of the compiler frees objects. In this context an adress is either manipulated eg it is 0xe288c94 instead of 0x0288c94 or completly destroyed, that gives a memory exception. It seems the cause of the problem lies in a preentive thread switch, because when we set the priorities so that no switch will be taken or disable time slicing the crashes are gone. We have checked out the problem for a couple of weeks but we can’t find another reason for the overwriting. Help appreciated.

finally we have found a reason, it comes from the system kernal. There is a bug in the context switching between threads, some data will not be locked/switched. This is atleast tru for the V5.0, if it also belongs to V6.0 i dont know. Nwo i wonder that nobody other had troubles on multithreading, isnt it used by other clients?

I think that everyone that is using NETOS is also using multithreading, so it is very unlikely that there is a general failure in the context switching. Are you using packed structures? There are situations where the compiler has some bad side effects in this case. Maybe this could be the reason. Check how you 32-bit value is aligned.