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.

Invalid Free Error on HeapMem

Other Parts Discussed in Thread: SYSBIOS, TMS320C6678

Hello,

I ran "client" example in MCSDK2.00.03.15 on Core0 of EVMC6678L.
And on shutting down, "Invalid free" error on HeapMem occurred.

The same situation occurrs in my application.
So, I want to fix this problem.

Any suggestion welcome!

The Console log follows:

[C66xx_0] QMSS successfully initialized
[C66xx_0] CPPI successfully initialized
[C66xx_0] PA successfully initialized
[C66xx_0]
[C66xx_0] TCP/IP Stack Example Client
[C66xx_0] Configuring DHCP client
[C66xx_0] PASS successfully initialized
[C66xx_0] Ethernet subsystem successfully initialized
[C66xx_0] Ethernet eventId : 48 and vectId (Interrupt) : 7
[C66xx_0] Registration of the EMAC Successful, waiting for link up ..
[C66xx_0] Service Status: DHCPC    : Enabled  :          : 000
[C66xx_0] Service Status: Telnet   : Enabled  :          : 000
[C66xx_0] Service Status: HTTP     : Enabled  :          : 000
[C66xx_0] Service Status: DHCPC    : Enabled  : Running  : 000
[C66xx_0] Network Added: If-1:172.26.22.230
[C66xx_0] Service Status: DHCPC    : Enabled  : Running  : 017
[C66xx_0] 00031.100 TCP: Retransmit Timeout
[C66xx_0] 00041.100 TCP: Retransmit Timeout
[C66xx_0] 00041.400 TCP: Retransmit Timeout

--- Here, connect to EVM via telnet, and enter 'shutdown'

[C66xx_0] Network Removed: If-1:172.26.22.230
[C66xx_0] Service Status: DHCPC    : Disabled :          : 000
[C66xx_0] Service Status: Telnet   : Disabled :          : 000
[C66xx_0] Service Status: HTTP     : Disabled :          : 000
[C66xx_0] ti.sysbios.heaps.HeapMem: line 311: assertion failure: A_invalidFree: Invalid free
[C66xx_0] xdc.runtime.Error.raise: terminating execution


Thanks.
Hideo NORO

