stack overflow - VxWorks

This is a discussion on stack overflow - VxWorks ; Hi, I am getting stack overflow trap. I am using vxworks. Can you please tell me at what situations(or for what reasons) the stack overflow can occur and how to debug it in vxworks? Regards, Ramesh...

+ Reply to Thread
Results 1 to 5 of 5

Thread: stack overflow

  1. stack overflow

    Hi,
    I am getting stack overflow trap. I am using vxworks. Can you
    please tell me at what situations(or for what reasons) the stack
    overflow can occur and how to debug it in vxworks?

    Regards,
    Ramesh

  2. Re: stack overflow

    ramu wrote:
    > Hi,
    > I am getting stack overflow trap. I am using vxworks. Can you
    > please tell me at what situations(or for what reasons) the stack
    > overflow can occur and how to debug it in vxworks?
    >
    > Regards,
    > Ramesh


    What target architecture are you using, and what kind of vxworks task is
    it (user vs. kernel)? And what version of VxWorks?

    Large local variables in a function will cause it to have a large stack
    frame. If the stack frame is too large for the available space in a
    stack, you'll get overflow. Overflow could also be caused by recursion.

    Call 'checkStack' from the target shell to see a list of the tasks,
    their stack size, high water mark and available margin. You may just
    have a legitimate need to increase the size of a particular task's stack.

    Hope that helps.

    Iain

  3. Re: stack overflow

    On Oct 31, 8:49*pm, Iain Woolf wrote:
    > ramu wrote:
    > > Hi,
    > > * * *I am getting stack overflow trap. I am using vxworks. Can you
    > > please tell me at what situations(or for what reasons) the stack
    > > overflow can occur and how to debug it in vxworks?

    >
    > > Regards,
    > > Ramesh

    >
    > What target architecture are you using, and what kind of vxworks task is
    > it (user vs. kernel)? And what version of VxWorks?
    >
    > Large local variables in a function will cause it to have a large stack
    > frame. If the stack frame is too large for the available space in a
    > stack, you'll get overflow. Overflow could also be caused by recursion.
    >
    > Call 'checkStack' from the target shell to see a list of the tasks,
    > their stack size, high water mark and available margin. You may just
    > have a legitimate need to increase the size of a particular task's stack.
    >
    > Hope that helps.
    >
    > * Iain


    Hi,
    the target arcitecture is power pc and vxworks version is 6.1.
    The task was created with only supervisor mode.

    I looked into the stack trace of the trapped task. But I didn't find
    any recursion in the stack trace.
    And, if the large local variables is the reason, I would have found
    this trap very often. But the trap occurs rarely.(not always found).
    And stack size allocated for this task is sufficeint enough(8k).

    Are there any other reasons for the stack overflow, apart from the
    above mentioned reasons?

    Regards.


  4. Re: stack overflow

    On Oct 31, 11:29*pm, ramu wrote:
    > On Oct 31, 8:49*pm, Iain Woolf wrote:
    >
    >
    >
    > > ramu wrote:
    > > > Hi,
    > > > * * *I am getting stack overflow trap. I am using vxworks. Can you
    > > > please tell me at what situations(or for what reasons) the stack
    > > > overflow can occur and how to debug it in vxworks?

    >
    > > > Regards,
    > > > Ramesh

    >
    > > What target architecture are you using, and what kind of vxworks task is
    > > it (user vs. kernel)? And what version of VxWorks?

    >
    > > Large local variables in a function will cause it to have a large stack
    > > frame. If the stack frame is too large for the available space in a
    > > stack, you'll get overflow. Overflow could also be caused by recursion.

    >
    > > Call 'checkStack' from the target shell to see a list of the tasks,
    > > their stack size, high water mark and available margin. You may just
    > > have a legitimate need to increase the size of a particular task's stack.

    >
    > > Hope that helps.

    >
    > > * Iain

    >
    > Hi,
    > * * *the target arcitecture is power pc and vxworks version is 6.1.
    > The task was created with only supervisor mode.
    >
    > I looked into the stack trace of the trapped task. But I didn't find
    > any recursion in the stack trace.
    > And, if the large local variables is the reason, I would have found
    > this trap very often. But the trap occurs rarely.(not always found).
    > And stack size allocated for this task is sufficeint enough(8k).
    >
    > Are there any other reasons for the stack overflow, apart from the
    > above mentioned reasons?
    >
    > Regards.


    As a first pass on the debugging, try increasing the stack size
    significantly (e.g. 64K), and see if you can repro the problem.

  5. Re: stack overflow

    On Nov 1, 11:29*am, ramu wrote:
    > On Oct 31, 8:49*pm, Iain Woolf wrote:
    >
    >
    >
    > > ramu wrote:
    > > > Hi,
    > > > * * *I am getting stack overflow trap. I am using vxworks. Can you
    > > > please tell me at what situations(or for what reasons) the stack
    > > > overflow can occur and how to debug it in vxworks?

    >
    > > > Regards,
    > > > Ramesh

    >
    > > What target architecture are you using, and what kind of vxworks task is
    > > it (user vs. kernel)? And what version of VxWorks?

    >
    > > Large local variables in a function will cause it to have a large stack
    > > frame. If the stack frame is too large for the available space in a
    > > stack, you'll get overflow. Overflow could also be caused by recursion.

    >
    > > Call 'checkStack' from the target shell to see a list of the tasks,
    > > their stack size, high water mark and available margin. You may just
    > > have a legitimate need to increase the size of a particular task's stack.

    >
    > > Hope that helps.

    >
    > > * Iain

    >
    > Hi,
    > * * *the target arcitecture is power pc and vxworks version is 6.1.
    > The task was created with only supervisor mode.
    >
    > I looked into the stack trace of the trapped task. But I didn't find
    > any recursion in the stack trace.
    > And, if the large local variables is the reason, I would have found
    > this trap very often. But the trap occurs rarely.(not always found).
    > And stack size allocated for this task is sufficeint enough(8k).
    >
    > Are there any other reasons for the stack overflow, apart from the
    > above mentioned reasons?
    >
    > Regards.


    Most of the time stack overflow happens because of large variables on
    stack.
    Review your code in all conditional paths to see any function trying
    to pass
    huge structures as arguments and huge arrays on stack
    Also you may need to check if you are trying to write past through
    arrays, etc.
    Ranga

+ Reply to Thread