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.

cg55 v4.3.8 c55x Segmentation fault on 2d array initialization with a total size above 0x8000.



Using: TMS320C55x C/C++ Compiler               v4.3.8

$ echo "int a[2][0x4000] = {{0},{0}};" > test.c ; cl55 test.c

INTERNAL ERROR: cg55 experienced a segmentation fault while
                processing function <unknown>

This is a serious problem.  Please contact Customer
Support with this message and a copy of the input file
and help us to continue to make the tools more robust.

>> Compilation failure

  • Well, this is the most efficient defect report I've ever seen, thanks for that!

    It is always a bug for the compiler to get a segmentation fault, but be aware that that array is really pushing the limits of small model (it is of size 0x8000 16-bit words), so we may not be able to produce reasonable assembly code.

    I've submitted SDSCM00040615 to track this issue.

  • Archaeologist said:

    Well, this is the most efficient defect report I've ever seen, thanks for that!

     Well I was surprised it boiled down to this small code! No matter what compile options I tried, it just segfaults. So cl55 is enough

    Archaeologist said:

    It is always a bug for the compiler to get a segmentation fault, but be aware that that array is really pushing the limits of small model (it is of size 0x8000 16-bit words), so we may not be able to produce reasonable assembly code.

    I've submitted SDSCM00040615 to track this issue.

    Oh, but having no init works. So the size is not a problem, trying large model also does not help.

    Even better:

    echo "int a[3][0x3000] = {{0},{0}};" > test.c ; cl55 test.c

    This consumes more memory but does NOT segfault! So it is not simply size or init code.

    I only tested a very old version and it does handle this case correct (v2.56). So it is also a degradation.