New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8253970: Build error: address argument to atomic builtin must be a pointer to integer or pointer ('volatile narrowOop *' invalid) #496
Conversation
…nter to integer or pointer ('volatile narrowOop *' invalid)
/issue add JDK-8253970 |
👋 Welcome back jiefu! A progress list of the required criteria for merging this PR into |
@DamonFool This issue is referenced in the PR title - it will now be updated. |
@DamonFool The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
/label add hotspot-runtime |
@DamonFool The |
@DamonFool The |
Webrevs
|
No, don't make this change. Something else is going wrong here. The Platform layer shouldn't be called with enum types; the higher level platform-independent layer should have canonicalized such to the associated underlying integral types. |
Apparently I misremembered. The platform-independent layer isn't doing that canonicalization of enum types to associated integral types. But I think it should be in some places. |
Thanks @kimbarrett for your review. |
What version of clang? gcc (at least recent versions) allows enum types (both scoped and unscoped) for both the __sync_xxx functions and for the __atomic_xxx functions. (The documentation for both say the type can be an integral scalar or pointer type. Enums are not integral types.) So this seems to be a clang incompatibility with gcc, which may be a clang bug. The __sync_xxx functions have been legacy since gcc4.7, having been superseded by the __atomic_xxx functions. Could zero be updated here? Would that help? If clang is incompatible with gcc for the __sync_xxx functions, it might also be incompatible for the __atomic_xxx functions. BTW, the memory ordering by the zero implementation of Atomic::xchg in terms of __sync_lock_test_and_set looks wrong to me. I think the fence() is on the wrong side of the __sync_xxx operation. |
The following two versions of clang can reproduce the bug. $ clang -v clang -vclang version 10.0.0-4ubuntu1 |
Hi @kimbarrett , I replace __sync_val_compare_and_swap whith __atomic_compare_exchange and it really woks. I also fix the following bug when building zero VM on MacOS.
Testing:
As for the memory ordering of the zero implementation, it might be better to file another bug to fix it. Thanks. |
/test |
@DamonFool you need to get approval to run the tests in tier1 for commits up until 420ead7 |
Mailing list message from Kim Barrett on hotspot-runtime-dev:
Good news that __atomic_compare_exchange works where However, __ATOMIC_SEQ_CST doesn't provide the same semantics as the __sync T value = compare_value; See the discussion related to that linux_aarch64 code here:
I think this should be a separate bug and PR. This seems to be a result of a recent change
I?m okay with that. The linux_aarch64 implementation looks like a good model for zero. |
Mailing list message from Kim Barrett on hotspot-runtime-dev:
https://bugs.openjdk.java.net/browse/JDK-8254722 |
Thanks @kimbarrett for your review. |
Hi @kimbarrett , I agree with you. The patch has been updated. Best regards, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
@DamonFool This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 57 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Thanks @kimbarrett for your review. |
Mailing list message from Kim Barrett on hotspot-runtime-dev:
There should normally be a second reviewer for HotSpot changes. |
OK. May I get a second review for this change? |
Hi all, May I get a second review to finish this issue? Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems consistent with the aarch64 code.
Thanks,
David
Thanks @dholmes-ora for your review. |
@DamonFool Since your change was applied there have been 57 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit cb7701b. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
__sync_val_compare_and_swap shouldn't call with narrowOop* for clang after JDK-8247912.
Before passing type T to __sync_val_compare_and_swap, the fix converts T to uint32_t* if sizeof(T) == 4.
Testing:
Progress
Testing
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/496/head:pull/496
$ git checkout pull/496