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
md5: 93ea328d101025f6cca0a0865c4df0b4
Issue Description:
I discovered this while running swift with asan on Linux (which also checks for leaks). You should be able to just compile generic_casts.swift with -sanitize=address to reproduce.
******************** TEST 'Swift(linux-x86_64) :: Interpreter/generic_casts.swift' FAILED ******************** Script: -- : 'RUN: at line 1'; rm -rf "/Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/test-linux-x86_64/Interpreter/Output/generic_casts.swift.tmp" && mkdir -p "/Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/test-linux-x86_64/Interpreter/Output/generic_casts.swift.tmp" && /Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/bin/swiftc -target x86_64-unknown-linux-gnu -module-cache-path '/Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache' -swift-version 4 -module-cache-path '/Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache' /Users/docker_user/src/swift/test/Interpreter/generic_casts.swift -o /Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/test-linux-x86_64/Interpreter/Output/generic_casts.swift.tmp/a.out -module-name main -sanitize=address -g && echo /Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/test-linux-x86_64/Interpreter/Output/generic_casts.swift.tmp/a.out && /Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/test-linux-x86_64/Interpreter/Output/generic_casts.swift.tmp/a.out | '/usr/bin/python' '/Users/docker_user/src/swift/utils/PathSanitizingFileCheck' --sanitize BUILD_DIR='/Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64' --sanitize SOURCE_DIR='/Users/docker_user/src/swift' --use-filecheck '/Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/llvm-linux-x86_64/bin/FileCheck' /Users/docker_user/src/swift/test/Interpreter/generic_casts.swift : 'RUN: at line 2'; /Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/bin/swiftc -target x86_64-unknown-linux-gnu -module-cache-path '/Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache' -swift-version 4 -O /Users/docker_user/src/swift/test/Interpreter/generic_casts.swift -o /Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/test-linux-x86_64/Interpreter/Output/generic_casts.swift.tmp/a.out.optimized : 'RUN: at line 3'; echo /Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/test-linux-x86_64/Interpreter/Output/generic_casts.swift.tmp/a.out.optimized : 'RUN: at line 4'; /Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/test-linux-x86_64/Interpreter/Output/generic_casts.swift.tmp/a.out.optimized | '/usr/bin/python' '/Users/docker_user/src/swift/utils/PathSanitizingFileCheck' --sanitize BUILD_DIR='/Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64' --sanitize SOURCE_DIR='/Users/docker_user/src/swift' --use-filecheck '/Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/llvm-linux-x86_64/bin/FileCheck' /Users/docker_user/src/swift/test/Interpreter/generic_casts.swift -- Exit Code: 2 Command Output (stdout): -- /Users/docker_user/src/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/test-linux-x86_64/Interpreter/Output/generic_casts.swift.tmp/a.out -- Command Output (stderr): -- LLVMSymbolizer: error reading file: No such file or directory ================================================================= ==128919==ERROR: LeakSanitizer: detected memory leaks Direct leak of 96 byte(s) in 2 object(s) allocated from: #​0 0x5565a3d7e093 in malloc /Users/docker_user/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:146:3 #​1 0x7fdb8076b381 in swift_slowAlloc /Users/docker_user/src/swift/stdlib/public/runtime/Heap.cpp:80:9 #​2 0x7fdb80766040 in _dynamicCastToExistential(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetExistentialTypeMetadata<swift::InProcess> const*, swift::DynamicCastFlags)::$_9::operator()() const /Users/docker_user/src/swift/stdlib/public/runtime/Casting.cpp:785:19 #​3 0x7fdb80766040 in _dynamicCastToExistential(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetExistentialTypeMetadata<swift::InProcess> const*, swift::DynamicCastFlags) /Users/docker_user/src/swift/stdlib/public/runtime/Casting.cpp:854 #​4 0x7fff50c53f7f ([stack]+0x1ef7f)
The text was updated successfully, but these errors were encountered:
Keep in mind I am not sure if this is Linux specific.
Sorry, something went wrong.
I just tried the Feb 4th swift-4.2.2 toolchain. We leak on this code as well there.
I just tried on master with leaks -atExit – to see if we leak there. It seems to think we aren't leaking.
So this seems to be a linux specific problem.
mikeash
No branches or pull requests
Additional Detail from JIRA
md5: 93ea328d101025f6cca0a0865c4df0b4
Issue Description:
I discovered this while running swift with asan on Linux (which also checks for leaks). You should be able to just compile generic_casts.swift with -sanitize=address to reproduce.
The text was updated successfully, but these errors were encountered: