Jump to content
Martin Barnasconi

coredump using kill() in SystemC 2.3 with clang

Recommended Posts

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.

  void f1()
    sc_process_handle h2 = sc_spawn(sc_bind(&x::f2, this) );
    wait(5, SC_MS);
    if (h2.valid())

  void f2()
    cout << "@" << sc_time_stamp() << ": A" << endl;
    wait(10, SC_MS);
    cout << "@" << sc_time_stamp() << ": B" << endl;

    sc_process_handle h1 = sc_spawn(sc_bind(&x::f1, this) );

int sc_main(int, char*[])
  x mod_x("x");
  return 0;

Share this post

Link to post
Share on other sites



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,


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now