Mario Charest
|
crash under 6.3.2 but not 6.4.1
|
Mario Charest
06/19/2009 11:58 AM
post32134
|
crash under 6.3.2 but not 6.4.1
The following program will crash under 6.3.2. The backtrace always looks like:
_list_release()
_prelocked_free()
__free()
free()
delete()
~facet() xlocale
~locale() xlocale
std::basic_ios<char.....> widen(char)
endl<....>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <sstream>
#include <pthread.h>
#define NUM 4
bool dye = false;
int count=0;
void *spitOutThread(void *arg)
{
std::stringstream myStream;
try
{
for(;dye != true ;)
{
myStream << "this is a test" << std::endl;
myStream.str("");
++count;
}
}
catch (...)
{
printf("What?\n");
}
return NULL;
}
int main(void) {
int id[NUM];
for( int i=0; i< NUM; ++i)
pthread_create( &id[i], NULL, spitOutThread, NULL );
sleep(5);
dye = true;
sleep(1);
return 0;
}
|
|
|