[SERVER-20266] Use ConstDataCursor to read buffer in Checksum::gen Created: 02/Sep/15  Updated: 05/Feb/16  Resolved: 22/Jan/16

Status: Closed
Project: Core Server
Component/s: Portability
Affects Version/s: 3.1.7
Fix Version/s: 3.3.1

Type: Bug Priority: Major - P3
Reporter: Bryan Chan Assignee: Tess Avitabile (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-22019 Checksum::gen should use signed char Closed
is related to SERVER-15112 14 of last 15 bytes of journal sectio... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms F (01/29/16)
Participants:

 Description   

Checksum::gen computes a checksum for a given buffer by casting the content of the buffer into 64-bit numbers, 8 bytes at a time. The casts and subsequent operations yield incorrect results on a big-endian system. A simple fix would be to wrap the buffer in a ConstDataCursor and read the 64-bit numbers in little-endian order.



 Comments   
Comment by Githook User [ 22/Jan/16 ]

Author:

{u'username': u'tessavitabile', u'name': u'Tess Avitabile', u'email': u'tess.avitabile@mongodb.com'}

Message: SERVER-20266 Use ConstDataCursor to read buffer in Checksum::gen
Branch: master
https://github.com/mongodb/mongo/commit/f73316532f829cd6dd95f8fdfe440e3c5d7e7fd1

Comment by Mark Benvenuto [ 23/Dec/15 ]

This is also failing on the ppc64 port, but for a different reason.

journal checkHash mismatch, got: 35807BDDC47867C3AA43823C7E35A1D8 expected: 35807BDDC47867C3AA43ABC651347E27

python buildscripts/resmoke.py  --dbpathPrefix=`pwd`/data -j1 --executor=durability jstests/dur/checksum.js

Generated at Thu Feb 08 03:53:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.