S
Subha
Hi All,
I'm facing a problem with malloc. I have a program which opens a file
to write something using ofstream.
I used to run more than a process same time and in that case one of the
process get stucked in malloc.
ofstream* _file ;
_file = NULL ;
if(access("filename", 0) == 0)
{
cout << "File already exists" ;
return ;
}
_file = new ofstream("filename", ios::trunc) ;
if(!_file->good)
{
stderr("Error in file open") ;
}
The process get stucked during the "new ofstream".
I'm working in unix. I tried mcheck/mtrace and many other, but still
can;t solve it.
The process stack is:
Thread 1 (Thread 182905645888 (LWP 29543)):
#0 0x0000002a95d91713 in _int_malloc () from /lib64/tls/libc.so.6
#1 0x0000002a95d905d2 in malloc () from /lib64/tls/libc.so.6
#2 0x0000002a95a54da5 in operator new () from
/usr/lib64/libstdc++.so.5
#3 0x0000000000436305 in MyFile:penFile ()
Can anybody help in this regard?
Thanks,
Subha
I'm facing a problem with malloc. I have a program which opens a file
to write something using ofstream.
I used to run more than a process same time and in that case one of the
process get stucked in malloc.
ofstream* _file ;
_file = NULL ;
if(access("filename", 0) == 0)
{
cout << "File already exists" ;
return ;
}
_file = new ofstream("filename", ios::trunc) ;
if(!_file->good)
{
stderr("Error in file open") ;
}
The process get stucked during the "new ofstream".
I'm working in unix. I tried mcheck/mtrace and many other, but still
can;t solve it.
The process stack is:
Thread 1 (Thread 182905645888 (LWP 29543)):
#0 0x0000002a95d91713 in _int_malloc () from /lib64/tls/libc.so.6
#1 0x0000002a95d905d2 in malloc () from /lib64/tls/libc.so.6
#2 0x0000002a95a54da5 in operator new () from
/usr/lib64/libstdc++.so.5
#3 0x0000000000436305 in MyFile:penFile ()
Can anybody help in this regard?
Thanks,
Subha