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-9481] Swift 5: Memory mismanagement on Linux #51943
Comments
@gottesmm, @slavapestov, look familiar? |
Yup, but it's not very helpful. The full output is below (basically identical in release and debug modes): AddressSanitizer:DEADLYSIGNAL
=================================================================
==207==ERROR: AddressSanitizer: SEGV on unknown address 0x56325e00003d (pc 0x7f3b0e664aa8 bp 0x7fffaa997110 sp 0x7fffaa995cf0 T0)
==207==The signal is caused by a READ memory access.
#​0 0x7f3b0e664aa7 (/root/.swift/usr/lib/swift/linux/libswiftCore.so+0x399aa7)
#​1 0x5632f0b7c7fe (/code/.build/x86_64-unknown-linux/release/swift-nio-http2PackageTests.xctest+0x5fd7fe)
#​2 0x5632f0b6b9b0 (/code/.build/x86_64-unknown-linux/release/swift-nio-http2PackageTests.xctest+0x5ec9b0)
#​3 0x5632f0b6be18 (/code/.build/x86_64-unknown-linux/release/swift-nio-http2PackageTests.xctest+0x5ece18)
#​4 0x5632f06b881b (/code/.build/x86_64-unknown-linux/release/swift-nio-http2PackageTests.xctest+0x13981b)
#​5 0x5632f0b6b9d0 (/code/.build/x86_64-unknown-linux/release/swift-nio-http2PackageTests.xctest+0x5ec9d0)
#​6 0x5632f0b6bc08 (/code/.build/x86_64-unknown-linux/release/swift-nio-http2PackageTests.xctest+0x5ecc08)
#​7 0x7f3b0e909600 (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x30600)
#​8 0x7f3b0e90942b (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x3042b)
#​9 0x7f3b0e909393 (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x30393)
#​10 0x7f3b0e909668 (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x30668)
#​11 0x7f3b0e8fb4c6 (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x224c6)
#​12 0x7f3b0e907ddc (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x2eddc)
#​13 0x7f3b0e9076dc (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x2e6dc)
#​14 0x7f3b0e90bde1 (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x32de1)
#​15 0x7f3b0e9099d7 (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x309d7)
#​16 0x7f3b0e90bde1 (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x32de1)
#​17 0x7f3b0e9099d7 (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x309d7)
#​18 0x7f3b0e90bde1 (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x32de1)
#​19 0x7f3b0e9099ef (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x309ef)
#​20 0x7f3b0e90bde1 (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x32de1)
#​21 0x7f3b0e906452 (/root/.swift/usr/lib/swift/linux/libXCTest.so+0x2d452)
#​22 0x5632f0d0413f (/code/.build/x86_64-unknown-linux/release/swift-nio-http2PackageTests.xctest+0x78513f)
#​23 0x7f3b0bc7cb96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
#​24 0x5632f068f479 (/code/.build/x86_64-unknown-linux/release/swift-nio-http2PackageTests.xctest+0x110479)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/root/.swift/usr/lib/swift/linux/libswiftCore.so+0x399aa7)
==207==ABORTING (The reproducer is the same: swift-nio-http2's test suite. I have still not been able to reproduce this on macOS, or in a different repo, but I suspect that's because I don't know what specific situation is triggering this. |
This continues to manifest with the most recent Swift 5 snapshot (from the 28th of December). |
Obtaining a reproducer is simple enough if you have Docker for Mac installed: git clone https://github.com/apple/swift-nio-http2.git && cd swift-nio-http2 && docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.1804.50.yaml run test In the absence of Docker for Mac, obtaining a machine with Ubuntu 18.04 and a recent Swift 5 snapshot can be used to hit the issue as well: git clone https://github.com/apple/swift-nio-http2.git && cd swift-nio-http2 && swift test |
Created tracking radar: rdar://47020961 |
Incidentally, this reproduces in both release and debug mode, so I don't think there's any concern around the behaviour of the optimiser here. |
still happening with the toolchain from the 20th Jan:
|
and because @gottesmm requested the ASan (symbolication is at the end):
|
Attachment: Download
Environment
Swift version 5.0-dev (LLVM 9a8bf9ce12, Clang eba26b8d1c, Swift b74d54a)
Target: x86_64-unknown-linux-gnu
Additional Detail from JIRA
md5: 65641d9eaf1880afa480ebf91c9c2308
Issue Description:
When running the unit tests for swift-nio-http2 (https://github.com/apple/swift-nio-http2)'s master branch on Linux under the latest Swift 5 snapshot, the tests reliably segmentation fault partway through their execution.
When the tests are run under valgrind, we get substantial output. The full output is attached, but here is a sample:
This output seems to suggest that we are double-freeing
HTTP2Frame
objects that are stored in an array of some kind.So far I have not been able to produce a smaller reproducer, though I'll work on doing this. I also have so far failed to reproduce on macOS, though I'll also pursue doing that.
The text was updated successfully, but these errors were encountered: