EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: thread joinable race
From: Ralph Lange via Core-talk <core-talk at aps.anl.gov>
To: EPICS Core Talk <core-talk at aps.anl.gov>
Date: Mon, 9 Mar 2020 11:59:36 +0100
On Mon, 9 Mar 2020 at 06:47, Michael Davidsaver via Core-talk <core-talk at aps.anl.gov> wrote:
In following up on a strange CI test failure I noticed during the recent codeathon[1]
I realized a mistake I made in adding epicsThreadMustJoin() [2].  This change
introduced a reference counter to struct epicsThreadOSD.  The bug is in
(conditionally) incrementing the ref counter after pthread_create().
This allows a short-lived thread which attempts to self-join to race for a double free().
And it happens that epicsThreadTest does this.

The fix is I think straight forward [3].  I'm wondering how severe this issue should be considered?
It's a race which can cause a crash at runtime.  However, the circumstances seem not so common.

Well spotted!

Given that "a short-lived thread which attempts to self-join" is not a common situation, especially as this API was added very recently, I would suggest creating a regular LP ticket and fix the bug with the next release. Maybe step up the ticket priority to indicate that the issue might cause crashes.

Cheers,
~Ralph 

Replies:
Re: thread joinable race Michael Davidsaver via Core-talk
References:
thread joinable race Michael Davidsaver via Core-talk

Navigate by Date:
Prev: thread joinable race Michael Davidsaver via Core-talk
Next: Build failed: epics-base base-integration-424 AppVeyor via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: thread joinable race Michael Davidsaver via Core-talk
Next: Re: thread joinable race Michael Davidsaver via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
ANJ, 09 Mar 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·