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.)
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
Closing. Please reopen if the issue still exists.
I do not see any changes to org.fusesource.hawtjni.generator. StructsGenerator.generateCacheFunction() in 1.8, so this issue still exists.
Reported upstream: https://github.com/fusesource/hawtjni/issues/7
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
hawtjni-1.9-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/hawtjni-1.9-1.fc20
The hawtjni-1.9-1.fc20 update should fix the issue.
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).
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.