View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0033176 | Community | OCCT:Foundation Classes | public | 2022-10-19 23:52 | 2022-10-19 23:52 |
Reporter | irschcaldsh | Assigned To | |||
Priority | normal | Severity | crash | ||
Status | new | Resolution | open | ||
Platform | Linux | OS | Ubuntu 20.04 | ||
Product Version | 7.5.3 | ||||
Summary | 0033176: UnitsAPI::AnyToAny reports incorrect unit conversion or segfaults when called with example arguments from API Documentation | ||||
Description | The documentation for UnitsAPI::AnyToAny includes an example for converting inches to millimeters. However, when I call UnitsAPI::AnyToAny with the arguments from the example, I get `Units_Measurement: can not convert - incorrect unit => result is not correct` spammed to stderr, and a value of 1.0 is returned, regardless of what is specified for the 'aData' argument. Re-arranging the arguments in the example to convert from millimeters to inches results in a segmentation fault. | ||||
Steps To Reproduce | #include <UnitsAPI.hxx> /** ... */ double inchesToMM = UnitsAPI::AnyToAny(1.0, "in.", "millimeter"); // <= Returns 1.0 rather than 25.4 and prints "Units_Measurement: can not convert - incorrect unit => result is not correct" to stderr double inchesToMM = UnitsApi::AnyToAny(1.0, "millimeter", "in."); // <= Segmentation Fault | ||||
Additional information and documentation updates | The call stack of the segmentation fault is: libTKernel.so.7!TCollection_AsciiString::TCollection_AsciiString(TCollection_AsciiString const&) libTKernel.so.7!Units_Token::Divide(opencascade::handle<Units_Token> const&) const libTKernel.so.7!operator/(opencascade::handle<Units_Token> const&, opencascade::handle<Units_Token> const&) libTKernel.so.7!Units_Measurement::Convert(char const*) libTKernel.so.7!Units::Convert(double, char const*, char const*) This is from a debug build of OCCT 7.5.3, but apparently CMake strips the binaries of the debug build for some reason, so I'm not sure exactly where or why the crash is occurring. | ||||
Tags | No tags attached. | ||||
Test case number | |||||
Date Modified | Username | Field | Change |
---|---|---|---|
2022-10-19 23:52 | irschcaldsh | New Issue | |
2022-10-19 23:52 | irschcaldsh | Assigned To | => abv |