From: Xiaolei H. <xh...@sc...> - 2003-06-01 02:13:17
|
Hi, all, When I tried the valgrind with my problem, the valgrind always gets = crashed with a "segmentation fault" as soon as I perfomed a particular = operation.=20 However, the program doesn't crash itself if it runs alone. I highly = suspect=20 something wrong with my problem, I just don't know what it is. The last=20 three pieces of valgrind commentary are interesting. Here they are: =3D=3D24934=3D=3D Thread 23: =3D=3D24934=3D=3D Invalid read of size 4 =3D=3D24934=3D=3D at 0x842E800: PThread::PX_ThreadEnd(void*) = (tlibthrd.cxx:1054) =3D=3D24934=3D=3D by 0x4027D836: _pthread_cleanup_pop = (vg_libpthread.c:844) =3D=3D24934=3D=3D by 0x842E7E5: PThread::PX_ThreadStart(void*) = (tlibthrd.cxx:1045) =3D=3D24934=3D=3D by 0x4027D41C: thread_wrapper = (vg_libpthread.c:671) =3D=3D24934=3D=3D Address 0x4017E9FA4 is 40 bytes inside a block of = size 141 free'd =3D=3D24934=3D=3D at 0x4015E5A5: free (vg_clientfuncs.c:185) =3D=3D24934=3D=3D by 0x8442CCE: PMemoryHeap::Deallocated(void*, char = const*) (../common/object.cxx:647) =3D=3D24934=3D=3D by 0x831A62B: H225TransportThread::operator = delete(void*) (transports.cxx:466) =3D=3D24934=3D=3D by 0x8318D22: = H225TransportThread::~H225TransportThread() = (/usr/include/c++/3.2/iostream:62) =3D=3D24934=3D=3D=20 =3D=3D24934=3D=3D Thread 23: =3D=3D24934=3D=3D Invalid read of size 4 =3D=3D24934=3D=3D at 0x842E80B: PThread::PX_ThreadEnd(void*) = (tlibthrd.cxx:1054) =3D=3D24934=3D=3D by 0x4027D836: _pthread_cleanup_pop = (vg_libpthread.c:844) =3D=3D24934=3D=3D by 0x842E7E5: PThread::PX_ThreadStart(void*) = (tlibthrd.cxx:1045) =3D=3D24934=3D=3D by 0x4027D41C: thread_wrapper = (vg_libpthread.c:671) =3D=3D24934=3D=3D Address 0xA5A5A609 is not stack'd malloc'd or = free'd =3D=3D24934=3D=3D=20 =3D=3D24934=3D=3D Thread 23: =3D=3D24934=3D=3D Jump to the invalid address stated on the next line =3D=3D24934=3D=3D at 0x0: ??? =3D=3D24934=3D=3D by 0x4027D836: _pthread_cleanup_pop = (vg_libpthread.c:844) =3D=3D24934=3D=3D by 0x842E7E5: PThread::PX_ThreadStart(void*) = (tlibthrd.cxx:1045) =3D=3D24934=3D=3D by 0x4027D41C: thread_wrpper (vg_libpthread.c:671) =3D=3D24934=3D=3D Address 0x0 is not stack'd, malloc'd or free'd I do understand, based on section 2.4 of valgrind documentation, that if = "your=20 program attemps to read from address zero, the skin will emit a message = to=20 this effect, and the program will then duly die with a segmentation = fault". What=20 I don't understand is that why my program doesn't crash itself when it = is running alone. What should I do to get it working? Your advice is highly = appreciated. Lei |