Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-3122] RepositoryManagerTests failes with malloc_error_break #5181

Closed
swift-ci opened this issue Nov 3, 2016 · 8 comments
Closed

[SR-3122] RepositoryManagerTests failes with malloc_error_break #5181

swift-ci opened this issue Nov 3, 2016 · 8 comments
Labels

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Nov 3, 2016

Previous ID SR-3122
Radar rdar://problem/29081201
Original Reporter erg (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Package Manager, XCTest
Labels Bug
Assignee None
Priority Medium

Watchers: @shahmishal

md5: 637213f7d97f0b64f7100d9f5be79ac0

relates to:

  • SR-2996 ByteStringTests failure on OSX CI
  • SR-3139 Test Case '-[FunctionalTests.MiscellaneousTestCase testSwiftTestParallelAndReturnError:]' failed

Issue Description:

Test Suite 'RepositoryManagerTests' started at 2016-11-02 09:45:59.171
Test Case '-[SourceControlTests.RepositoryManagerTests testBasicsAndReturnError:]' started.
xctest(67732,0x7fff79ae6000) malloc: *** error for object 0x7fb4969a7418: incorrect checksum for freed object - object was probably modified after being freed.

      • set a breakpoint in malloc_error_break to debug
      • bootstrap: error: tests failed with exit status 1
        /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
        /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
        Build step 'Execute shell' marked build as failure
        [BFA] Scanning build for known causes...
        ..[BFA] Found failure cause(s):
        [BFA] Compile Error from category Compile
        [BFA] Done. 2s
        [WS-CLEANUP] Deleting project workspace...[WS-CLEANUP] done
        Finished: FAILURE
@swift-ci
Copy link
Contributor Author

swift-ci commented Nov 3, 2016

@ankitspd
Copy link
Member

ankitspd commented Nov 3, 2016

This is definitely some bug in either XCTest or maybe NSCondition (macOS) ... I am not sure which but I was able to create a minimal test case which can reproduces this bug (https://github.com/aciidb0mb3r/malloc_error/blob/master/Tests/mallocTests/mallocTests.swift#L6) . It happens very rarely ~ 1 in 500 runs.

How to reproduce?

$ xcrun --find swift
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-11-01-a.xctoolchain/usr/bin/swift
$ git clone https://github.com/aciidb0mb3r/malloc_error
$ cd malloc_error
$ swift test
$ seq 500 | xargs -Iz swift test --skip-build

There would be atleast one test output with:

Test Suite 'All tests' started at 2016-11-03 11:37:12.656
Test Suite 'mallocPackageTests.xctest' started at 2016-11-03 11:37:12.657
Test Suite 'mallocTests' started at 2016-11-03 11:37:12.657
Test Case '-[mallocTests.mallocTests testExample]' started.
Test Case '-[mallocTests.mallocTests testExample]' passed (0.001 seconds).
Test Suite 'mallocTests' passed at 2016-11-03 11:37:12.658.
     Executed 1 test, with 0 failures (0 unexpected) in 0.001 (0.001) seconds
Test Suite 'mallocPackageTests.xctest' passed at 2016-11-03 11:37:12.658.
     Executed 1 test, with 0 failures (0 unexpected) in 0.001 (0.001) seconds
Test Suite 'All tests' passed at 2016-11-03 11:37:12.658.
     Executed 1 test, with 0 failures (0 unexpected) in 0.001 (0.002) seconds
xctest(14092,0x7fffde2be3c0) malloc: *** error for object 0x7fbc19c03e18: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

@ddunbar
Copy link
Member

ddunbar commented Nov 3, 2016

/cc @phausler

@phausler
Copy link
Member

phausler commented Nov 3, 2016

That looks like proper usage of NSCondition. Does this fail on Darwin too?

@ankitspd
Copy link
Member

ankitspd commented Nov 3, 2016

This is a Darwin bug so far (I am not sure if we had case where it failed on Linux yet)

@shahmishal
Copy link
Member

We keep on seeing this on CI, is it possible to disable the test while you are looking into the test?

https://ci.swift.org//job/oss-swift-incremental-RA-osx/7093/consoleFull#-1565336843ee1a197b-acac-4b17-83cf-a53b95139a76

Test Case '-[FunctionalTests.MiscellaneousTestCase testSwiftTestParallelAndReturnError:]' started.
/Users/buildnode/jenkins/workspace/oss-swift-incremental-RA-osx/swiftpm/Tests/FunctionalTests/MiscellaneousTests.swift:377: error: -[FunctionalTests.MiscellaneousTestCase testSwiftTestParallelAndReturnError:] : failed - executionFailure(error: exit(1): /Users/buildnode/jenkins/workspace/oss-swift-incremental-RA-osx/buildbot_incremental/swiftpm-macosx-x86_64/debug/swift-test --chdir /var/folders/_8/79jmzf2142z2xydc_01btlx00000gn/T/Miscellaneous_ParallelTestsPkg.K20E81/Miscellaneous_ParallelTestsPkg --parallel, output: "Tests\n50%: ParallelTestsPkgTests.ParallelTestsTests/testExample1\n100%: ParallelTestsPkgTests.ParallelTestsTests/testExample2\n\nTest Suite \'Selected tests\' started at 2016-11-07 17:55:39.037\nTest Suite \'ParallelTestsPkgPackageTests.xctest\' started at 2016-11-07 17:55:39.038\nTest Suite \'ParallelTestsTests\' started at 2016-11-07 17:55:39.038\nTest Case \'-[ParallelTestsPkgTests.ParallelTestsTests testExample1]\' started.\nTest Case \'-[ParallelTestsPkgTests.ParallelTestsTests testExample1]\' passed (0.001 seconds).\nTest Suite \'ParallelTestsTests\' passed at 2016-11-07 17:55:39.039.\n\t Executed 1 test, with 0 failures (0 unexpected) in 0.001 (0.001) seconds\nxctest(8816,0x7fff76458000) malloc: *** error for object 0x7f80ab813e18: incorrect checksum for freed object - object was probably modified after being freed.\n*** set a breakpoint in malloc_error_break to debug\n")
Test Case '-[FunctionalTests.MiscellaneousTestCase testSwiftTestParallelAndReturnError:]' failed (5.729 seconds).

@ankitspd
Copy link
Member

ankitspd commented Nov 8, 2016

There are many places where we use NSCondition but since this was failing more than other tests disabled it here 5a239a3

@ankitspd
Copy link
Member

This was fixed by apple/swift#5852

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants