RFR: 8351933: Inaccurate masking of TC subfield decrement in ForkJoinPool
Dmitry Chuyko
dchuyko at openjdk.org
Mon Mar 17 15:17:52 UTC 2025
On Mon, 17 Mar 2025 14:43:05 GMT, Chen Liang <liach at openjdk.org> wrote:
> It seems this is an overflow for the TC part of the flag. The RC part seems to be able to overflow too, but because it occupies the higher bits its overflow will never affect the TC. And this is the only site where TC is masked with `UMASK` after overflow-capable addition.
Yes, from this point RC (in)accurate masking can be considered cosmetic, but this might be the source of this bug with TC.
> Should we reexamine all uses of `UMASK` to mask only RC/TC explicitly?
'(v.stackPred & SP_MASK) | (UC_MASK & c)' patterns seem ok to me, but for all subfield arithmetic it would be more clear to see all subfields recombined.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24034#issuecomment-2729913449
More information about the core-libs-dev
mailing list