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

avoid sanitizer warning unsigned integer overflow #3678

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

wayne-arnold-adsk
Copy link
Contributor

@wayne-arnold-adsk wayne-arnold-adsk commented Nov 17, 2022

avoid sanitizer warning of unsigned integer overflow

src/Components/ExternalLibraries/OpenImageIO/install/include/OpenImageIO/string_view.h:252:43: runtime error: unsigned integer overflow: 0 - 17 cannot be represented in type 'unsigned long'
#0 0x10d0adf61 in OpenImageIOMaya_v2_4::basic_string_view<char, std::__1::char_traits >::compare(OpenImageIOMaya_v2_4::basic_string_view<char, std::__1::char_traits >) const string_view.h:252

Description

Tests

Checklist:

  • I have read the contribution guidelines.
  • If this is more extensive than a small change to existing code, I
    have previously submitted a Contributor License Agreement
    (individual, and if there is any way my
    employers might think my programming belongs to them, then also
    corporate).
  • I have updated the documentation, if applicable.
  • I have ensured that the change is tested somewhere in the testsuite
    (adding new test cases if necessary).
  • My code follows the prevailing code style of this project.

avoid sanitizer warning of unsigned integer overflow

/Volumes/DATA/local/S/Maya_master_CI_sanitizer/build/RelWithDebInfo/src/Components/ExternalLibraries/OpenImageIO/install/include/OpenImageIO/string_view.h:252:43: runtime error: unsigned integer overflow: 0 - 17 cannot be represented in type 'unsigned long'
    #0 0x10d0adf61 in OpenImageIOMaya_v2_4::basic_string_view<char, std::__1::char_traits<char> >::compare(OpenImageIOMaya_v2_4::basic_string_view<char, std::__1::char_traits<char> >) const string_view.h:252
@wayne-arnold-adsk
Copy link
Contributor Author

I don't see why my change would fail:
CI, Attempt #2 / Ubuntu bleeding edge gcc12 C++20 py3.10 OCIO/libtiff/exr-master boost1.74 avx2

@lgritz
Copy link
Collaborator

lgritz commented Nov 17, 2022

I don't think the bleeding edge failure is related to you at all, I'm seeing that failure across many PRs and scheduled CI runs. I think, actually, that maybe the runners got a gcc12 update and something that used to work is now warning with the new compiler. Something like that. I will address it separately.

Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix!

@lgritz lgritz merged commit ae10310 into AcademySoftwareFoundation:master Nov 17, 2022
@wayne-arnold-adsk wayne-arnold-adsk deleted the patch-1 branch November 18, 2022 00:24
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Nov 18, 2022
…ndation#3678)


/Volumes/DATA/local/S/Maya_master_CI_sanitizer/build/RelWithDebInfo/src/Components/ExternalLibraries/OpenImageIO/install/include/OpenImageIO/string_view.h:252:43: runtime error: unsigned integer overflow: 0 - 17 cannot be represented in type 'unsigned long'
    #0 0x10d0adf61 in OpenImageIOMaya_v2_4::basic_string_view<char, std::__1::char_traits<char> >::compare(OpenImageIOMaya_v2_4::basic_string_view<char, std::__1::char_traits<char> >) const string_view.h:252
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 this pull request may close these issues.

2 participants