[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] improper locking due to the unreleased lock



On 12.10.21 08:54, Ryan Cai wrote:
Dear maintainers for Xen Project,

             I am writing you to report a bug due to the unreleased lock. The impact could be deadlock or memory consumption. In the function of /read_watch_internal/, the mutex lock /h->watch_mutex/ (*Line901*) is not released correctly when /read_message(h,nonblocking)== -1/(*Line 923*). Looking forward to your feedback. Thank for checking.

Locations, https://github.com/xen-project/xen/blob/master/tools/libs/store/xs.c#L902-L924

Thanks for the report.

From looking at read_watch_internal() this seems to be right, but this
is no issue in reality.

The missing mutex_unlock() is inside a !USE_PTHREAD section. This
implies muex_lock() and mutex_unlock() being defined as ((void)0),
so there is no risk of anything going wrong.

Even with no risk something going wrong here, the code should be
corrected nevertheless in order to avoid others to stumble over that.


Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.