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.

TDA4VM: C7000-CGT Internal Error Compiler experienced a segmentation fault

Part Number: TDA4VM

Hi Ti,

I have following code:

#include <stdarg.h>  // For va_start, etc.
#include <string>

//std::string Ibg::Diag::StringHelper::StringFormat(const std::string fmt, ...)
std::string StringFormat(const std::string fmt, ...)
{
    int size = ((int)fmt.size()) * 2 + 50;   // Use a rubric appropriate for your code
    std::string str;
    va_list ap;
    while (1) {     // Maximum two passes on a POSIX system...
        str.resize(size);
        va_start(ap, fmt);
        int n = vsnprintf((char *)str.data(), size, fmt.c_str(), ap);
        va_end(ap);
        if (n > -1 && n < size) {  // Everything worked
            str.resize(n);
            return str;
        }
        if (n > -1)  // Needed size returned
            size = n + 1;   // For null char
        else
            size *= 2;      // Guess at a larger size (OS specific)
    }
    //return str;
    return "foobar";
}

I invoke the C7000 with following options:

/home/thomas/tda4vmx/psdk/ti-cgt-c7000_3.0.0.STS/bin/cl7x --compile_only --cpp_file=/home/thomas/workspace_v9_j721e/PCIe_SharedCode/src/diag/StringFormat.cpp -DBUILD_MCU2_0 -DC7X -DFREERTOS -DRTOS_ENV -DSOC_J721E -Dj721e_evm --include_path=/home/thomas/tda4vmx/psdk/ti-cgt-c7000_3.0.0.STS/include --include_path=/home/thomas/tda4vmx/psdk/ti-cgt-c7000_3.0.0.STS/include/libcxx --silicon_version=7100 --endian=little --quiet --silicon_errata_i2117 --display_error_number --diag_suppress=238 --diag_suppress=880 --diag_suppress=1110 --gen_func_subsections=on --exceptions --verbose --symdebug:none --opt_level=3 --output_file=CMakeFiles/MemCommunication.dir/src/diag/StringFormat.cpp.o
C7x C/C++ Compiler                      v3.0.0.STS
Copyright (c) 2014-2019 Texas Instruments Incorporated
"/home/thomas/workspace_v9_j721e/PCIe_SharedCode/src/diag/StringFormat.cpp", line 30: warning #112-D: statement is unreachable

INTERNAL ERROR: /home/thomas/tda4vmx/psdk/ti-cgt-c7000_3.0.0.STS/bin/acpia7x experienced a segmentation fault
                  while processing function (unknown or file scope) file (unknown) line 0

This is caused by a defect in the TI EABI C/C++ Parser.
TI Customer Support may be able to suggest a workaround to avoid this.

Upgrading to the newest version of the compiler may fix this problem.

Contact TI in the E2E support forums at http://e2e.ti.com under
"Development Tools", "TI C/C++ Compiler".  See the link titled
"Submitting an issue".

We need to see this ENTIRE error message and a complete, reproducible
test case including ALL of the command-line options.
Include the .pp file created by option --preproc_with_comment


>> Compilation failure

Which results in the above pasted error message.

Is there a problem with the compiler? Is there a workaround possible?

Best regards,
Thomas