Jump to content
AmeyaVS

Possible Bug/Regression in SystemC 2.3.2: Race Condition

Recommended Posts

Hello everyone,

Has anyone faced issues with Linux Build for SystemC 2.3.2 configured with PThreads as the threading library backend?

I have configured the SystemC library using the following command:

cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$HOME/apps/systemc-2.3.2 -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_EXTENSIONS=OFF -DENABLE_PTHREADS=ON -DENABLE_PHASE_CALLBACKS=ON ..

# Then followed by
make
#
make check
# and
make install

I having issues with the SystemC kernel getting stuck in deadlock.

I am currently working on Ubuntu 18.04 using g++:

g++ (Ubuntu 7.3.0-16ubuntu3) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Though I do not experience such issues with the QuickThreads back-end, but for now I need SystemC kernel with PThreads support.

I have attached the back-trace of a minimal example/regression test from the test-suite which triggers this behavior:(systemc-regressions-2.3.2)

TEST : systemc/1666-2011-compliance/living_dead_bug/living_dead_bug.cpp  (11/871)

Note: This behavior is also observed with SystemC 2.3.1a release.

Best Regards,

Ameya Vikram Singh

 

SystemC.RaceCondition.GDB.BackTrace.txt

Share this post


Link to post
Share on other sites

Hello @Roman Popov,

I did try it on Ubuntu 16.04 with GCC 5.4.0, and currently I do not observe this behavior.

Probably some regression in the base system, I will try to narrow it down once I get some time.

I just wanted to give a heads-up in-case there is an issue with the SystemC kernel.

Since, most of the application packaged on these Linux systems do get some form of regression testing. 

Regards,

Ameya Vikram Singh

Share this post


Link to post
Share on other sites

Hello @Roman Popov,

It seems the issue is consistent with multiple different Linux OS with recent versions of GLIBC.

From what I could figure out was the internal implementation for pthread mutex and condition variables have been updated.

I will try to find the discussion on the same, but for now I think it would be better if someone from working group could also provide some insight into the issue.

Regards,

Ameya Vikram Singh

Share this post


Link to post
Share on other sites

Hi Ameya,

I currently don't have access to such new Linux platforms, but I may have a suspicion about a potential root cause.
Can you please check, if it helps to change the sc_process_b::delete_process function in src/sysc/kernel/sc_process.cpp  as follows:

 // if ( this != sc_get_current_process_b() )
 if ( NULL == sc_get_current_process_b() )

Thanks and Greetings from Duisburg,
  Philipp

Share this post


Link to post
Share on other sites

Hi Ameya,

thanks for testing.  As said before, unfortunately I cannot reproduce this on my end.  I would need more details on the current behavior:

  • The backtrace looks like there is something broken during model teardown. Have you seen other cases?
  • Are all simulations with processes hanging in a similar way? (e.g. can you provide a full regression result?)

Greetings from Duisburg,
  Philipp

Share this post


Link to post
Share on other sites

Hello @Philipp A Hartmann,

I have probably seen this behavior in other regression tests also. But currently I do not recall all of them, this one was the first one to deadlock.

I will try to run the regression test-suite with individual tests and post the results whenever I get a chance.

Thanks and Regards,

Ameya Vikram Singh

 

Share this post


Link to post
Share on other sites

Hello @Philipp A Hartmann,

It seems to be an issue with this test scenario.(systemc/1666-2011-compliance/living_dead_bug)

I tried running the regression test suite on another system and except for this test, all the other tests passes.

Regards,

Ameya Vikram Singh

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

×