Skip Nav
Home » Forums » SystemC Forum

Icon - KMLM List KMLM List

View email archives for the history of this mailing list.

List Home All Archives Dates Threads Authors Subjects
systemc-forum - Re: [systemc-forum] Possible causes of segfault during writes to an sc_b Message Thread: Previous | Next
  • To: "Czajkowski, Greg" <greg.czajkowski@xxxxxxxxx>
  • From: "Philipp A. Hartmann" <philipp.hartmann@xxxxxxxx>
  • Date: Fri, 12 Nov 2010 15:15:41 +0100
  • Cc: alan.fitch@xxxxxxxxxx, "systemc-forum@xxxxxxxxxxxxxxxxx" <systemc-forum@xxxxxxxxxxxxxxxxx>
Send Email to systemc-forum@lists.systemc.org:
Send new message
Reply to this message
Greg,

On 12/11/10 09:54, alan.fitch@xxxxxxxxxx wrote:
> It's impossible to say without seeing the code.

I agree with Alan, that it's quite hard to tell without the code.

> However I shall borrow Phillip's crystal ball (thanks Phillip!) and guess 
> that you have declared an sc_buffer as an automatic variable, perhaps in a 
> constructor of a module, or inside an SC_THREAD after elaboration.

You're welcome.  Unfortunately, the crystal ball is quite unreliable
these days.  So there may be another cause for the problem, see below.

On 12/11/10 01:12, Czajkowski, Greg wrote:

> The segfault happens because sc_signal_invalid_writer is
> dereferencing a pointer whose memory has been deleted.

sc_buffer (similar to sc_signal) remembers the writing process, that is
writing to it.  This pointer is corrupt in your design:

> 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.

The cause for this could be, that you're writing to the signal from a
dynamic process, that has terminated and got cleaned up when you do the
second write.  The correct solution in this case depends on the exact
scenario and requirements, though.

Greetings from Oldenburg,
Philipp

-- 
Philipp A. Hartmann
Hardware/Software Design Methodology Group

OFFIS Institute for Information Technology
R&D Division Transportation · FuE-Bereich Verkehr
Escherweg 2 · 26121 Oldenburg · Germany
Phone/Fax: +49-441-9722-420/282 · PGP: 0x9161A5C0 · http://www.offis.de/

Attachment: signature.asc
Description: OpenPGP digital signature


By Date: Previous | Next Current Thread By Thread: Previous | Next