Open finagolfin opened 1 month ago
Do you happen to get a backtrace from these segfaults?
Sure, but only the first might be helpful (I don't have the forked lldb working natively on Android yet, so these are the mangled symbols from regular lldb):
NIOCoreTests.ByteBufferTest/testExpansionOfCapacityWithPadding:
* thread #1, name = 'swift-nioPackag', stop reason = signal SIGILL: illegal opcode
* frame #0: 0x012a7a64 swift-nioPackageTests.xctest`$ss6UInt32V7NIOCoreE24nextPowerOf2ClampedToMaxAByF at <compiler-generated>:0
frame #1: 0x0129afc0 swift-nioPackageTests.xctest`$s7NIOCore10ByteBufferV23roundUpToUsableCapacityys6UInt32VAFFZ at ByteBuffer-core.swift:912:52
frame #2: 0x0145a4c4 swift-nioPackageTests.xctest`$s12NIOCoreTests14ByteBufferTestC34testExpansionOfCapacityWithPaddingyyKFs6UInt32VyKXEfu5_ at <compiler-generated>:0
frame #3: 0xf34d0cc0 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlFAA19_XCTAssertionResult33_F1DE58039960C6E2C9E25CD38F016B36LLOyKXEfU_Tm + 88
frame #4: 0xf34d1ec4 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlFAA19_XCTAssertionResult33_F1DE58039960C6E2C9E25CD38F016B36LLOyKXEfU_TATm + 60
frame #5: 0xf34d1b68 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlFAA19_XCTAssertionResult33_F1DE58039960C6E2C9E25CD38F016B36LLOyKXEfU_TA + 40
frame #6: 0xf34d20f4 libXCTest.so`$s6XCTest21_XCTEvaluateAssertion33_F1DE58039960C6E2C9E25CD38F016B36LL_7message4file4line10expressionyAA13_XCTAssertionACLLO_SSyXKs12StaticStringVSuAA01_Q6ResultACLLOyKXEtF058$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12rS18VSutSQRzlFSSyXEfu_SSIgo_Tf1ncnnn_nTf4nnnng_nTm + 40
frame #7: 0xf34d1040 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlFTm + 100
frame #8: 0xf34d2758 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlF + 92
frame #9: 0x014fb4f8 swift-nioPackageTests.xctest`$s12NIOCoreTests14ByteBufferTestC34testExpansionOfCapacityWithPaddingyyKF at ByteBufferTest.swift:1926:9
frame #10: 0x0218ca8c swift-nioPackageTests.xctest`$s12NIOCoreTests14ByteBufferTestC026swift_nioPackageDiscoveredB0E05__allb2__cdE033_1192793151C0C8614E65CA5882CC8A81LLSaySS_yyKcACctGvpZfiyyKcACcfu165_yyKcfu166_ at NIOCoreTests.swift:236:48
frame #11: 0x021b0b78 swift-nioPackageTests.xctest`$s12NIOCoreTests14ByteBufferTestC026swift_nioPackageDiscoveredB0E05__allb2__cdE033_1192793151C0C8614E65CA5882CC8A81LLSaySS_yyKcACctGvpZfiyyKcACcfu165_yyKcfu166_TA at <compiler-generated>:0
frame #12: 0x012fcc88 swift-nioPackageTests.xctest`$ss5Error_pIegzo_ytsAA_pIegrzo_TR at <compiler-generated>:0
frame #13: 0x021b1030 swift-nioPackageTests.xctest`$ss5Error_pIegzo_ytsAA_pIegrzo_TRTA.3174 at <compiler-generated>:0
frame #14: 0xf34c8854 libXCTest.so`$syts5Error_pIegrzo_sAA_pIegzo_TRTA + 20
frame #15: 0xf34c7c50 libXCTest.so`$s6XCTest4test33_3BE257A46ADB477C7BF2D39968B39F9DLLyyAA0A4CaseCKcyyKcxcAERbzlFyAEKcfU_ + 80
frame #16: 0xf34c87c4 libXCTest.so`$s6XCTest4test33_3BE257A46ADB477C7BF2D39968B39F9DLLyyAA0A4CaseCKcyyKcxcAERbzlFyAEKcfU_TA + 24
frame #17: 0xf34c87a8 libXCTest.so`$s6XCTest0A4CaseCs5Error_pIeggzo_ACytsAD_pIegnrzo_TRTA + 24
frame #18: 0xf34c8aec libXCTest.so`$s6XCTest0A4CaseCs5Error_pIeggzo_ACytsAD_pIegnrzo_TRTA.30 + 12
frame #19: 0xf34c6940 libXCTest.so`$s6XCTest0A4CaseCyts5Error_pIegnrzo_ACsAD_pIeggzo_TRTA + 32
frame #20: 0xf34c8e54 libXCTest.so`$s6XCTest0A4CaseC10invokeTestyyF + 196
frame #21: 0xf34c8bc0 libXCTest.so`$s6XCTest0A4CaseC7performyyAA0A3RunCF + 128
frame #22: 0xf34cc3a0 libXCTest.so`$s6XCTestAAC3runyyF + 172
frame #23: 0xf34ca420 libXCTest.so`$s6XCTest0A5SuiteC7performyyAA0A3RunCF + 164
frame #24: 0xf34cc3a0 libXCTest.so`$s6XCTestAAC3runyyF + 172
frame #25: 0xf34ca420 libXCTest.so`$s6XCTest0A5SuiteC7performyyAA0A3RunCF + 164
frame #26: 0xf34cc3a0 libXCTest.so`$s6XCTestAAC3runyyF + 172
frame #27: 0xf34c6bf4 libXCTest.so`$s6XCTest7XCTMain_9arguments9observerss5Int32VSayAA0A4CaseCm04testF5Class_SaySS_yAHKctG8allTeststG_SaySSGSayAA0A11Observation_pGSgtF + 356
frame #28: 0xf34c6cb0 libXCTest.so`$s6XCTest7XCTMainys5NeverOSayAA0A4CaseCm04testD5Class_SaySS_yAFKctG8allTeststGF + 36
frame #29: 0x022f4d6c swift-nioPackageTests.xctest`$s21swift_nioPackageTests6RunnerV4mainyyFZ at runner.swift:543:14
frame #30: 0x022f4d90 swift-nioPackageTests.xctest`$s21swift_nioPackageTests6RunnerV5$mainyyFZ at <compiler-generated>:0
frame #31: 0x022f4da4 swift-nioPackageTests.xctest`main at runner.swift:509:8
frame #32: 0xf49a8a58 libc.so`__libc_init + 56
NIOPosixTests.ChannelTests/testPendingWritesNoMoreThanWritevLimitIsWritten:
* thread #1, name = 'swift-nioPackag', stop reason = signal SIGILL: illegal opcode
* frame #0: 0x01bf6090 swift-nioPackageTests.xctest`$s13NIOPosixTests07ChannelB0C47testPendingWritesNoMoreThanWritevLimitIsWrittenyyKFy0A00e6StreamF7ManagerCKXEfU3_s5Int64VyKXEfu_ at <compiler-generated>:0
frame #1: 0x01c2a4dc swift-nioPackageTests.xctest`$s13NIOPosixTests07ChannelB0C47testPendingWritesNoMoreThanWritevLimitIsWrittenyyKFy0A00e6StreamF7ManagerCKXEfU3_s5Int64VyKXEfu_TA at <compiler-generated>:0
frame #2: 0xf6a7fcc0 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlFAA19_XCTAssertionResult33_F1DE58039960C6E2C9E25CD38F016B36LLOyKXEfU_Tm + 88
frame #3: 0xf6a80ec4 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlFAA19_XCTAssertionResult33_F1DE58039960C6E2C9E25CD38F016B36LLOyKXEfU_TATm + 60
frame #4: 0xf6a80b68 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlFAA19_XCTAssertionResult33_F1DE58039960C6E2C9E25CD38F016B36LLOyKXEfU_TA + 40
frame #5: 0xf6a810f4 libXCTest.so`$s6XCTest21_XCTEvaluateAssertion33_F1DE58039960C6E2C9E25CD38F016B36LL_7message4file4line10expressionyAA13_XCTAssertionACLLO_SSyXKs12StaticStringVSuAA01_Q6ResultACLLOyKXEtF058$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12rS18VSutSQRzlFSSyXEfu_SSIgo_Tf1ncnnn_nTf4nnnng_nTm + 40
frame #6: 0xf6a80040 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlFTm + 100
frame #7: 0xf6a81758 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlF + 92
frame #8: 0x01bf59d8 swift-nioPackageTests.xctest`$s13NIOPosixTests07ChannelB0C47testPendingWritesNoMoreThanWritevLimitIsWrittenyyKFy0A00e6StreamF7ManagerCKXEfU3_ at ChannelTests.swift:872:13
frame #9: 0x01c21abc swift-nioPackageTests.xctest`$s13NIOPosixTests07ChannelB0C47testPendingWritesNoMoreThanWritevLimitIsWrittenyyKFy0A00e6StreamF7ManagerCKXEfU3_TA at <compiler-generated>:0
frame #10: 0x01c2ea18 swift-nioPackageTests.xctest`$s13NIOPosixTests07ChannelB0C30withPendingStreamWritesManager33_A3611E8D999A72A231496C7AEE437106LLyyy0A00efgH0CKXEKF at ChannelTests.swift:248:13
frame #11: 0x01c30ca8 swift-nioPackageTests.xctest`$s13NIOPosixTests07ChannelB0C47testPendingWritesNoMoreThanWritevLimitIsWrittenyyKF at ChannelTests.swift:866:13
frame #12: 0x02251614 swift-nioPackageTests.xctest`$s13NIOPosixTests07ChannelB0C026swift_nioPackageDiscoveredB0E05__allb2__cB033_9F771D8F09D0BFCC37C47CF6B2F1EF5CLLSaySS_yyKcACctGvpZfiyyKcACcfu81_yyKcfu82_ at NIOPosixTests.swift:237:61
frame #13: 0x0227bf84 swift-nioPackageTests.xctest`$s13NIOPosixTests07ChannelB0C026swift_nioPackageDiscoveredB0E05__allb2__cB033_9F771D8F09D0BFCC37C47CF6B2F1EF5CLLSaySS_yyKcACctGvpZfiyyKcACcfu81_yyKcfu82_TA at <compiler-generated>:0
frame #14: 0x012fcc88 swift-nioPackageTests.xctest`$ss5Error_pIegzo_ytsAA_pIegrzo_TR at <compiler-generated>:0
frame #15: 0x0227c2c8 swift-nioPackageTests.xctest`$ss5Error_pIegzo_ytsAA_pIegrzo_TRTA.4121 at <compiler-generated>:0
frame #16: 0xf6a77854 libXCTest.so`$syts5Error_pIegrzo_sAA_pIegzo_TRTA + 20
frame #17: 0xf6a76c50 libXCTest.so`$s6XCTest4test33_3BE257A46ADB477C7BF2D39968B39F9DLLyyAA0A4CaseCKcyyKcxcAERbzlFyAEKcfU_ + 80
frame #18: 0xf6a777c4 libXCTest.so`$s6XCTest4test33_3BE257A46ADB477C7BF2D39968B39F9DLLyyAA0A4CaseCKcyyKcxcAERbzlFyAEKcfU_TA + 24
frame #19: 0xf6a777a8 libXCTest.so`$s6XCTest0A4CaseCs5Error_pIeggzo_ACytsAD_pIegnrzo_TRTA + 24
frame #20: 0xf6a77aec libXCTest.so`$s6XCTest0A4CaseCs5Error_pIeggzo_ACytsAD_pIegnrzo_TRTA.30 + 12
frame #21: 0xf6a75940 libXCTest.so`$s6XCTest0A4CaseCyts5Error_pIegnrzo_ACsAD_pIeggzo_TRTA + 32
frame #22: 0xf6a77e54 libXCTest.so`$s6XCTest0A4CaseC10invokeTestyyF + 196
frame #23: 0xf6a77bc0 libXCTest.so`$s6XCTest0A4CaseC7performyyAA0A3RunCF + 128
frame #24: 0xf6a7b3a0 libXCTest.so`$s6XCTestAAC3runyyF + 172
frame #25: 0xf6a79420 libXCTest.so`$s6XCTest0A5SuiteC7performyyAA0A3RunCF + 164
frame #26: 0xf6a7b3a0 libXCTest.so`$s6XCTestAAC3runyyF + 172
frame #27: 0xf6a79420 libXCTest.so`$s6XCTest0A5SuiteC7performyyAA0A3RunCF + 164
frame #28: 0xf6a7b3a0 libXCTest.so`$s6XCTestAAC3runyyF + 172
frame #29: 0xf6a75bf4 libXCTest.so`$s6XCTest7XCTMain_9arguments9observerss5Int32VSayAA0A4CaseCm04testF5Class_SaySS_yAHKctG8allTeststG_SaySSGSayAA0A11Observation_pGSgtF + 356
frame #30: 0xf6a75cb0 libXCTest.so`$s6XCTest7XCTMainys5NeverOSayAA0A4CaseCm04testD5Class_SaySS_yAFKctG8allTeststGF + 36
frame #31: 0x022f4d6c swift-nioPackageTests.xctest`$s21swift_nioPackageTests6RunnerV4mainyyFZ at runner.swift:543:14
frame #32: 0x022f4d90 swift-nioPackageTests.xctest`$s21swift_nioPackageTests6RunnerV5$mainyyFZ at <compiler-generated>:0
frame #33: 0x022f4da4 swift-nioPackageTests.xctest`main at runner.swift:509:8
frame #34: 0xf7709a58 libc.so`__libc_init + 56
NIOPosixTests.PendingDatagramWritesManagerTests/testPendingWritesNoMoreThanWritevLimitIsWritten:
* thread #1, name = 'swift-nioPackag', stop reason = signal SIGILL: illegal opcode
* frame #0: 0x01e370d4 swift-nioPackageTests.xctest`$s13NIOPosixTests028PendingDatagramWritesManagerB0C04testcE30NoMoreThanWritevLimitIsWrittenyyKFy0A00cdeF0CKXEfU3_s5Int64VyKXEfu_ at <compiler-generated>:0
frame #1: 0x01e3e1a4 swift-nioPackageTests.xctest`$s13NIOPosixTests028PendingDatagramWritesManagerB0C04testcE30NoMoreThanWritevLimitIsWrittenyyKFy0A00cdeF0CKXEfU3_s5Int64VyKXEfu_TA at <compiler-generated>:0
frame #2: 0xf39c8cc0 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlFAA19_XCTAssertionResult33_F1DE58039960C6E2C9E25CD38F016B36LLOyKXEfU_Tm + 88
frame #3: 0xf39c9ec4 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlFAA19_XCTAssertionResult33_F1DE58039960C6E2C9E25CD38F016B36LLOyKXEfU_TATm + 60
frame #4: 0xf39c9b68 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlFAA19_XCTAssertionResult33_F1DE58039960C6E2C9E25CD38F016B36LLOyKXEfU_TA + 40
frame #5: 0xf39ca0f4 libXCTest.so`$s6XCTest21_XCTEvaluateAssertion33_F1DE58039960C6E2C9E25CD38F016B36LL_7message4file4line10expressionyAA13_XCTAssertionACLLO_SSyXKs12StaticStringVSuAA01_Q6ResultACLLOyKXEtF058$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12rS18VSutSQRzlFSSyXEfu_SSIgo_Tf1ncnnn_nTf4nnnng_nTm + 40
frame #6: 0xf39c9040 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlFTm + 100
frame #7: 0xf39ca758 libXCTest.so`$s6XCTest14XCTAssertEqual___4file4lineyxyKXK_xyKXKSSyXKs12StaticStringVSutSQRzlF + 92
frame #8: 0x01e36a4c swift-nioPackageTests.xctest`$s13NIOPosixTests028PendingDatagramWritesManagerB0C04testcE30NoMoreThanWritevLimitIsWrittenyyKFy0A00cdeF0CKXEfU3_ at PendingDatagramWritesManagerTests.swift:591:13
frame #9: 0x01e3cc94 swift-nioPackageTests.xctest`$s13NIOPosixTests028PendingDatagramWritesManagerB0C04testcE30NoMoreThanWritevLimitIsWrittenyyKFy0A00cdeF0CKXEfU3_TA at <compiler-generated>:0
frame #10: 0x01e411e8 swift-nioPackageTests.xctest`$s13NIOPosixTests028PendingDatagramWritesManagerB0C04withcdeF033_AEEAD37E065DB1E94E42D5BA25AEE466LLyyy0A00cdeF0CKXEKF at PendingDatagramWritesManagerTests.swift:60:13
frame #11: 0x01e438d0 swift-nioPackageTests.xctest`$s13NIOPosixTests028PendingDatagramWritesManagerB0C04testcE30NoMoreThanWritevLimitIsWrittenyyKF at PendingDatagramWritesManagerTests.swift:583:13
frame #12: 0x0226ca84 swift-nioPackageTests.xctest`$s13NIOPosixTests028PendingDatagramWritesManagerB0C026swift_nioPackageDiscoveredB0E05__allb2__cdefB033_9F771D8F09D0BFCC37C47CF6B2F1EF5CLLSaySS_yyKcACctGvpZfiyyKcACcfu7_yyKcfu8_ at NIOPosixTests.swift:784:61
frame #13: 0x02278b6c swift-nioPackageTests.xctest`$s13NIOPosixTests028PendingDatagramWritesManagerB0C026swift_nioPackageDiscoveredB0E05__allb2__cdefB033_9F771D8F09D0BFCC37C47CF6B2F1EF5CLLSaySS_yyKcACctGvpZfiyyKcACcfu7_yyKcfu8_TA at <compiler-generated>:0
frame #14: 0x012fcc88 swift-nioPackageTests.xctest`$ss5Error_pIegzo_ytsAA_pIegrzo_TR at <compiler-generated>:0
frame #15: 0x02278bf0 swift-nioPackageTests.xctest`$ss5Error_pIegzo_ytsAA_pIegrzo_TRTA.3929 at <compiler-generated>:0
frame #16: 0xf39c0854 libXCTest.so`$syts5Error_pIegrzo_sAA_pIegzo_TRTA + 20
frame #17: 0xf39bfc50 libXCTest.so`$s6XCTest4test33_3BE257A46ADB477C7BF2D39968B39F9DLLyyAA0A4CaseCKcyyKcxcAERbzlFyAEKcfU_ + 80
frame #18: 0xf39c07c4 libXCTest.so`$s6XCTest4test33_3BE257A46ADB477C7BF2D39968B39F9DLLyyAA0A4CaseCKcyyKcxcAERbzlFyAEKcfU_TA + 24
frame #19: 0xf39c07a8 libXCTest.so`$s6XCTest0A4CaseCs5Error_pIeggzo_ACytsAD_pIegnrzo_TRTA + 24
frame #20: 0xf39c0aec libXCTest.so`$s6XCTest0A4CaseCs5Error_pIeggzo_ACytsAD_pIegnrzo_TRTA.30 + 12
frame #21: 0xf39be940 libXCTest.so`$s6XCTest0A4CaseCyts5Error_pIegnrzo_ACsAD_pIeggzo_TRTA + 32
frame #22: 0xf39c0e54 libXCTest.so`$s6XCTest0A4CaseC10invokeTestyyF + 196
frame #23: 0xf39c0bc0 libXCTest.so`$s6XCTest0A4CaseC7performyyAA0A3RunCF + 128
frame #24: 0xf39c43a0 libXCTest.so`$s6XCTestAAC3runyyF + 172
frame #25: 0xf39c2420 libXCTest.so`$s6XCTest0A5SuiteC7performyyAA0A3RunCF + 164
frame #26: 0xf39c43a0 libXCTest.so`$s6XCTestAAC3runyyF + 172
frame #27: 0xf39c2420 libXCTest.so`$s6XCTest0A5SuiteC7performyyAA0A3RunCF + 164
frame #28: 0xf39c43a0 libXCTest.so`$s6XCTestAAC3runyyF + 172
frame #29: 0xf39bebf4 libXCTest.so`$s6XCTest7XCTMain_9arguments9observerss5Int32VSayAA0A4CaseCm04testF5Class_SaySS_yAHKctG8allTeststG_SaySSGSayAA0A11Observation_pGSgtF + 356
frame #30: 0xf39becb0 libXCTest.so`$s6XCTest7XCTMainys5NeverOSayAA0A4CaseCm04testD5Class_SaySS_yAFKctG8allTeststGF + 36
frame #31: 0x022f4d6c swift-nioPackageTests.xctest`$s21swift_nioPackageTests6RunnerV4mainyyFZ at runner.swift:543:14
frame #32: 0x022f4d90 swift-nioPackageTests.xctest`$s21swift_nioPackageTests6RunnerV5$mainyyFZ at <compiler-generated>:0
frame #33: 0x022f4da4 swift-nioPackageTests.xctest`main at runner.swift:509:8
frame #34: 0xf778aa58 libc.so`__libc_init + 56
I don't have the time to investigate right now as I'm trying to get the Swift 6 SDK for Android out the door, but are you able to reproduce on other 32-bit platforms?
Oh cool, these are SIGILL not SIGSEGV. These will definitely reproduce on other 32-bit platforms.
Ah, sorry about the wrong terminology, just saw crashes and didn't look deeper.
No not a problem at all, just made me nervous we'd done something a lot worse!
Expected behavior
All tests to pass, as most do on 64-bit Android platforms like AArch64 and x86_64.
Actual behavior
I'm preparing an Android SDK bundle for Swift 6, so I'm testing these new CI-generated Swift 6 multi-arch SDKs by using the instructions there along with two NIO patches, that disable some filesystem materialization code and tests that don't work on Android and add the new Android overlay where the compiler complains.
With that build and test process, all remaining tests pass on Android AArch64 and x86_64, but some segfault for armv7:
Commenting out those three tests gets all tests to run, with only one more 32-bit test failing, which I first reported four years ago in #1695:
I build and test NIO regularly on 64-bit Android AArch64 and x86_64, but hadn't tested it on 32-bit armv7 in awhile, so some regressions crept in.
Of course, it's possible the problem lies elsewhere in the toolchain or Android support, so I then cross-compiled the
swift-argument-parser
andswift-crypto
packages for Android armv7 with the 6.0.1 and latest 6.1 Sep. 25 snapshot Android SDKs linked above and all their tests passed, suggesting this issue is in NIO.Steps to reproduce
See above
SwiftNIO version/commit hash
b812b1b73
System & version information
Android 13 AArch64 running the Swift 6.0 and 6.1-built armv7 NIO test runner in AArch32 mode