This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Stackoverflow in SYS/BIOS kernel task

Other Parts Discussed in Thread: SYSBIOS

Hello,


I am getting the next error while trying to run a program using XDS510 debugger:

[C66xx_1] ti.sysbios.knl.Task: line 359: E_stackOverflow: Task 0x85a3c0 stack overflow.

[C66xx_1] xdc.runtime.Error.raise: terminating execution


I am using the KeyStone I device (TMDSEVM6678L).

While, I use the ROV to catch which task is the 0x85a3c0 and also the Memory Browser, nevertheless Im not able to find which is that task and why is the error ocurring. I attached one image with the name error.png; in this image you can see the ROV and the Memory Browser during the Debugging session.

Could anyone give me an advice to try solve this problem?


Thank you so much!

Ronny

  • Hi Ronny,

    Thanks for posting the screen shot.  But, could you please post another one that shows the "Detailed" tab/view of the Task module in ROV?

    It seems like you should just need to increase the stack size of that Task.

    Steve

  • Thank you Steven for your prompt reply.


    I attached the screenshot you asked.


    I tried adding the next line:

    Task.defaultTaskStackSize = 4096;

    But it doesnt work, the problem I see is that I dont find the task in the ROV (0x85a3c0). Any way here is the screenshot, so let me know what you think about it.

    Thank you,

    Ronny


  • Ronny,

    I think the next step is to find out more about the task, in particular, which function it is configured to run.

    You can find out more info about that task using the CCS "Expressions" window.

    Once you open that window in CCS, you can cast the task address that you have from the error message to a Task_Handle type.  Once cast, you can inspect the fields of that task.  Can you take a screen shot of this once you do it, so I can see what's in the task?

    I've attached a screen shot of my Expression window in which I cast a task in my application like this:

    Once you do that, you will be able to see the function that the task runs.  You should enter the address of that function into the CCS dis/assembly window and it should take you to that function.

    What function do you find for that task?

    Steve

  • Here you have it Steven. Let me know what you think.

    Thank you very much.

    Ronny

  • Ronny,

    Ok great.  But you still need to find the function.  You need to enter the address of that function into the CCS dis/assembly window and it should take you to that function.

    Once you find the function, the next step is to find out who's creating the task with that function.

    Steve

  • Dear Steven,

    I think I have the proper image that you asked me.

    The next step is what I dont have clear. How can I know who is creating that task if it seems to be created by the sys/bios kernel?  (ti_sysbios_knl_Task_Module_State_0_readyQ__A)

    Regards,

    Ronny

  • Ronny,

    Hmm ... something seems suspicious.  I would have expected 0x00860BB8 to take you exactly to the beginning of the ti_sysbios_knl_Task_Module... function (i.e. 0x00860B80).  It feels like the view in the expressions window may be bogus, most likely because that Task has already been deleted.

    Let's try another approach.  Can you configure Task hook functions into your app?  If you add a "create hook" (and optionally a "delete hook") you can see each task that gets created (or deleted).

    Thinking as I type, the create hook function is probably more useful in helping you.  It has the following signature:

    Void myCreateFxn(Task_Handle task, Error_Block *eb);

    So you would need to define this function in your C code.

    Notice that the first parameter is a Task_Handle.  If you add this create hook into your app, and then put a print statement in it, then you can see the Task_Handle to fxn mapping.  Or, break point could be used, along with the Expression window as was done previously.

    For example, you could have something like the following:

    System_printf("myCreateFxn: Task handle %x has fxn %x\n", task, task->fxn);

    System_flush();

    This would then allow you to see which function address corresponds to the task handle that's printed due to overflow.

    To add the hooks, add the following config code to your app's *.cfg file:

        var Task = xdc.useModule('ti.sysbios.knl.Task');

        var hooks = new Task.HookSet();
        hooks.createFxn = '&myCreateFxn';
        Task.addHookSet(hooks);

    Steve

  • Dear Steven,

    Sorry the delay in the answer. I will try this apporach, and let you know.

    Thank you!

    Ronny

  • Dear Steven,


    I tried to add the task hooks, but unfortunately I think the app cannot use them, because the whole app uses a lot of c-source-to-source transformations (and initially is written in another C language) and uses several source inputs. Do think could be another way to solve this problem?


    Thank you for your useful help!

    Ronny