Fixed
Created: Jul 9, 2015
Updated: Sep 8, 2018
Resolved Date: Sep 1, 2015
Found In Version: 7.0
Fix Version: 7.0.0.9
Severity: Severe
Applicable for: Wind River Linux 7
Component/s: Toolchain
On p2020 baord, customer found a toolchain issue, have located glibc strcmp returns 0 (equal) when the strings are not really equal, it's a simliar issue with LIN5-11963
It have been fixed in wrlinux 4.3 and wrlinux 5.0, but I did not find the fix log in wrlinux 6.0
compile the following codes with -O2 parameter, it will show some error info:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define PAGESIZE 4096
#define S1 "_ZN25CPrintServiceLOAValuesSeqD0Ev"
#define S2 "_ZN25CMachineConfigInstanceMgr11InstantiateEPKc"
int main( int argc, char *argv[] )
{
char *buffer1 = (char*)valloc(PAGESIZE*2);
char *buffer2 = (char*)valloc(PAGESIZE*2);
int i, j;
for( i = 1; i < PAGESIZE+1024; i++ )
{
buffer1[i-1] = '\0';
strcpy( buffer1+i, S1 );
for( j = 1; j < PAGESIZE+1024; j++ )
{
buffer2[j-1] = '\0';
strcpy( buffer2+j, S2 );
if( strcmp( buffer1+i, buffer2+j ) == 0 )
{
printf( "error on: %d, %d\n", i, j );
fflush( stdout );
}
}
}
return 0;
}