| Summary: | ByteBuffer should use unsigned comparison with bound | ||
|---|---|---|---|
| Product: | frysk | Reporter: | Jeff Johnston <jjohnstn> |
| Component: | general | Assignee: | Unassigned <frysk-bugzilla> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | pmuldoon, qiyaoltc, timoore |
| Priority: | P1 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Host: | Target: | ||
| Build: | Last reconfirmed: | ||
| Project(s) to access: | ssh public key: | ||
| Bug Depends on: | 3388 | ||
| Bug Blocks: | 2127, 2231, 3119 | ||
Hi, Tim, Since you are working on this issue, I add you in the cc list. Any help on ppc64 side, let me know. Thanks! Fixed with inua/eio/ByteBuffer.java 1.4 |
The ByteBuffer get methods use a java comparison between the offset and the upper bound. This is a signed comparison and doesn't work if we have mapped the ByteBuffer onto a 64-bit memory space like on AMD64. A special unsigned comparison routine is required. In Java, this could be: boolean uLongLessThan (a, b) { if (a >=0 && b >= 0 || a < 0 && b < 0) return a < b; else return b < 0; } Alternatively, the comparison could be pushed down to cni code and done in C where unsigned comparisons can be made.