Bug 957181 - hawtjni: missing barriers in cache initialization
Summary: hawtjni: missing barriers in cache initialization
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: hawtjni
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Marek Goldmann
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/fusesource/hawtjni...
Whiteboard:
Depends On:
Blocks: 957130 1009416
TreeView+ depends on / blocked
 
Reported: 2013-04-26 14:18 UTC by Florian Weimer
Modified: 2013-10-04 01:59 UTC (History)
3 users (show)

Fixed In Version: hawtjni-1.9-1.fc20
Clone Of:
: 1009416 (view as bug list)
Environment:
Last Closed: 2013-10-04 01:59:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.