Jump to content
TRANG

Valgrind issue with sc_event

Recommended Posts

Hi all,
I got some issue when test memory check (valgrind 3.11.0).

==467== Use of uninitialised value of size 8
==467== at 0x300B000: ??? (in /lib64/libsystemc-2.3.1.so)
==467== by 0x3000B02: sc_core::wait() (in /lib64/libsystemc-2.3.1.so)
==467== by 0x3000C04: sc_core::sc_module::wait() (sc_module.h)
==467== by 0x40B0B9A: SAZZ::EndThread() (SAZZ.cpp:813)
==467== by 0x40EB0B1: sc_core::sc_thread_cor_fn (in /lib64/libsystemc-2.3.1.so)
==467== by 0x4139044: ??? (in /lib64/libsystemc-2.3.1.so)
==467== Uninitialized value was created by a stack allocation
==467== at 0x300B000: ??? (in /lib64/libsystemc-2.3.1.so)

==467== Use of uninitialised value of size 8
==467== at 0x700B000: sc_core::sc_sc_event_expr<sc_core::sc_event_or_list>::~sc_event_expr() (in /mywork/execute.x)
==467== by 0x40BC9A: SAZZ::EndThread() (SAZZ.cpp:813)
==467== by 0x413D0D8: sc_core::sc_thread_cor_fn(void*) (in /lib64/libsystemc-2.3.1.so)
==467== by 0x4130300: ??? (in /lib64/libsystemc-2.3.1.so)
==467== by 0x4136094: ??? (in /lib64/libsystemc-2.3.1.so)
==467== Uninitialized value was created by a stack allocation
==467== at 0x300B000: ??? (in /lib64/libsystemc-2.3.1.so)

==467== Invalid read size 8
==467== at 0x600B000: sc_cor_qt_yieldhelp (in /lib64/libsystemc-2.3.1.so)
==467== at 0x600BC00: ??? (in /lib64/libsystemc-2.3.1.so)
==467== by 0x6000B02: sc_core::wait() (in /lib64/libsystemc-2.3.1.so)
==467== by 0x6000C04: sc_core::sc_module::wait() (sc_module.h)
==467== by 0x60BC9A: SAZZ::EndThread() (SAZZ.cpp:813)
==467== by 0x613D0D8: sc_core::sc_thread_cor_fn(void*) (in /lib64/libsystemc-2.3.1.so)
==467== by 0x6130300: ??? (in /lib64/libsystemc-2.3.1.so)
==467== by 0x6136094: ??? (in /lib64/libsystemc-2.3.1.so)
==467== Address 0xE14be48 is 598 bytes inside a block of size 624 alloc'd
==467== at 0x400BD00: operator new[](unsigned long) (vg_replace_malloc.c:422)
==467== by 0x600BA00: sc_core::sc_core_pkg_qt::create(unsigned long, void (*), void*)(in /lib64/libsystemc-2.3.1.so)
void SAZZ::EndThread(){
     while(1){
     ...

     wait( period, time_resolution, next_event[index] | change_event[index]);//line 813
     }
}


Have you any idea? 
Thanks for your support

Share this post


Link to post
Share on other sites

See this thread, SystemC 2.3.1 triggers some known Valgrind reports. Most should be fixed in the latest SystemC release (version 2.3.3) available from Accellera. You may also consider building and using SystemC directly from the official public Git repository. If you search this Forum for "valgrind", you can find several other relevant threads. If the problem persists with the latest SystemC release, it would be nice if you could post a complete reproducer so that we can have a closer look.  @Philipp A Hartmann may then be able to make some more comments.

Share this post


Link to post
Share on other sites

Valgrind does not play well with the Quickthreads package used for the SystemC threads by default.  As Torsten said, please try with SystemC 2.3.3 and configure your SystemC library build with --enable-pthreads to switch to the posix-based thread implementation, see https://github.com/accellera-official/systemc/blob/master/INSTALL.md.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...