K
Keith
Hi. Was hoping somebody could try and compile this on their SGI system and see
if it cores. If it cores, comment out the strcpy, and it will work. Or change
256->32 and it will work.
To compile: (not sure if the -D_POSIX_C_SOURCE=199506L is necessary)
cc -D_POSIX_C_SOURCE=199506L -o test test.c -lpthread
/********** test.c *******/
#include <pthread.h>
#include <stdio.h>
#include <string.h>
void* test_func( void* );
int main() {
pthread_t test_thread ;
pthread_create( &test_thread, NULL, test_func, NULL) ;
pthread_join( test_thread, (void**)NULL);
return 0 ;
}
void* test_func( void* silly ) {
typedef struct {
char str[1000] ;
} MY_TEST ;
MY_TEST my_test[256];
if ( 0 ) {
strcpy( my_test[0].str, "Mooo" ) ;
}
fprintf(stderr, "Meow\n");
return ((void*)NULL) ;
}
/***** end test.c ****/
if it cores. If it cores, comment out the strcpy, and it will work. Or change
256->32 and it will work.
To compile: (not sure if the -D_POSIX_C_SOURCE=199506L is necessary)
cc -D_POSIX_C_SOURCE=199506L -o test test.c -lpthread
/********** test.c *******/
#include <pthread.h>
#include <stdio.h>
#include <string.h>
void* test_func( void* );
int main() {
pthread_t test_thread ;
pthread_create( &test_thread, NULL, test_func, NULL) ;
pthread_join( test_thread, (void**)NULL);
return 0 ;
}
void* test_func( void* silly ) {
typedef struct {
char str[1000] ;
} MY_TEST ;
MY_TEST my_test[256];
if ( 0 ) {
strcpy( my_test[0].str, "Mooo" ) ;
}
fprintf(stderr, "Meow\n");
return ((void*)NULL) ;
}
/***** end test.c ****/