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.

Stack Overflows

Other Parts Discussed in Thread: SYSBIOS, OMAP-L138, OMAP-L137

Hello,

I am using an OMAP L137 Processor
I am running a Embedded-Linux version with the CMEM and Syslink modules
When i compile my program with C6RunApp as a DSP executable and run it i get a stack overflow.
This happens mostly in a printf() function.

I know that printf can be very stack consuming but i need it to validate data.

Is there any way to alter the default stack size?

Sincerly Christof  

  • Additionally this is the output when the Sysbios kernel crahes:

    ti.sysbios.knl.Task: line 330: E_stackOverflow: Task 0xc3000308 stack overflow.
    [t=0x40d87198] xdc.runtime.Main: ERROR: "cio_ipc.c", line 213: MessageQ_get() failed: status = [0xffffffff]

    the two line are written aproximately 100 times to the console

    after them comes:
    [t=0x40d87198] xdc.runtime.Main: ERROR: "cio_ipc.c", liUnable to handle kernel NULL pointer dereference at virtual address 00000000                                 
    ne 213: MessageQpgd = c0004000                                                                                                                                      
    _get() failed: s[00000000] *pgd=00000000tatus = [0xfffff                                                                                                            
    fff]                                                                                                                                                                
    [t=0x40d93Internal error: Oops: 17 [#1] PREEMPT                                                                                                                     
    Modules linked in: syslink cmemk                                                                                                                                    
    CPU: 0    Not tainted  (3.0.13-ptx-2012.01.0 #1)                                                                                                                    
    PC is at kfree+0x38/0xf8                                                                                                                                            
    LR is at skb_release_data+0xa8/0xb0        

  • In the meantime i have reduced te problem to a single error line:

    ti.sysbios.knl.Task: line 345: E_spOutOfBounds: Task 0xc3000308 stack error, SP = 0xc2ffc808.

    I don't think that there are errors in the program code.
    The same code can be compiled and run on a x86 system(windows) and on ARM(linux) without problems.

  • Sorry for the delay.  We compiler experts are not that familiar with C6Run, embedded Linux, and so on.  I'll move your thread to the Linux forum.

    Thanks and regards,

    -George

  • When using C6RunApp, the main function runs in the context of a single SysBios Task on the DSP.  The root function of that task is the C6RUN_CONTROL_task() function, and the task is created in the C6Run_main.c file, under build/dsp_libs/os/sysbios6.  You would need to edit the line that currently says:

    taskParams.stackSize = 4*1024;

    to have the value you want.  After this you would need to rebuild the back end libraries and your application to bring in this change.

    Regards, Daniel

    P.S. Note that the OMAP-L137 was never tested with SysLink/SysBios6, but I assume that you have adapted the OMAP-L138 SysLink platform you suit your own needs.

  • I thank you very much for this answer.

    I changed the line to "taskParams.stackSize = 64*1024;"

    After recompiling the dsp_lib modules of C6Run i was able to recompile and execute my program without any further changes.