PS. Loading GEL file, and it runs on program(ie. client) loading.

  • Hi Hideo NORO,

    Which version of the NDK and BIOS are you using?

    Thanks,

    Steve

  • Also, are you running the "shutdown" command from the telnet console?

  • Hello Steven,

    I use these versions below:

    MCSDK 2.0.3.15
    MCSDK PDK TMS320C6678 1.0.0.15 
    NDK 2.20.4.26
    SYS/BIOS 6.32.04.49 

    Also, as mentioned original question, I connect to EVM via telnet, then type "shutdown" from the telnet client.

    Any guess are welcome.

    Thanks,

    Hideo NORO

    Steven Connell said:

    Hi Hideo NORO,

    Which version of the NDK and BIOS are you using?

    Thanks,

    Steve

     

  • Hideo NORO,

    I tried to reproduce this problem and I was not able to, although I am using different hardware than you are.

    I also found that there is an existing bug that seems similar to this:

    SDOCM00054571 (Child) DSP crash on Reboot with a PPPoE server on NDK

    The bug report specifically mentions using a PPPoE connection.  Are you using PPPoE?

    Can you send the build output of your program? It should print out the libraries that are being linked.

    Thanks,

    Steve

  • Hello Steve,

    I'm not using PPPoE.

    So, I guess this is specific to the EVMC6678L or C6678 itself.

    Below is build output of sample client program.
    I first, "Clean Project" and delete "Debug" folder, then "Build Project" 

    I hope this will help to solve the problem.

    Thanks,

    Hideo

     

    **** Build of configuration Debug for project client_evmc6678l ****

     

    C:\Program Files\Texas Instruments\ccsv5\utils\gmake\gmake -k all 

    'Building file: ../client.cfg'

    'Invoking: XDCtools'

    "C:/Program Files/Texas Instruments/xdctools_3_22_01_21/xs" --xdcpath="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages;C:/Program Files/Texas Instruments/ndk_2_20_04_26/packages;C:/Program Files/Texas Instruments/bios_6_32_04_49/packages;C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/demos;" xdc.tools.configuro -o configPkg -t ti.targets.elf.C66 -p ti.platforms.evm6678 -r debug -c "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4" "../client.cfg"

    making package.mak (because of package.bld) ...

    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...

    configuring client.pe66 from package/cfg/client_pe66.cfg ...

        will link with ti.ndk.config: ../lib/C66/miniPrintf.lib

        will link with ti.ndk.config: ../lib/C66/netctrl.lib

        will link with ti.ndk.config: ../lib/C66/nettool.lib

        will link with ti.ndk.config: ../lib/C66/os.lib

        will link with ti.ndk.config: ../lib/C66/hal/hal_ser_stub.lib

        will link with ti.ndk.config: ../lib/C66/hal/hal_timer_bios.lib

        will link with ti.ndk.config: ../lib/C66/hal/hal_userled_stub.lib

        will link with ti.ndk.config: ../lib/C66/hal/hal_eth_stub.lib

        will link with ti.ndk.config: ../lib/C66/cgi.lib

        will link with ti.ndk.config: ../lib/C66/console.lib

        will link with ti.ndk.config: ../lib/C66/hdlc.lib

        will link with ti.ndk.config: ../lib/C66/servers.lib

        will link with ti.ndk.config: ../lib/C66/stack.lib

    cle66 package/cfg/client_pe66.c ...

    'Finished building: ../client.cfg'

    ' '

    'Building file: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/client.c'

    'Invoking: C6000 Compiler'

    "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/bin/cl6x" -mv6600 -g --include_path="C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/include" --include_path="C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/evmc6678l/.." --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/qmss" --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/cppi" --diag_warning=225 --abi=eabi --preproc_with_compile --preproc_dependency="client.pp" --cmd_file="./configPkg/compiler.opt"  "C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/client.c"

    'Finished building: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/client.c'

    ' '

    'Building file: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/platform_osal.c'

    'Invoking: C6000 Compiler'

    "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/bin/cl6x" -mv6600 -g --include_path="C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/include" --include_path="C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/evmc6678l/.." --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/qmss" --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/cppi" --diag_warning=225 --abi=eabi --preproc_with_compile --preproc_dependency="platform_osal.pp" --cmd_file="./configPkg/compiler.opt"  "C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/platform_osal.c"

    'Finished building: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/platform_osal.c'

    ' '

    'Building file: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/resourcemgr.c'

    'Invoking: C6000 Compiler'

    "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/bin/cl6x" -mv6600 -g --include_path="C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/include" --include_path="C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/evmc6678l/.." --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/qmss" --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/cppi" --diag_warning=225 --abi=eabi --preproc_with_compile --preproc_dependency="resourcemgr.pp" --cmd_file="./configPkg/compiler.opt"  "C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/resourcemgr.c"

    'Finished building: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/resourcemgr.c'

    ' '

    'Building file: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/webpage.c'

    'Invoking: C6000 Compiler'

    "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/bin/cl6x" -mv6600 -g --include_path="C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/include" --include_path="C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/evmc6678l/.." --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/qmss" --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/cppi" --diag_warning=225 --abi=eabi --preproc_with_compile --preproc_dependency="webpage.pp" --cmd_file="./configPkg/compiler.opt"  "C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/webpage.c"

    'Finished building: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/webpage.c'

    ' '

    'Building target: client_evmc6678l.out'

    'Invoking: C6000 Linker'

    "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/bin/cl6x" -mv6600 -g --diag_warning=225 --abi=eabi -z -m"client_evmc6678l.map" --warn_sections -i"C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/lib" -i"C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/include" --reread_libs --rom_model -o "client_evmc6678l.out" -l"./configPkg/linker.cmd"  "./webpage.obj" "./resourcemgr.obj" "./platform_osal.obj" "./client.obj" -l"libc.a" 

    <Linking>

    'Finished building target: client_evmc6678l.out'

    ' '

    Steven Connell said:

    Hideo NORO,

    I tried to reproduce this problem and I was not able to, although I am using different hardware than you are.

    I also found that there is an existing bug that seems similar to this:

    SDOCM00054571 (Child) DSP crash on Reboot with a PPPoE server on NDK

    The bug report specifically mentions using a PPPoE connection.  Are you using PPPoE?

    Can you send the build output of your program? It should print out the libraries that are being linked.

    Thanks,

    Steve

     

  • Hideo,

    hmmm, I was hoping that output would give me a bit more information but that's ok.  Which version of the NDK are you using with the MCSDK?

    I have one idea for you to try because you actually are building with NDK libraries that have PPPoE code in them.  Can you try adding the following line of code to the end of your *.cfg file?

    var Global = xdc.useModule('ti.ndk.config.Global');

    Global.stackLibType = Global.NAT;

    Thanks,

    Steve

  • Hi, Steve,

    I'm using NDK which version is 2.20.4.26.

    And I rebuid (yes, run 'Clean Project' and delete 'Debug' folder, then run 'Build Project') the client project as you indicated,

    but couldn't get the executable.

    Some 'pppoeXXX' symbols are remain unresolved. This means that original sample what I compiled does not contain PPEOE code, doesn't it?

    Hmm, what causes this problem...

     

    Thanks,

    Hideo

    **** Build of configuration Debug for project client_evmc6678l ****

    C:\Program Files\Texas Instruments\ccsv5\utils\gmake\gmake -k all 

    'Building file: ../client.cfg'

    'Invoking: XDCtools'

    "C:/Program Files/Texas Instruments/xdctools_3_22_01_21/xs" --xdcpath="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages;C:/Program Files/Texas Instruments/ndk_2_20_04_26/packages;C:/Program Files/Texas Instruments/bios_6_32_04_49/packages;C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/demos;" xdc.tools.configuro -o configPkg -t ti.targets.elf.C66 -p ti.platforms.evm6678 -r debug -c "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4" "../client.cfg"

    making package.mak (because of package.bld) ...

    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...

    configuring client.pe66 from package/cfg/client_pe66.cfg ...

        will link with ti.ndk.config: ../lib/C66/miniPrintf.lib

        will link with ti.ndk.config: ../lib/C66/netctrl.lib

        will link with ti.ndk.config: ../lib/C66/nettool.lib

        will link with ti.ndk.config: ../lib/C66/os.lib

        will link with ti.ndk.config: ../lib/C66/hal/hal_ser_stub.lib

        will link with ti.ndk.config: ../lib/C66/hal/hal_timer_bios.lib

        will link with ti.ndk.config: ../lib/C66/hal/hal_userled_stub.lib

        will link with ti.ndk.config: ../lib/C66/hal/hal_eth_stub.lib

        will link with ti.ndk.config: ../lib/C66/cgi.lib

        will link with ti.ndk.config: ../lib/C66/console.lib

        will link with ti.ndk.config: ../lib/C66/hdlc.lib

        will link with ti.ndk.config: ../lib/C66/servers.lib

        will link with ti.ndk.config: ../lib/C66/all_stk/stk6_nat.lib

    cle66 package/cfg/client_pe66.c ...

    'Finished building: ../client.cfg'

    ' '

    'Building file: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/client.c'

    'Invoking: C6000 Compiler'

    "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/bin/cl6x" -mv6600 -g --include_path="C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/include" --include_path="C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/evmc6678l/.." --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/qmss" --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/cppi" --diag_warning=225 --abi=eabi --preproc_with_compile --preproc_dependency="client.pp" --cmd_file="./configPkg/compiler.opt"  "C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/client.c"

    'Finished building: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/client.c'

    ' '

    'Building file: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/platform_osal.c'

    'Invoking: C6000 Compiler'

    "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/bin/cl6x" -mv6600 -g --include_path="C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/include" --include_path="C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/evmc6678l/.." --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/qmss" --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/cppi" --diag_warning=225 --abi=eabi --preproc_with_compile --preproc_dependency="platform_osal.pp" --cmd_file="./configPkg/compiler.opt"  "C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/platform_osal.c"

    'Finished building: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/platform_osal.c'

    ' '

    'Building file: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/resourcemgr.c'

    'Invoking: C6000 Compiler'

    "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/bin/cl6x" -mv6600 -g --include_path="C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/include" --include_path="C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/evmc6678l/.." --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/qmss" --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/cppi" --diag_warning=225 --abi=eabi --preproc_with_compile --preproc_dependency="resourcemgr.pp" --cmd_file="./configPkg/compiler.opt"  "C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/resourcemgr.c"

    'Finished building: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/resourcemgr.c'

    ' '

    'Building file: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/webpage.c'

    'Invoking: C6000 Compiler'

    "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/bin/cl6x" -mv6600 -g --include_path="C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/include" --include_path="C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/evmc6678l/.." --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/qmss" --include_path="C:/Program Files/Texas Instruments/pdk_C6678_1_0_0_15/packages/ti/drv/cppi" --diag_warning=225 --abi=eabi --preproc_with_compile --preproc_dependency="webpage.pp" --cmd_file="./configPkg/compiler.opt"  "C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/webpage.c"

    'Finished building: C:/Program Files/Texas Instruments/mcsdk_2_00_03_15/examples/ndk/client/webpage.c'

    ' '

    'Building target: client_evmc6678l.out'

    'Invoking: C6000 Linker'

    "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/bin/cl6x" -mv6600 -g --diag_warning=225 --abi=eabi -z -m"client_evmc6678l.map" --warn_sections -i"C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/lib" -i"C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.2.4/include" --reread_libs --rom_model -o "client_evmc6678l.out" -l"./configPkg/linker.cmd"  "./webpage.obj" "./resourcemgr.obj" "./platform_osal.obj" "./client.obj" -l"libc.a" 

    <Linking>

     

     undefined      first referenced                                                                                   

      symbol            in file                                                                                        

     ---------      ----------------                                                                                   

     pppoeFree      C:\Program Files\Texas Instruments\ndk_2_20_04_26\packages\ti\ndk\lib\C66\console.lib<console.oe66>

     pppoeGetStatus C:\Program Files\Texas Instruments\ndk_2_20_04_26\packages\ti\ndk\lib\C66\console.lib<console.oe66>

     pppoeNew       C:\Program Files\Texas Instruments\ndk_2_20_04_26\packages\ti\ndk\lib\C66\console.lib<console.oe66>

     pppoesFree     C:\Program Files\Texas Instruments\ndk_2_20_04_26\packages\ti\ndk\lib\C66\console.lib<console.oe66>

     pppoesNew      C:\Program Files\Texas Instruments\ndk_2_20_04_26\packages\ti\ndk\lib\C66\console.lib<console.oe66>


    error: unresolved symbols remain

    error: errors encountered during linking; "client_evmc6678l.out" not built

     

    >> Compilation failure

    gmake: *** [client_evmc6678l.out] Error 1

    gmake: Target `all' not remade because of errors.

     

     

    Steven Connell said:

    Hideo,

    hmmm, I was hoping that output would give me a bit more information but that's ok.  Which version of the NDK are you using with the MCSDK?

    I have one idea for you to try because you actually are building with NDK libraries that have PPPoE code in them.  Can you try adding the following line of code to the end of your *.cfg file?

    var Global = xdc.useModule('ti.ndk.config.Global');

    Global.stackLibType = Global.NAT;

    Thanks,

    Steve

     

  • Hideo,

    I am trying to reproduce the problem you are seeing here.  I will get back to you as soon as I have some more information.

    Thanks,

    Steve

  • Seteve,

    I'm looking forward to hear good news!

    Thanks,

    Hideo

     

  • Hideo,

    I just wanted to update you that I'm definitely seeing a problem here.  We are currently investigating it.  I'll update you when I know more.

    Thanks,

    Steve

  • Steve,

    I forgot to inform you that I use 'XDS560v2 STM' JTAG emulator to debug with CCS5.

    The connection type is via ethernet (IPv4).

    Thanks,

    Hideo

  • Hideo,

    The MCUSDK team has been able to reproduce this and have file a bug for it which they will fix in the next MCUSDK release.

    SDOCM00085799 - Assertion failure is seen, when shutting down a telnet connection to evm

    Steve

  • Steve,

    GOOOOD News!

    Thank you!

    Hideo