Project

Profile

Help

Bug #6226

closed

Race condition initialising UnicodeBlocks class

Added by at055612 at055612 7 months ago. Updated 6 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Multithreading
Sprint/Milestone:
-
Start date:
2023-10-18
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
10, 11, 12, trunk
Fix Committed on Branch:
11, 12, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java

Description

Seen in v9.9.1-8 but the code is the same in v12.3

There is a potential race condition when readBlocks() is called in net.sf.saxon.regex.UnicodeBlocks. Because the blocks instance variable is set at the start of readBlocks(), there is the potential for another thread to read it and find it populated, partially populated or empty depending on timing.

I suggest changing it to use the Initialization-on-demand holder idiom in a similar way to issue https://saxonica.plan.io/issues/6225

Please register to edit this issue

Also available in: Atom PDF