pointfreeco / swift-custom-dump

A collection of tools for debugging, diffing, and testing your application's data structures.
MIT License
800 stars 89 forks source link

CI: Avoid stack overflow on Wasm tests by extending the stack size #131

Closed kateinoigakukun closed 1 month ago

kateinoigakukun commented 1 month ago

The crash that started recently was due to stack overflow, which usually happens only in debug build

This is a common error in WebAssembly toolchain but is hard to diagnose since it corrupts memory space...: https://book.swiftwasm.org/getting-started/troubleshooting.html#3-stack-overflow-is-occurring

Crash log (permalink) ``` Test Suite 'All tests' started at 2024-08-21 21:46:13.052 � �* �� aD�: ��: ����P`D�P`D�: �:  aD�� �� aD� � P`D� � �P`D�P`D��mB aD� ��`D � � � aD� aD�P`D�(�:�WD�(�`D��[8](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:9)p@(�`D:13�se 'DiffTests.teid: 1�sed (0.008 seconds) Test Case 'DiffT1id: 1 startedid: 1�1 21:46068 Test Case 'Did: �tClaid: 1�sed (0.0id: 1��+.testCollect,l@id: 1���+id: 1x8@Test Case 'DiffTests.testCollection' passed (0.002 seconds) Test Case 'DiffTests.testCollectionCollapsing' started at 2024-08-21 21:46:13.075 Error: failed to run main module `.build/debug/swift-custom-dumpPackageTests.wasm` Caused by: 0: failed to invoke command default 1: error while executing at wasm backtrace: 0: 0xede86c - !CFUniCharGetUnicodePropertyDataForPlane 1: 0xe6aea2 - !CFStringFindWithOptionsAndLocale 2: 0xe7546b - !CFStringCreateArrayWithFindResults 3: 0x6e8d3e - !$s10Foundation15NSMutableStringC18replaceOccurrences2of4with7options5rangeSiSS_SSAA8NSStringC14CompareOptionsVAA8_NSRangeVtF 4: 0x6e[9](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:10)c9b - !$s[10](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:11)Foundation8NSStringC20replacingOccurrences2of4withS2S_SStF 5: 0x6f2686 - !$sSy10FoundationE20replacingOccurrences2of4with7options5rangeSSqd___qd_0_AA8NSStringC14CompareOptionsVSnySS5IndexVGSgtSyRd__SyRd_0_r0_lF 6: 0xbadb0 - !$sSS10CustomDumpE9indenting4withS2S_tF 7: 0xba19b - !$sSS10CustomDumpE9indenting2bySSSi_tF 8: 0x6b40e - !$s10CustomDump07_customB0_2to4name0E6Suffix6indent6isRoot8maxDepth7trackerxx_q_zSSSgSSSiSbSiAA13ObjectTrackerVzts16TextOutputStreamR_r0_lF0cB4HelpL__AcdefgHyqd___qd_0_zAJSSSiSbSitsAMR_sAMRd_0_r0_0_lF 9: 0x5e9f7 - !$s10CustomDump07_customB0_2to4name0E6Suffix6indent6isRoot8maxDepth7trackerxx_q_zSSSgSSSiSbSiAA13ObjectTrackerVzts16TextOutputStreamR_r0_lF 10: 0x74147 - !$s10CustomDump07_customB0_4name0D6Suffix6indent6isRoot8maxDepth7trackerSSyp_SSSgSSSiSbSiAA13ObjectTrackerVztF [11](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:12): 0x47655 - !$s10CustomDump4diff__6formatSSSgx_xAA10DiffFormatVtlF0C4HelpL___7lhsName03rhsI09separator6indent6isRootSSyp_ypA2DSSSiSbtlF0C8ChildrenL_0H00J0__AhI10nameSuffix6prefix6suffix13elementIndent0T9Separator17collapseUnchanged6filter13areEquivalent0Z17InIncreasingOrder3mapyyp_yps6MirrorVA_A2DS3SSiSSS2bAD5label_yp5valuet_tXESbADA0__ypA1_t_ADA0__ypA1_ttXESbADA0__ypA1_t_ADA0__ypA1_ttcSgyADA0__ypA1_tz_SitXEtlF [12](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:13): 0x3cb25 - !$s10CustomDump4diff__6formatSSSgx_xAA10DiffFormatVtlF0C4HelpL___7lhsName03rhsI09separator6indent6isRootSSyp_ypA2DSSSiSbtlF [13](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:14): 0x4c64f - !$s10CustomDump4diff__6formatSSSgx_xAA10DiffFormatVtlF0C4HelpL___7lhsName03rhsI09separator6indent6isRootSSyp_ypA2DSSSiSbtlF0C8ChildrenL_0H00J0__AhI10nameSuffix6prefix6suffix13elementIndent0T9Separator17collapseUnchanged6filter13areEquivalent0Z17InIncreasingOrder3mapyyp_yps6MirrorVA_A2DS3SSiSSS2bAD5label_yp5valuet_tXESbADA0__ypA1_t_ADA0__ypA1_ttXESbADA0__ypA1_t_ADA0__ypA1_ttcSgyADA0__ypA1_tz_SitXEtlF [14](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:15): 0x3a9dc - !$s10CustomDump4diff__6formatSSSgx_xAA10DiffFormatVtlF0C4HelpL___7lhsName03rhsI09separator6indent6isRootSSyp_ypA2DSSSiSbtlF [15](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:16): 0x4c64f - !$s10CustomDump4diff__6formatSSSgx_xAA10DiffFormatVtlF0C4HelpL___7lhsName03rhsI09separator6indent6isRootSSyp_ypA2DSSSiSbtlF0C8ChildrenL_0H00J0__AhI10nameSuffix6prefix6suffix13elementIndent0T9Separator17collapseUnchanged6filter13areEquivalent0Z17InIncreasingOrder3mapyyp_yps6MirrorVA_A2DS3SSiSSS2bAD5label_yp5valuet_tXESbADA0__ypA1_t_ADA0__ypA1_ttXESbADA0__ypA1_t_ADA0__ypA1_ttcSgyADA0__ypA1_tz_SitXEtlF [16](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:17): 0x3cb25 - !$s10CustomDump4diff__6formatSSSgx_xAA10DiffFormatVtlF0C4HelpL___7lhsName03rhsI09separator6indent6isRootSSyp_ypA2DSSSiSbtlF [17](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:18): 0x2dcfe - !$s10CustomDump4diff__6formatSSSgx_xAA10DiffFormatVtlF [18](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:19): 0xe6c2d - !$s15CustomDumpTests04DiffC0C04testA10DictionaryyyFSSSgyKXEfu3_ [19](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:20): 0xa402d - !$s10CustomDump18expectNoDifference___6fileID0F4Path4line6columnyxyKXK_xyKXKSSSgyXKs12StaticStringVAIS2utSQRzlF [20](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:21): 0xe6197 - !$s15CustomDumpTests04DiffC0C04testA10DictionaryyyF [21](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:22): 0x1613e5 - !$s15CustomDumpTests04DiffC0C034swift_custom_dumpPackageDiscoveredC0E05__allc2__dC033_644D08F776D0957CFCCCA03F4037E4FFLLSaySS_yycACctGvpZfiyycACcfu13_yycfu14_ [22](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:23): 0x161399 - !$s15CustomDumpTests04DiffC0C034swift_custom_dumpPackageDiscoveredC0E05__allc2__dC033_644D08F776D0957CFCCCA03F4037E4FFLLSaySS_yycACctGvpZfiyycACcfu13_yycfu14_TA [23](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:24): 0x1610e0 - !$sIeg_ytIegr_TR 24: 0x1610ce - !$sIeg_ytIegr_TRTA.377 25: 0xf0af62 - !$sytIegr_Ieg_TRTA 26: 0xf0b599 - !$s6XCTest4test33_3BE257A46ADB477C7BF2D39968B39F9DLLyyAA0A4CaseCKcyyKcxcAERbzlFyAEKcfU_TA 27: 0xf0b694 - !$s6XCTest0A4CaseCs5Error_pIeggzo_ACytsAD_pIegnrzo_TRTA 28: 0xefc6a6 - !$s6XCTest0A4CaseCyts5Error_pIegnrzo_ACsAD_pIeggzo_TRTA 29: 0xf08b1e - !$s6XCTest0A4CaseC10invokeTestyyFyyYaYbcfU_TY1_ 30: 0x57da40 - !swift_task_switchImpl(swift::AsyncContext*, void (swift::AsyncContext* swift_async_context) swiftcall*, swift::ExecutorRef) 31: 0x57d976 - !swift_task_switch 32: 0xf08ac6 - !$s6XCTest0A4CaseC10invokeTestyyFyyYaYbcfU_TQ0_ 33: 0xf09ca9 - !$s6XCTest0A4CaseC20performSetUpSequenceyyYaFTY2_ 34: 0x57da40 - !swift_task_switchImpl(swift::AsyncContext*, void (swift::AsyncContext* swift_async_context) swiftcall*, swift::ExecutorRef) 35: 0x57d976 - !swift_task_switch 36: 0xf09b55 - !$s6XCTest0A4CaseC20performSetUpSequenceyyYaFTQ1_ 37: 0xf0d400 - !$s6XCTestAAC5setUpyyYaKF 38: 0xf09b17 - !$s6XCTest0A4CaseC20performSetUpSequenceyyYaFTY0_ 39: 0x57da40 - !swift_task_switchImpl(swift::AsyncContext*, void (swift::AsyncContext* swift_async_context) swiftcall*, swift::ExecutorRef) 40: 0x57d976 - !swift_task_switch 41: 0xf09ab8 - !$s6XCTest0A4CaseC20performSetUpSequenceyyYaF 42: 0xf0b33b - !$s6XCTest0A4CaseC10invokeTestyyFyyYaYbcfU_TA 43: 0x56016f - !$sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tg5 44: 0xf0b297 - !$sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tg5TATm 45: 0xf0b362 - !$sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tg5TA.10 46: 0x57fbc7 - !future_adapter(swift::AsyncContext*) 47: 0x57cd40 - !swift::runJobInEstablishedExecutorContext(swift::Job*) 48: 0x57d6e8 - !swift_job_run 49: 0x57e5a8 - !swift_task_donateThreadToGlobalExecutorUntil 50: 0x58091e - !swift_task_asyncMainDrainQueueImpl() 51: 0x5808eb - !swift_task_asyncMainDrainQueue 52: 0xf2[24](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:25)81 - !XCTMainRunLoopMain 53: 0xeffd45 - !$s6XCTest7XCTMain_9arguments9observersySayAA0A4CaseCm04testE5Class_SaySS_yAFKctG8allTeststG_SaySSGSayAA0A11Observation_pGtF 54: 0xeff066 - !$s6XCTest7XCTMainyySayAA0A4CaseCm04testC5Class_SaySS_yADKctG8allTeststGF 55: 0x16bea5 - !$s29swift_custom_dumpPackageTests6RunnerV4mainyyFZ 56: 0x16bebd - !$s29swift_custom_dumpPackageTests6RunnerV5$mainyyFZ 57: 0x16bed1 - !main 58: 0xf5b600 - !main 59: 0xf5a59b - !__main_void 60: 0xf5a4e1 - !__original_main 61: 0x[26](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:27)85e - !_start 62: 0xf793fe - !_start.command_export note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information 2: memory fault at wasm address 0x650054 in linear memory of size 0x490000 3: wasm trap: out of bounds memory access Test Case 'DiffTests.testCollectionCollapsing' passed (0.023 seconds) ```