accellera-official / systemc

SystemC Reference Implementation
https://systemc.org/overview/systemc/
Apache License 2.0
468 stars 147 forks source link

SystemC 2.3.4 Valgrind Uninitialised Value Errors #89

Open abnashkb opened 1 month ago

abnashkb commented 1 month ago

Running Valgrind on a project using SystemC 2.3.4 reports many uninitialised value errors related to the SystemC library. The first three (cleaned up) error messages are as follows. Similar messages repeat and propagate into other SystemC functions:

Use of uninitialised value of size 8
at ________: ??? (in ______/systemc-2.3.4/build/src/libsystemc.so.2.3.4)
Uninitialised value was created by a stack allocation
at ________: ??? (in ______/systemc-2.3.4/build/src/libsystemc.so.2.3.4)

Use of uninitialised value of size 8
at ______: sc_cor_qt_wrapper (in ______/systemc-2.3.4/build/src/libsystemc.so.2.3.4)
Uninitialised value was created by a stack allocation
at ______: ??? (in ______/systemc-2.3.4/build/src/libsystemc.so.2.3.4)

Use of uninitialised value of size 8
at ______: sc_core::sc_thread_cor_fn(void*) (in ______/systemc-2.3.4/build/src/libsystemc.so.2.3.4)
Uninitialised value was created by a stack allocation
at ______: ??? (in______/systemc-2.3.4/build/src/libsystemc.so.2.3.4)

Is this a known issue in SystemC 2.3.4? How can this be resolved aside from updating the SystemC version?

maehne commented 1 month ago

A similar issue involving Valgrind was raised in #88 and also in the past (issue OSCI-WG/systemc#134). However, to understand whether it is the same issue, we need a reproducer for your specific problem that does not involve your specific application? Could you please also indicate the configuration (OS, compiler, used build system, parameters used for building Systemc, etc.)?

Please, check whether the issue is reproduceable with the last released SystemC PoC version 3.0.0 and ideally the HEAD of this repository.