LaoShaw Posted November 7, 2021 Report Share Posted November 7, 2021 SystemC 2.3.3 memory access error. Not sure where to report systemc bugs(possibly) How to reproduce: a simple helloworld.cpp build with `g++ -std=c++17 -D_GLIBCXX_DEBUG -fsanitizer=address,undefined` (g++ is 9.3.0 on ubuntu 20.04 64bit), it will reliably produce below errors(without the `-D_GLIBCXX_DEBUG -fsanitize=address,undefined` the code runs with no errors). I build systemc and helloworld.cpp always with the same compiler flags to make sure they match. ``` ../../src/sysc/kernel/sc_method_process.h:286:30: runtime error: member access within misaligned address 0x0000000000db for type 'struct sc_method_process', which requires 8 byte alignment 0x0000000000db: note: pointer points here <memory cannot be printed> AddressSanitizer:DEADLYSIGNAL ===================================================================675211==ERROR: AddressSanitizer: SEGV on unknown address 0x0000000000db (pc 0x7f20df8a61e4 bp 0x7ffca9d82c10 sp 0x7ffc a9d82bc0 T0) ==675211==The signal is caused by a READ memory access. ==675211==Hint: address points to the zero page. #0 0x7f20df8a61e3 in sc_core::sc_method_process::next_runnable() ../../src/sysc/kernel/sc_method_process.h:286 #1 0x7f20df8a61e3 in sc_core::sc_runnable::push_front_method(sc_core::sc_method_process*) ../../src/sysc/kernel/sc_r unnable_int.h:232 #2 0x7f20df8a61e3 in sc_core::sc_simcontext::push_runnable_method_front(sc_core::sc_method_process*) ../../src/sysc/ kernel/sc_simcontext_int.h:227 #3 0x7f20df8a61e3 in sc_core::sc_simcontext::prepare_to_simulate() kernel/sc_simcontext.cpp:744 #4 0x7f20df8a9a84 in sc_core::sc_simcontext::initialize(bool) kernel/sc_simcontext.cpp:819 #5 0x7f20df8aabdd in sc_core::sc_simcontext::simulate(sc_core::sc_time const&) kernel/sc_simcontext.cpp:844 #6 0x7f20df8ad5c4 in sc_core::sc_start(sc_core::sc_time const&, sc_core::sc_starvation_policy) kernel/sc_simcontext. cpp:1718 #7 0x7f20df8ae219 in sc_core::sc_start() kernel/sc_simcontext.cpp:1752 #8 0x55e06041f9c7 in sc_main /home/xxo/devel/notes/xcoding/verilog.systemc/systemc/hello/main.cxx:14 #9 0x7f20df74f700 in sc_elab_and_sim kernel/sc_main_main.cpp:89 #10 0x7f20df74ab8e in main kernel/sc_main.cpp:36 #11 0x7f20dd329564 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28564) #12 0x55e06041964d in _start (/home/xxo/devel/notes/xcoding/verilog.systemc/systemc/hello/debug.out+0x1064d) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV ../../src/sysc/kernel/sc_method_process.h:286 in sc_core::sc_method_process::next_runnab le() ``` Quote Link to comment Share on other sites More sharing options...
raku99 Posted December 3, 2021 Report Share Posted December 3, 2021 Hi 🙂 Could You please source of Your helloworld.cpp ? Best regards ! Quote Link to comment Share on other sites More sharing options...
LaoShaw Posted December 4, 2021 Author Report Share Posted December 4, 2021 #include "systemc" using namespace sc_core; class Hello : public sc_module { public: SC_HAS_PROCESS(Hello); explicit Hello(sc_module_name name_) : sc_module(name_) {} void say_Hello() { std::cout << "Hello World!" << std::endl; } }; int sc_main(int argc, char* argv[]) { Hello h("Hello"); h.say_Hello(); return 0; } Quote Link to comment Share on other sites More sharing options...
maehne Posted December 5, 2021 Report Share Posted December 5, 2021 SystemC 2.3.3 unfortunately causes problems when adress sanitizer is used, see this GitHub issue for details. Maybe, @LukasJuenger can provide some further feedback, as he did some work to make the SystemC PoC implementation compatible with address sanitizer. LaoShaw 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.