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.

Compiler/EVMK2H: Assertion failed: otype->is_func() || size == otype->size() from C6000 CGT TI v8.2.5

Part Number: EVMK2H

Tool/software: TI C/C++ Compiler

The attached project was created to attempt to instigate the heap issue in RTOS/AM5728: memory_alloc fails with 1GB but not with 1GB-128B ?

The project was created using:

- CCS 8.3.0.00009

- SYS/BIOS 6.73.1.01

- XDCtools 3.51.1.18_core

- C6000 CGT v8.2.5

When compiled with the SYS/BIOS Build-profile to release the compile fails with an assertion failure:

**** Clean-only build of configuration Debug for project typical_TCI6638K2K_C66XX ****

"C:\\ti\\ccs830\\ccsv8\\utils\\bin\\gmake" -k -j 12 clean -O 
 
cleaning ../src/sysbios ...
DEL /F  "typical_TCI6638K2K_C66XX.hex"  "configPkg\linker.cmd" "configPkg\compiler.opt"  "typical_TCI6638K2K_C66XX.out" 
DEL /F "main.obj" 
DEL /F "main.d" 
RMDIR /S/Q  "configPkg\" 
Could Not Find C:\Users\mr_halfword\workspace_v8\typical_TCI6638K2K_C66XX\Debug\typical_TCI6638K2K_C66XX.hex
Could Not Find C:\Users\mr_halfword\workspace_v8\typical_TCI6638K2K_C66XX\Debug\typical_TCI6638K2K_C66XX.out
Finished clean
 

**** Build Finished ****

**** Build of configuration Debug for project typical_TCI6638K2K_C66XX ****

"C:\\ti\\ccs830\\ccsv8\\utils\\bin\\gmake" -k -j 12 all -O 
 
Building file: "../app.cfg"
Invoking: XDCtools
"C:/ti/ccs830/xdctools_3_51_01_18_core/xs" --xdcpath="C:/ti/bios_6_73_01_01/packages;" xdc.tools.configuro -o configPkg -t ti.targets.elf.C66 -p ti.platforms.evmTCI6638K2K -r release -c "C:/ti/ccs830/ccsv8/tools/compiler/ti-cgt-c6000_8.2.5" --compileOptions "-g" "../app.cfg"
making package.mak (because of package.bld) ...
generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
configuring app.xe66 from package/cfg/app_pe66.cfg ...
generating custom ti.sysbios library makefile ... 
Starting build of library sources ...
making C:/Users/mr_halfword/workspace_v8/typical_TCI6638K2K_C66XX/src/sysbios/sysbios.ae66 ...
cle66 C:/ti/bios_6_73_01_01/packages/ti/sysbios/BIOS.c ...
asme66 C:/ti/bios_6_73_01_01/packages/ti/sysbios/family/c64p/Exception_asm.s64P ...
asme66 C:/ti/bios_6_73_01_01/packages/ti/sysbios/family/c64p/Hwi_asm.s62 ...
asme66 C:/ti/bios_6_73_01_01/packages/ti/sysbios/family/c64p/Hwi_asm_switch.s62 ...
asme66 C:/ti/bios_6_73_01_01/packages/ti/sysbios/family/c64p/Hwi_disp_always.s64P ...
asme66 C:/ti/bios_6_73_01_01/packages/ti/sysbios/rts/ti/tls_get_tp.asm ...
asme66 C:/ti/bios_6_73_01_01/packages/ti/sysbios/family/c62/TaskSupport_asm.s62 ...
asme66 C:/ti/bios_6_73_01_01/packages/ti/sysbios/timers/timer64/Timer_asm.s64P ...
are66 BIOS.obj c64p_Exception_asm.obj c64p_Hwi_asm.obj c64p_Hwi_asm_switch.obj c64p_Hwi_disp_always.obj ti_tls_get_tp.obj c62_TaskSupport_asm.obj timer64_Timer_asm.obj ...
Build of libraries done.
cle66 package/cfg/app_pe66.c ...
 
>> Compilation failure
subdir_rules.mk:12: recipe for target 'build-572158591-inproc' failed
Assertion failed: otype->is_func() || size == otype->size(), file c:\jenkins\workspace\buildtoolsmega_buildworker\cgt\master\opt5\types.h, line 264
gmake.exe: *** [package/cfg/app_pe66.mak:18: package/cfg/app_pe66.oe66] Error 1
js: "C:/ti/ccs830/xdctools_3_51_01_18_core/packages/xdc/tools/Cmdr.xs", line 52: Error: xdc.tools.configuro: configuration failed due to earlier errors (status = 2); 'linker.cmd' deleted.
gmake[1]: *** [build-572158591-inproc] Error 1
gmake: *** No rule to make target 'build-572158591', needed by 'configPkg/compiler.opt'.
gmake: *** No rule to make target 'build-572158591', needed by 'configPkg/linker.cmd'.
gmake: Target 'all' not remade because of errors.

**** Build Finished ****

If the SYS/BIOS Build-profile is changed to debug then the projects compiles and links without error, but gets warnings (since I hadn't completed the required code changes).

From a quick search I think the "Assertion failed: otype->is_func() || size == otype->size()" might be a bug in the code generation tools.

typical_TCI6638K2K_C66XX.zip

  • Thank you for notifying us of this problem, and for submitting a test case.  I can reproduce the same behavior.  I filed the entry CODEGEN-5914 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    I discovered that compiler version 8.3.1 does not have this problem.  If it is practical, please consider upgrading.

    Thanks and regards,

    -George

  • George Mock said:
    I discovered that compiler version 8.3.1 does not have this problem. 

    I confirm that building with v8.3.2 doesn't show the problem.

    George Mock said:
    I filed the entry CODEGEN-5914 in the SDOWP system to have this investigated. 

    CODEGEN-5914 doesn't appear to be publicly visible.

  • The specific bug is that the BIOS code defines an array of 0x80000000 bits, and there's a 32-bit variable in the compiler that is signed when it should be unsigned.  0x80000000 steps on the sign bit and causes the assertion failure.

    CGT 8.3.x thoroughly reworked that code, part of improving/fixing support for very large objects, and does not have the bug.

    A workaround is to reduce the size of the array, but I'm not sure how you would do that through your project.

  • pf said:
    A workaround is to reduce the size of the array, but I'm not sure how you would do that through your project.

    Thanks for the explanation about CODEGEN-5914.

    The project had configured SYS/BIOS to allocate space for a heap by creating an array of the specified size. A work-around is to configure SYS/BIOS to allocate the required heap size by defining linker symbols for the start and end addresses of the heap, i.e. avoids the need for compiler support of very large objects.

    An example project with that work-around is attached to https://e2e.ti.com/support/processors/f/791/p/770718/2859032#2859032