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: INTERNAL ERROR: C:\ti\ccsv5\tools\compiler\c6000_7.4.24\bin\cg6x.exe experienced a segmentation fault

Tool/software: TI C/C++ Compiler

Hi, 

I have been having the following error when compiling one of our projects for C6657:

INTERNAL ERROR: C:\ti\ccsv5\tools\compiler\c6000_7.4.24\bin\cg6x.exe experienced a segmentation fault

I have not had the issue before, but it started happening recently.  I suspect it is because some changes to our source code, maybe #inlcude got too deep, etc.

  • I have tried compier 7.4.24, 7.4.23 and 7.4.2, but none worked.
  • The strange thing is, the problem doesn't occur on other PCs.  We use the same compiler, but somehow the problem seems to occur only my PC.
  • Disabling the optimization works around the issue (originally set to 3, setting to off works around the issue).

I tried to create a minimum set of files which exhibits the issue, but this is a part of a large project, so it is very difficult.

Do you have any ides what is going on? Or do you know of any way to work around the issue?

  • The 7.4.x series of releases has gone inactive.  That is, we do not plan any further releases, so we have stopped adding fixes.  Why do you continue to use 7.4.x?  Is it practical for you to upgrade to a current release?  It would be ideal if you could upgrade to the latest, which is version 8.2.3.  To obtain the latest release, please visit the page Code Generation Tools for TI processors and microcontrollers.  

    Thanks and regards,

    -George

  • We will not change the compiler any time soon since we have validated our products based on the old compiler.

    George Mock said:
    It would be ideal if you could upgrade to the latest, which is version 8.2.3

    I have tired the new compiler locally, and it doesn't cause my original issue, but had another error:

     error #2640: Object size 18446744071562067968 is greater than maximum supported size 4294967295

    on this line:

    typedef struct {
      volatile Uint32 Data[0x10000000>>2];
    } PCIE_DATA;

    We use PCIE_DATA to access PCIe mapped data through a pointer (we don't allocate object).

    Since we are not upgrading the compiler anyway, I don't need this to be fixed.

  • tamo2 said:
     error #2640: Object size 18446744071562067968 is greater than maximum supported size 4294967295

    This is a known limitation in the compiler.  There is a request filed to make it bigger, but I am unable to find it right now.

    Thanks and regards,

    -George

  • George Mock said:
    There is a request filed to make it bigger, but I am unable to find it right now.

    I think the request is CODEGEN-4042, raised in response to Compiler/EVMK2H: Why does the C6000 v8.2.2 compiler truncate the size of objects >= 512Mbyte ?

    However, the PCIE_DATA structure in the example in this thread is only 256 Mbytes and so expected it not to exceed the maximum size.

    When using C6000 TI v8.2.3 compiler the following:

    typedef struct {
      volatile uint32_t Data[0x10000000>>2];
    } PCIE_DATA;
    
    const volatile size_t PCIE_DATA_size = sizeof (PCIE_DATA);

    Results in the error:

    "../main.c", line 14 (col. 21): error #2640: Object size 18446744071562067968 is greater than maximum supported size 4294967295

    Whereas the following compiles:

    //typedef struct {
      volatile uint32_t Data[0x10000000>>2];
    //} PCIE_DATA;
    
    const volatile size_t PCIE_DATA_size = sizeof (Data);

    Is it correct that the maximum size of a field in a structure is different to the maximum size of an array?

  • For a struct that contains a single array (and the alignment of the elements of that array are at least as strict as the default struct alignment), the array and struct should be of exactly the same size. The issue here is that while the compiler is mishandling the size of the object in both cases, it fails to emit the error message in the second case.

    I was mistaken.  The size of the object in this example is under the limit; there should be no error.  It is due to a bug in the tools that this error is reported. 

    I've filed CODEGEN-4678 to track this issue.

    [Edited to correct my mistake -- Archaologist]

  • As a workaround, remove the typedef and give the struct a tag.
  • Regarding the source file that is being compiled when this occurs ...

    tamo2 said:
    INTERNAL ERROR: C:\ti\ccsv5\tools\compiler\c6000_7.4.24\bin\cg6x.exe experienced a segmentation fault

    I'd appreciate if we could get a test case as described in the article How to Submit a Compiler Test Case.  Even though it probably will not crash on our system, there are tools we can use to look for problems.  I suspect we will find something.  What happens next is hard to say.  We may be able to give you a workaround.  We may find the problem is also present in version 8.2.x, in which case we would fix it.  Or something like that.

    Thanks and regards,

    -George

  • Hi George,

    The problem occurs when building a huge project so it will be very difficult to make a test case and if I trim down the project, then the problem may go away.

    So far, my PC is the only one having the issue among ~10 PCs, and I have a work around (turning off optimization), so it is not a huge issue at this moment.

    At some point in the future, we may upgrade the compiler altogether, then it will not be an issue anymore.

    So I don't think we need any further action on this issue.

    Thanks for the help and quick response.
    tamo2