swiftlang / swift-corelibs-foundation

The Foundation Project, providing core utilities, internationalization, and OS independence
swift.org
Apache License 2.0
5.3k stars 1.14k forks source link

[SR-606] test_deserialize_allowFragments transacts upon uninitialized memory #4168

Closed phausler closed 5 years ago

phausler commented 8 years ago
Previous ID SR-606
Radar None
Original Reporter @phausler
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Foundation | |Labels | Bug | |Assignee | @spevans | |Priority | Medium | md5: 4a0e57f6d2d55dcbdd4df05221a2c0bc

relates to:

Issue Description:

Running the unit tests on occasion shows the failure:
TestFoundation/TestNSJSONSerialization.swift:312: error: TestNSJSONSerialization.test_deserialize_allowFragments : XCTAssertEqual failed: ("Optional(37.0)") is not equal to ("Optional(3.0)") -

or something along those lines depending on what junk memory is in the buffer. valgrind agrees with this assertion. Investigation needs to be done to determine what about the NSJSONSerialization double parsing is incorrect (likely a buffer length issue)

Dante-Broggi commented 6 years ago

Has this been resolved? If so, it should be closed.

spevans commented 5 years ago

In https://github.com/apple/swift-corelibs-foundation/pull/2557 The tests has been fixed up to work correctly and also validated against Darwin.

valgrind now shows no memory errors in test_deserialize_allowFragments although these were fixed by other changes unrelated to this PR.