Skip to content
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

omrthreadattr.c signed comparison of unsigned variable priority #7454

Open
pshipton opened this issue Sep 5, 2024 · 4 comments · May be fixed by #7455
Open

omrthreadattr.c signed comparison of unsigned variable priority #7454

pshipton opened this issue Sep 5, 2024 · 4 comments · May be fixed by #7455

Comments

@pshipton
Copy link
Member

pshipton commented Sep 5, 2024

We accidentally ran a jdk8 build with the wrong configure options and got the following error on AIX, which seems legit.

00:25:02.803  /home/jenkins/workspace/build-scripts/jobs/jdk8u/jdk8u-aix-ppc64-openj9/workspace/build/src/omr/thread/unix/omrthreadattr.c:291:19: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
00:25:02.803   if ((((priority) < (0)) || ((priority) > (11)))) {
00:25:02.803         ~~~~~~~~~~ ^ ~~~
00:25:02.803  1 error generated.
@pshipton
Copy link
Member Author

pshipton commented Sep 5, 2024

@babsingh fyi

babsingh added a commit to babsingh/omr that referenced this issue Sep 6, 2024
@babsingh
Copy link
Contributor

babsingh commented Sep 6, 2024

@pshipton Opened #7455 to address this error. Which configure option exposed the compiler error?

@pshipton
Copy link
Member Author

pshipton commented Sep 6, 2024

Normally we configure with --disable-ccache, but that was left off. Not sure why it would cause the error.

@pshipton
Copy link
Member Author

pshipton commented Sep 6, 2024

The full set of missing configure args was
--disable-ccache --with-product-name=\"IBM Semeru Runtime\" --with-product-suffix=\"Open Edition\"
I don't know if the product args would cause some side affect.

babsingh added a commit to babsingh/omr that referenced this issue Sep 6, 2024
babsingh added a commit to babsingh/omr that referenced this issue Sep 9, 2024
omrthread_prio_t is of type uintptr_t. It cannot have a value below 0.

J9THREAD_PRIORITY_MIN is defined as 0 and J9THREAD_PRIORITY_MAX is
defined as 11.

In omrthread_attr_set_priority, priority, which is of type
omrthread_prio_t, will always be greater than or equal to
J9THREAD_PRIORITY_MIN. To see if priority is invalid, we only need
to evaluate if it is greater than J9THREAD_PRIORITY_MAX.

Fixes: eclipse#7454

Signed-off-by: Babneet Singh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants