Project

General

Profile

Actions

Bug #4097

closed

Misaligned memory accesses in TLV decoding

Added by Davide Pesavento almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Base
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
4.50 h

Description

Build with '--with-sanitizer=undefined --with-tests' and run the unit tests. These are just a few examples.

../tests/unit-tests/data.t.cpp(123): Entering test case "DataEqualityChecks"
../src/encoding/tlv.hpp:269:66: runtime error: load of misaligned address 0x55cf8ceb89b1 for type 'const uint32_t', which requires 4 byte alignment
0x55cf8ceb89b1: note: pointer points here
 00 00 00  fe ff ff ff ff 00 00 00  70 3b e9 8c cf 55 00 00  e0 02 ea 8c cf 55 00 00  01 00 00 00 00
              ^ 

../tests/unit-tests/data.t.cpp(318): Entering test case "FullName"
../src/encoding/tlv.hpp:451:66: runtime error: load of misaligned address 0x55cf8ceca85f for type 'const uint16_t', which requires 2 byte alignment
0x55cf8ceca85f: note: pointer points here
 14 04 19 02 27  10 15 08 53 55 43 43 45  53 53 21 16 03 1b 01 00  17 20 9c 97 0c f4 5b b2  e6 2c 06
             ^ 

../tests/unit-tests/encoding/tlv.t.cpp(77): Entering test case "ReadFromBuffer"
/home/davide/ndn-cxx/src/encoding/tlv.hpp:260:66: runtime error: load of misaligned address 0x55cf8825f673 for type 'const uint16_t', which requires 2 byte alignment
0x55cf8825f673: note: pointer points here
 00  01 fc fd 00 fd fe 00 01  00 00 ff 00 00 00 01 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00
              ^ 

../tests/unit-tests/face.t.cpp(65): Entering test case "ExpressInterestData"
../src/interest.cpp:70:62: runtime error: load of misaligned address 0x55cf8ceac9e2 for type 'const uint32_t', which requires 4 byte alignment
0x55cf8ceac9e2: note: pointer points here
 00 00  0a 04 64 6d c3 30 00 00  40 c9 ea 8c cf 55 00 00  20 00 00 00 00 00 00 00  31 00 00 00 00 00
              ^ 

../tests/unit-tests/lp/cache-policy.t.cpp(59): Entering test case "DecodeUnknownPolicyError"
../src/encoding/tlv.hpp:260:66: runtime error: load of misaligned address 0x55cf8826fb31 for type 'const uint16_t', which requires 2 byte alignment
0x55cf8826fb31: note: pointer points here
 00 00 00  fd 03 34 08 fd 03 35 04  ff ff ff ff 00 00 00 00  fd 03 34 05 fd 03 35 01  01 00 00 00 00
              ^ 

Files

c4012,1_benchmark.txz (1.7 KB) c4012,1_benchmark.txz Junxiao Shi, 07/08/2017 10:36 AM

Related issues 2 (0 open2 closed)

Related to NFD - Bug #2768: Misaligned memory accesses in TLV decoding (and probably elsewhere)Rejected

Actions
Related to ndn-cxx - Feature #4172: Optimize TLV decoding for contiguous memory inputClosedJunxiao Shi

Actions
Actions

Also available in: Atom PDF