Jump to content

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.

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;
}
Link to comment
Share on other sites

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

Link to comment
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...