[Gluster-devel] syncops and thread specific memory regions

Pranith Kumar Karampuri pkarampu at redhat.com
Thu Jul 3 02:36:23 UTC 2014


On 07/02/2014 05:27 PM, Raghavendra Gowdappa wrote:
> Hi all,
>
> The bug fixed by [1] is a one instance of the class of problems where:
> 1. we access a variable which is stored in thread-specific area and hence can be stored in different memory regions across different threads.
> 2. A single (code) control flow is executed in more than one thread.
> 3. Optimization prevents recalculating address of variable mentioned in 1 every time its accessed, instead using an address calculated earlier.
>
> The bug fixed by [1] involved "errno" as the variable. However there are other pointers which are stored in TLS like,
> 1. The xlator object in whose context the current code is executing in (aka THIS, set/read by using __glusterfs_this_location() ).
> 2. A buffer used to parse binary uuids into strings (used by uuid_utoa () ).
>
> I think we can hit the corruption uncovered by [1] in the above two scenarios too. Comments?
No it should not. Because __glusterfs_this_location() does not have 
__const__ attribute like __errno_location has.
./bits/errno.h:extern int *__errno_location (void) __THROW __attribute__ 
((__const__));

Pranith
>
> [1] http://review.gluster.org/6475
>
> regards,
> Raghavendra.



More information about the Gluster-devel mailing list