Segmentation violation error at compilation on QNX

Let's say the following error occurs when you compile a model on QNX :

 "ntox86-gcc-3.3.5: Internal error: segmentation violation (program cc1)"

  This is due to a problem of allocated RAM for gcc compiler which is not large enough. In such case, it is recommended to try increasing the heap size on the compilation node by running the following command :

# ldrel -L -S 4096000 /usr/qnx630/host/qnx6/x86/usr/bin/ntox86-gcc-3.3.5
 

If the error is still present then iy means that the c file to be compiled is too large, even after having increased the gcc stack size. In that case, the next option is to remove the optimization flags O2 by modifiying the file qnxto.opt (located in C:\Opal-rt\RT-LAB8.3.6\simulink\rtw\c\common). See the attached file that does not contain the call to optimizer O2.

 The computation time should be a little higher (a few microseconds) but the computation accuracy is the same.

 

Keywords : segmentation, violation, cc1, gcc, stack

qnxnto.opt - Modified files wihout optimizer O2