[ppc64le] test-idmap unit test failure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ofono (Ubuntu) |
Fix Released
|
Low
|
Tony Espy |
Bug Description
We made a change recently to the ofono ( 1.12+bzr6851-
This had the unfortunate side-effect of breaking the build on powerpc ( which isn't run by CI, it's only triggered by a release ) as the unit tests for the low-level grilrequest.c, grilreply.c, and grilunsol.c ( used by rilmodem ) include #if statements to prevent compilation if the BYTE_ORDER of the platform is not LITTLE_ENDIAN.
This is due to the fact that the unit tests include byte arrays that represent Binder parcels in wire-format, and unfortunately the Binder wire-format differs slightly depending on endian-ness of the platform.
The short-term fix was to extend the #if BYTE_ORDER check to cover the entire unit test files, so that errors are not thrown for the unused functions and variables.
To fix correctly will require fixes to the parcel data bytes arrays via further #if statements.
Related branches
- PS Jenkins bot: Approve (continuous-integration)
- Ricardo Salveti: Pending requested
-
Diff: 64 lines (+12/-6)2 files modifieddebian/changelog (+8/-2)
src/idmap.c (+4/-4)
Changed in ofono (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → Low |
assignee: | nobody → Tony Espy (awe) |
A couple of comments...
1. The idmap code implements a collection used to trace the use of generic ids ( unsigned int ). It's only usage within ofono is within the gprs code for the purpose of tracking context ids.
2. The code uses bit arrays overlaid onto unsigned longs. The bits are set/cleared using a bit shit operator ( << ). From what I can tell this operation only supports 32-bits, and wraps when given a value that exceeds 32 bits.
3. On standard 64-bit architectures, the bit-shift operator wraps as described above. On ppc64le, it returns 0 past 32-bits. This is what causes the failure of the idmap_alloc_next() operation when it's expected to wrap from the maximum idmap value to the minimum ( if available ).
4. I'm working on creating a pull-request which will adjust the unit test to use a smaller idmap, and to exclude the wrap case ( ie. from 256->1 ).