Here's the symptom:
./teal_vout.cpp: (set_file_and_line:631) test_component_0 thread(0x44606960) vout(0x2109718) [FILE: truss/trunk/cpp/inc/truss_test_component.h][line: 70] begin
... ... ...
./teal_vout.cpp: (set_file_and_line:631) test_component_0 thread(0x40A00960) vout(0x2109718) [FILE: ./test_component.cpp][line: 92] begin
... ... ...
=> crashed
Here's the reason:
- Thread test_component_0 is with ID(0x44606960)
- Thread verification_top is with ID(0x40A00960)
- vout(0x2109718) is constructed by thread(0x40A00960) with test_component_0 as its function_area_ name
However, before it was finished with teal::vout::end_message_() at thread(0x44606960), a new message to the same vout(0x2109718) was issued. It was called from "truss::verification_top::test_0->wait_for_completion ()", which calls "lls::test_component_[0]->wait_for_completion ()", which calls "truss::test_component.wait_for_completion()", which calls "lls::test_component::wait_for_completion_()" at thread (0x40A00960).
As a result, the message_list_ and the other maps of teal::vout got polluted. Sometime, it will end up with a "glibc detected double free or corruption error", which crashed the simulation.
And, here's my solution:
- remove internal_mutex_sentry() from teal::vout::put_message()
- put a pthread_mutex_lock() at teal::vout::set_file_and_line()
- put a pthread_mutex_unlock() at teal::vout::clear_message_()
沒有留言:
張貼留言