Bug 957181

Summary: hawtjni: missing barriers in cache initialization
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: hawtjniAssignee: Marek Goldmann <mgoldman>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: java-sig-commits, mgoldman, mizdebsk
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://github.com/fusesource/hawtjni/issues/7
Whiteboard:
Fixed In Version: hawtjni-1.9-1.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1009416 (view as bug list) Environment:
Last Closed: 2013-10-04 01:59:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 957130, 1009416    

Description Florian Weimer 2013-04-26 14:18:19 UTC
The following code is generated from the example:

void cachebarFields(JNIEnv *env, jobject lpObject)
{
        if (barFc.cached) return;
        barFc.clazz = env->GetObjectClass(lpObject);
        barFc.a = env->GetFieldID(barFc.clazz, "a", "I");
        barFc.b = env->GetFieldID(barFc.clazz, "b", "J");
        barFc.c = env->GetFieldID(barFc.clazz, "c", "[B");
        barFc.c5 = env->GetFieldID(barFc.clazz, "c5", "B");
        barFc.prev = env->GetFieldID(barFc.clazz, "prev", "J");
        barFc.cached = 1;
}

There are no barriers, so readers may observe the write to the "cached" member before the other members.

(One of the barFc.cached checks is redundant, BTW.)

Comment 1 Marek Goldmann 2013-05-21 11:48:57 UTC
A new version of HawtJNI was pushed to Rawhide. Could you please test this with 1.8?

https://koji.fedoraproject.org/koji/taskinfo?taskID=5404838

Comment 2 Marek Goldmann 2013-07-05 13:29:56 UTC
Closing. Please reopen if the issue still exists.

Comment 3 Florian Weimer 2013-07-05 13:46:18 UTC
I do not see any changes to org.fusesource.hawtjni.generator. StructsGenerator.generateCacheFunction() in 1.8, so this issue still exists.

Comment 4 Marek Goldmann 2013-09-09 08:33:42 UTC
Reported upstream: https://github.com/fusesource/hawtjni/issues/7

Comment 5 Fedora End Of Life 2013-09-16 13:40:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20

Comment 6 Fedora Update System 2013-09-25 10:30:22 UTC
hawtjni-1.9-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/hawtjni-1.9-1.fc20

Comment 7 Marek Goldmann 2013-09-25 10:32:37 UTC
The hawtjni-1.9-1.fc20 update should fix the issue.

Comment 8 Fedora Update System 2013-09-26 06:03:47 UTC
Package hawtjni-1.9-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing hawtjni-1.9-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-17602/hawtjni-1.9-1.fc20
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2013-10-04 01:59:21 UTC
hawtjni-1.9-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.