Fixes are available
XL C/C++ for Linux Fix Pack 9 (August 2013 Update) for 11.1
July 2011 Update for XL C/C++ for Linux, V11.1
October 2011 Update for XL C/C++ for Linux, V11.1
June 2012 Update for XL C/C++ for Linux, V11.1
October 2012 Update for XL C/C++ for Linux, V11.1
XL C/C++ for Linux Fix Pack 8 (June 2013 Update) for 11.1
APAR status
Closed as program error.
Error description
A segmentation fault is encountered at -O3 optimization whe runnning a test case that contains a nested loop. ==== Test case: test.c: #include <stdlib.h> #include <stdio.h> typedef struct { void *params; } Temp; void * get_params(Lattice *lat) { return lat->params; } void get_loop(Temp *lat, int x[], int nd, int index) { void *p = get_params(lat); for(int i=0; i<nd; i++) { x[i] = index; } } void CreateNestedBlock(int nd, Lattice *lat) { for(int b=0; b<2; b++) { int xf[nd]; for(int j=0; j<1; j++) { get_loop(lat, xf, nd, j); } } } int main(int argc, char *argv[]) { int ndim = 4; Temp lat; lat.params = NULL; printf("starting\n"); CreateNestedBlock(ndim, &lat); printf("done\n"); return 0; } ==== Observed Output: $ xlc -O3 test.c staring Segmentation fault $
Local fix
Use a lower optimization level.
Problem summary
PROBLEM DESCRIPTION: Segmentation fault at -O3 when returning from a function. USERS AFFECTED: Users of optimization levels -O3 or higher.
Problem conclusion
Intermediate generated code was incorrectly moved outside of an internal optimized loop. Resulting in the corruption of the return address of the function. This fix involves ensuring that this particular block of code is not moved outside of the loop.
Temporary fix
Comments
APAR Information
APAR number
LI76292
Reported component name
XL C/C++ FOR LI
Reported component ID
5724X1400
Reported release
B10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2011-07-12
Closed date
2011-07-12
Last modified date
2011-07-12
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XL C/C++ FOR LI
Fixed component ID
5724X1400
Applicable component levels
RB10 PSY
UP
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSXVZZ","label":"XL C\/C++ for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"B10","Line of Business":{"code":"LOB57","label":"Power"}}]
Document Information
Modified date:
16 October 2021