number_decimfmtprops.cpp has unaligned static memory

Description

The file has the following code:

We have a report that this causes a crash on ARM. The DecimalFormatProperties is being constructed into an unaligned char array, and the DecimalFormatProperties' MeasureUnit field assigns to an int32_t field in its ctor.

Possible fix: add alignas as follows:

Activity

Show:
Shane Carr
July 23, 2018, 10:42 PM

The fix should be included in a maintenance release if we have a 62 maintenance release.

Shane Carr
July 24, 2018, 9:33 PM

There is one other call site in my code where I did something similar; it is also missing the alignas. This should be fixed up at the same time:

https://github.com/unicode-org/icu/blob/master/icu4c/source/common/static_unicode_sets.cpp#L28

For reference, here is the site that caused the crash reports:

https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/number_decimfmtprops.cpp#L18

Fixed

Assignee

Shane Carr

Reporter

Shane Carr

Components

Reviewer

None

Priority

critical

Time Needed

None

Fix versions

Configure