KMLM List
View email archives for the history of this mailing list.
|
|
|
|
systemc-forum - Possible causes of segfault during writes to an sc_buffer
|
Message Thread:
Previous |
Next
|
- To: "systemc-forum@xxxxxxxxxxxxxxxxx" <systemc-forum@xxxxxxxxxxxxxxxxx>
- From: "Czajkowski, Greg" <greg.czajkowski@xxxxxxxxx>
- Date: Thu, 11 Nov 2010 16:12:00 -0800
- Send Email to systemc-forum@lists.systemc.org:
- Send new message
- Reply to this message
|
Hi, I am looking for causes of a seg fault happening when writing an sc_buffer
the second sc_start(1) ... (SC_SIGNAL_WRITE_CHECK=DISABLE does not cause a
segfault)
The segfault happens because sc_signal_invalid_writer is dereferencing a
pointer whose memory has been deleted.
Here is how it looks like in Valgrind
==8081== at 0xB8EC7B2: sc_core::sc_object::name() const (sc_object.h:80)
==8081== by 0xB91B051:
sc_core::sc_signal_invalid_writer(sc_core::sc_object*, sc_core::sc_object*,
sc_core::sc_object*) (sc_signal.cpp:122)
123 const char* writer1_kind = first_writer->kind(); // first_writer
has already been deleted
==8081== by 0xC6DA918: sc_core::sc_buffer<bool>::write(bool const&)
(sc_buffer.h:159)
154 {
155 sc_object* writer = sc_get_curr_simcontext()->get_current_writer();
156 if( sc_signal<T>::m_writer == 0 ) {
157 sc_signal<T>::m_writer = writer;
158 } else if( sc_signal<T>::m_writer != writer ) {
159 sc_signal_invalid_writer( this, sc_signal<T>::m_writer, writer
); //This sc_signal<T>::m_writer is bogus and has been already deleted.
160 }
==8081== by 0xC6C606F: sc_core::sc_buffer<bool>::operator=(bool const&)
(sc_buffer.h:124)
==8081== by 0xC6C6099: top::main_loop() (top.h:327)
bool localClk = true;
pclk = localClk; //SEG FAULT HERE
==8081== by 0xC6C4825: checker_step (main_cte.cpp:126)
126 Top->main_loop();
127 sc_start(1);
==8081== Address 0x3589c880 is 16 bytes inside a block of size 304 free'd
==8081== at 0x4B1F76E: operator delete(void*) (vg_replace_malloc.c:346)
==8081== by 0xB908B9D: sc_core::sc_thread_process::~sc_thread_process()
(sc_thread_process.cpp:252)
==8081== by 0xB8F9DC4: sc_core::sc_process_b::reference_decrement()
(sc_process.h:466)
==8081== by 0xB8FF45F: sc_core::sc_process_b::kill_process()
(sc_process.cpp:211)
==8081== by 0xB90946D: sc_core::sc_thread_process::kill_process()
(sc_thread_process.cpp:127)
==8081== by 0xB909655: sc_core::sc_thread_cor_fn(void*)
(sc_thread_process.cpp:103)
==8081== by 0xB8EB770: sc_cor_qt_wrapper (sc_cor_qt.cpp:171)
==8081== by 0xFFFFFFFFFFFFFFFE: ???
==8081==
==8081== Invalid read of size 8
==8081== at 0xB91B05D:
sc_core::sc_signal_invalid_writer(sc_core::sc_object*, sc_core::sc_object*,
sc_core::sc_object*) (sc_signal.cpp:123)
==8081== by 0xC6DA918: sc_core::sc_buffer<bool>::write(bool const&)
(sc_buffer.h:159)
==8081== by 0xC6C606F: sc_core::sc_buffer<bool>::operator=(bool const&)
(sc_buffer.h:124)
==8081== by 0xC6C6099: top::main_loop() (top.h:327)
==8081== by 0xC6C4825: checker_step (main_cte.cpp:126)
...
==8081== Address 0x3589c870 is 0 bytes inside a block of size 304 free'd
==8081== at 0x4B1F76E: operator delete(void*) (vg_replace_malloc.c:346)
==8081== by 0xB908B9D: sc_core::sc_thread_process::~sc_thread_process()
(sc_thread_process.cpp:252)
==8081== by 0xB8F9DC4: sc_core::sc_process_b::reference_decrement()
(sc_process.h:466)
==8081== by 0xB8FF45F: sc_core::sc_process_b::kill_process()
(sc_process.cpp:211)
==8081== by 0xB90946D: sc_core::sc_thread_process::kill_process()
(sc_thread_process.cpp:127)
==8081== by 0xB909655: sc_core::sc_thread_cor_fn(void*)
(sc_thread_process.cpp:103)
==8081== by 0xB8EB770: sc_cor_qt_wrapper (sc_cor_qt.cpp:171)
==8081== by 0xFFFFFFFFFFFFFFFE: ???
|
|
By Date:
Previous |
Next
|
Current Thread
|
By Thread:
Previous |
Next
|
- Possible causes of segfault during writes to , Czajkowski, Greg (you are here)
|
|