Martin Barnasconi 35 Report post Posted June 16, 2013 When using clang++ (version 3.1 under cygwin/Windows) and SystemC 2.3, I get a coredump when killing a dynamically spawned process. The message is: terminate called after throwing an instance of 'sc_core::sc_unwind_exception' what(): KILL Aborted (core dumped) Using gcc/g++ works correctly. Any idea what is causing this? Attached a simple example to reproduce the coredump. SC_MODULE(x) { void f1() { sc_process_handle h2 = sc_spawn(sc_bind(&x::f2, this) ); wait(5, SC_MS); if (h2.valid()) h2.kill(); } void f2() { cout << "@" << sc_time_stamp() << ": A" << endl; wait(10, SC_MS); cout << "@" << sc_time_stamp() << ": B" << endl; } SC_CTOR(x) { sc_process_handle h1 = sc_spawn(sc_bind(&x::f1, this) ); }; }; int sc_main(int, char*[]) { x mod_x("x"); sc_start(); return 0; } 1 maehne reacted to this Share this post Link to post Share on other sites
Philipp A Hartmann 220 Report post Posted June 17, 2013 Martin, obviously, this shouldn't happen. I don't have a working Clang environment running on windows, so I can't reproduce the issue for now. My guess would be, that the exception handling (combined with the process switching) works differently when using clang on Cygwin. Can you check, whether clang uses SJLJ exceptions and if the corresponding preprocessor switches are correctly matched in src/sysc/kernel/sc_cor_fiber.{h,cpp}? Last, but not least, a detailed report on the SystemC regressions using Clang on Windows would be appreciated. Preferably send the results directly to the LWG reflector (or post them here). Greetings from Oldenburg, Philipp Share this post Link to post Share on other sites