Reg MempartFree and taskSuspend in VxWorks - VxWorks

This is a discussion on Reg MempartFree and taskSuspend in VxWorks - VxWorks ; Hi, I am running my application in PPC environment in VxWorks 5.5.1. I am facing some error like below when I am spawning my test in the shell : free ([]) f81dd0 memPartFree +124: taskSuspend ([]) 1. I want to ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Reg MempartFree and taskSuspend in VxWorks

  1. Reg MempartFree and taskSuspend in VxWorks

    Hi,

    I am running my application in PPC environment in VxWorks 5.5.1.

    I am facing some error like below when I am spawning my test in the
    shell :

    free ([])
    f81dd0 memPartFree +124: taskSuspend ([])

    1. I want to know is there any relationship between stack size and the
    above mentioned error?

    Because when I run with 64K stack size, the problem is happening. But,
    if I run with more than 64 K say 70K, 128K the problem is not
    happening.

    2. When I spawn my test three times with 70K stack size, then third
    time the error is happening.

    I am sure that my code works properly in all other platforms Like
    Windows, Suse, Solaris..

    I am totally confused and unable to find the root cause of the
    problem.

    Please help me if there is any solution to find it..

    Thanks in Advance,

    Regards
    Satish.

  2. Re: Reg MempartFree and taskSuspend in VxWorks

    Hi Satish,

    The worst thing in vxWorks (up to 5.5) is lack of memory protection.
    If stack overflow is happening then yes it may corrupt the memory
    ( may be pointer that is being passed to free in this case). The
    better would be to use checkStack API to know if the stack usage of
    any task is nearly touching the boundry. In my experience less than
    500/1000 bytes margin is dangerous.

    Best Regards
    VKG | Ritsoft Technologies


  3. Re: Reg MempartFree and taskSuspend in VxWorks

    On Jan 24, 2:43*pm, VKG Ritsoft Technologies
    wrote:
    > Hi Satish,
    >
    > The worst thing in vxWorks (up to 5.5) is lack of memory protection.
    > If stack overflow is happening then yes it may corrupt the memory
    > ( may be pointer that is being passed to free in this case). The
    > better would be to use checkStack API to know if the stack usage of
    > any task is nearly touching the boundry. In my experience less than
    > 500/1000 bytes margin is dangerous.
    >
    > Best Regards
    > VKG | Ritsoft Technologies


    Hi VKG,

    Thanks for your reply.

    I checked for margin. But it always shows around 50K when I run with
    65K

    The information is as below:

    stack: base 0x3d8f310 end 0x3d7f310 size 65520 high 15160 margin
    50360

    If margin so high, then why this problem happening?

    Regards
    Satish.

  4. Re: Reg MempartFree and taskSuspend in VxWorks

    Hi Staish,

    On a such high margin I don't think that stackover flow will ever be
    happening. So I suspect it is something to do with the wrong code and
    problem is just exposed with different stack size. BTW are you using
    some wrapper function/Macro for malloc or calling malloc directly from
    several places in the code. If using wrapper then you have a chance to
    verify the validity of pointer passed in free (may be through printf
    or an array).

    Best Regards
    VKG | Ritsoft Technologies

+ Reply to Thread