[jboss-jira] [JBoss JIRA] (ELY-1096) Coverity, volatile not atomically updated in RotatingFileAuditEndpoint (Elytron)
Yeray Borges (JIRA)
issues at jboss.org
Wed May 3 03:40:00 EDT 2017
[ https://issues.jboss.org/browse/ELY-1096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yeray Borges reassigned ELY-1096:
---------------------------------
Assignee: Yeray Borges (was: Darran Lofthouse)
> Coverity, volatile not atomically updated in RotatingFileAuditEndpoint (Elytron)
> --------------------------------------------------------------------------------
>
> Key: ELY-1096
> URL: https://issues.jboss.org/browse/ELY-1096
> Project: WildFly Elytron
> Issue Type: Bug
> Affects Versions: 1.1.0.Beta37
> Reporter: Martin Choma
> Assignee: Yeray Borges
> Priority: Critical
>
> There is variable {{currentSize}} marked with modifier as {{volatile}}, what hint variable {{currentSize}} is used in multithreaded manner, as volatile ensures actual value can be seen between threads.
> On the other side there is update operation on {{currentSize}}, which is not written in atomic manner, so can lead race condition.
> {code}
> @Override
> protected void write(byte[] bytes) throws IOException {
> super.write(bytes);
> currentSize += bytes.length;
> }
> {code}
> Setting as Critical as that can lead to strange / hard to reproduce errors.
> https://scan7.coverity.com/reports.htm#v23632/p11778/fileInstanceId=15443553&defectInstanceId=3634186&mergedDefectId=1429223
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list