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

undefined-behavior /include/boost/multiprecision/cpp_int/import_export.hpp #556

Closed
Wayonb opened this issue May 22, 2023 · 4 comments
Closed

Comments

@Wayonb
Copy link

Wayonb commented May 22, 2023

While running our unit tests with UndefinedBehaviorSanitizer, we hit an error condition. The error did not seems to be related to our code so I took first example and it reproduce the same error.
https://www.boost.org/doc/libs/1_80_0/libs/multiprecision/doc/html/boost_multiprecision/tut/import_export.html#boost_multiprecision.tut.import_export.examples

Is this is a known issue or am I missing something?

/mybuild/include/boost/multiprecision/cpp_int/import_export.hpp:112:54: runtime error: implicit conversion from type 'difference_type' (aka 'long') of value -8 (64-bit, signed) to type 'unsigned long' changed the value to 18446744073709551608 (64-bit, unsigned)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mybuild/include/boost/multiprecision/cpp_int/import_export.hpp:112:54 in 
/mybuild/include/boost/multiprecision/cpp_int/import_export.hpp:112:42: runtime error: implicit conversion from type 'unsigned long' of value 18446744073709551608 (64-bit, unsigned) to type 'difference_type' (aka 'long') changed the value to -8 (64-bit, signed)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /mybuild/include/boost/multiprecision/cpp_int/import_export.hpp:112:42 in 
@Wayonb Wayonb changed the title undefined-behavior /mybuild/include/boost/multiprecision/cpp_int/import_export.hpp undefined-behavior /include/boost/multiprecision/cpp_int/import_export.hpp May 23, 2023
@mborland
Copy link
Member

What version of boost are you using? The docs link is 1.80, and there was a fix applied in 1.81. On current develop with GCC-13.1.1 on Fedora 38 I can not replicate the UBSAN error with the linked example.

@Wayonb
Copy link
Author

Wayonb commented May 24, 2023

What version of boost are you using? The docs link is 1.80, and there was a fix applied in 1.81. On current develop with GCC-13.1.1 on Fedora 38 I can not replicate the UBSAN error with the linked example.

@mborland Thanks for the quick reply.
We had another issues with boost 1.81 which prevented us from upgrade. I see boost 1.82 is also release but will try upgrading after Conan package is released.

@ckormanyos
Copy link
Member

will try upgrading after Conan package is released

Hi @Wayonb I'm going through our Multiprecision issues. Do you have an updated report for this? Is the issue still present/known/active?

@Wayonb
Copy link
Author

Wayonb commented Aug 28, 2023

@ckormanyos I will close until we have time to update. Thanks.

@Wayonb Wayonb closed this as completed Aug 28, 2023
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

No branches or pull requests

3 participants