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

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

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

kateinoigakukun
Copy link
Contributor

@kateinoigakukun kateinoigakukun commented Aug 27, 2024

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��(��:��W�D��(��`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 'DiffT1�id: 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 - <unknown>!CFUniCharGetUnicodePropertyDataForPlane
           1: 0xe6aea2 - <unknown>!CFStringFindWithOptionsAndLocale
           2: 0xe7546b - <unknown>!CFStringCreateArrayWithFindResults
           3: 0x6e8d3e - <unknown>!$s10Foundation15NSMutableStringC18replaceOccurrences2of4with7options5rangeSiSS_SSAA8NSStringC14CompareOptionsVAA8_NSRangeVtF
           4: 0x6e[9](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:10)c9b - <unknown>!$s[10](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:11)Foundation8NSStringC20replacingOccurrences2of4withS2S_SStF
           5: 0x6f2686 - <unknown>!$sSy10FoundationE20replacingOccurrences2of4with7options5rangeSSqd___qd_0_AA8NSStringC14CompareOptionsVSnySS5IndexVGSgtSyRd__SyRd_0_r0_lF
           6: 0xbadb0 - <unknown>!$sSS10CustomDumpE9indenting4withS2S_tF
           7: 0xba19b - <unknown>!$sSS10CustomDumpE9indenting2bySSSi_tF
           8: 0x6b40e - <unknown>!$s10CustomDump07_customB0_2to4name0E6Suffix6indent6isRoot8maxDepth7trackerxx_q_zSSSgSSSiSbSiAA13ObjectTrackerVzts16TextOutputStreamR_r0_lF0cB4HelpL__AcdefgHyqd___qd_0_zAJSSSiSbSitsAMR_sAMRd_0_r0_0_lF
           9: 0x5e9f7 - <unknown>!$s10CustomDump07_customB0_2to4name0E6Suffix6indent6isRoot8maxDepth7trackerxx_q_zSSSgSSSiSbSiAA13ObjectTrackerVzts16TextOutputStreamR_r0_lF
          10: 0x74147 - <unknown>!$s10CustomDump07_customB0_4name0D6Suffix6indent6isRoot8maxDepth7trackerSSyp_SSSgSSSiSbSiAA13ObjectTrackerVztF
          [11](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:12): 0x47655 - <unknown>!$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 - <unknown>!$s10CustomDump4diff__6formatSSSgx_xAA10DiffFormatVtlF0C4HelpL___7lhsName03rhsI09separator6indent6isRootSSyp_ypA2DSSSiSbtlF
          [13](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:14): 0x4c64f - <unknown>!$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 - <unknown>!$s10CustomDump4diff__6formatSSSgx_xAA10DiffFormatVtlF0C4HelpL___7lhsName03rhsI09separator6indent6isRootSSyp_ypA2DSSSiSbtlF
          [15](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:16): 0x4c64f - <unknown>!$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 - <unknown>!$s10CustomDump4diff__6formatSSSgx_xAA10DiffFormatVtlF0C4HelpL___7lhsName03rhsI09separator6indent6isRootSSyp_ypA2DSSSiSbtlF
          [17](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:18): 0x2dcfe - <unknown>!$s10CustomDump4diff__6formatSSSgx_xAA10DiffFormatVtlF
          [18](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:19): 0xe6c2d - <unknown>!$s15CustomDumpTests04DiffC0C04testA10DictionaryyyFSSSgyKXEfu3_
          [19](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:20): 0xa402d - <unknown>!$s10CustomDump18expectNoDifference___6fileID0F4Path4line6columnyxyKXK_xyKXKSSSgyXKs12StaticStringVAIS2utSQRzlF
          [20](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:21): 0xe6197 - <unknown>!$s15CustomDumpTests04DiffC0C04testA10DictionaryyyF
          [21](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:22): 0x1613e5 - <unknown>!$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 - <unknown>!$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 - <unknown>!$sIeg_ytIegr_TR
          24: 0x1610ce - <unknown>!$sIeg_ytIegr_TRTA.377
          25: 0xf0af62 - <unknown>!$sytIegr_Ieg_TRTA
          26: 0xf0b599 - <unknown>!$s6XCTest4test33_3BE257A46ADB477C7BF2D39968B39F9DLLyyAA0A4CaseCKcyyKcxcAERbzlFyAEKcfU_TA
          27: 0xf0b694 - <unknown>!$s6XCTest0A4CaseCs5Error_pIeggzo_ACytsAD_pIegnrzo_TRTA
          28: 0xefc6a6 - <unknown>!$s6XCTest0A4CaseCyts5Error_pIegnrzo_ACsAD_pIeggzo_TRTA
          29: 0xf08b1e - <unknown>!$s6XCTest0A4CaseC10invokeTestyyFyyYaYbcfU_TY1_
          30: 0x57da40 - <unknown>!swift_task_switchImpl(swift::AsyncContext*, void (swift::AsyncContext* swift_async_context) swiftcall*, swift::ExecutorRef)
          31: 0x57d976 - <unknown>!swift_task_switch
          32: 0xf08ac6 - <unknown>!$s6XCTest0A4CaseC10invokeTestyyFyyYaYbcfU_TQ0_
          33: 0xf09ca9 - <unknown>!$s6XCTest0A4CaseC20performSetUpSequenceyyYaFTY2_
          34: 0x57da40 - <unknown>!swift_task_switchImpl(swift::AsyncContext*, void (swift::AsyncContext* swift_async_context) swiftcall*, swift::ExecutorRef)
          35: 0x57d976 - <unknown>!swift_task_switch
          36: 0xf09b55 - <unknown>!$s6XCTest0A4CaseC20performSetUpSequenceyyYaFTQ1_
          37: 0xf0d400 - <unknown>!$s6XCTestAAC5setUpyyYaKF
          38: 0xf09b17 - <unknown>!$s6XCTest0A4CaseC20performSetUpSequenceyyYaFTY0_
          39: 0x57da40 - <unknown>!swift_task_switchImpl(swift::AsyncContext*, void (swift::AsyncContext* swift_async_context) swiftcall*, swift::ExecutorRef)
          40: 0x57d976 - <unknown>!swift_task_switch
          41: 0xf09ab8 - <unknown>!$s6XCTest0A4CaseC20performSetUpSequenceyyYaF
          42: 0xf0b33b - <unknown>!$s6XCTest0A4CaseC10invokeTestyyFyyYaYbcfU_TA
          43: 0x56016f - <unknown>!$sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tg5
          44: 0xf0b297 - <unknown>!$sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tg5TATm
          45: 0xf0b362 - <unknown>!$sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tg5TA.10
          46: 0x57fbc7 - <unknown>!future_adapter(swift::AsyncContext*)
          47: 0x57cd40 - <unknown>!swift::runJobInEstablishedExecutorContext(swift::Job*)
          48: 0x57d6e8 - <unknown>!swift_job_run
          49: 0x57e5a8 - <unknown>!swift_task_donateThreadToGlobalExecutorUntil
          50: 0x58091e - <unknown>!swift_task_asyncMainDrainQueueImpl()
          51: 0x5808eb - <unknown>!swift_task_asyncMainDrainQueue
          52: 0xf2[24](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:25)81 - <unknown>!XCTMainRunLoopMain
          53: 0xeffd45 - <unknown>!$s6XCTest7XCTMain_9arguments9observersySayAA0A4CaseCm04testE5Class_SaySS_yAFKctG8allTeststG_SaySSGSayAA0A11Observation_pGtF
          54: 0xeff066 - <unknown>!$s6XCTest7XCTMainyySayAA0A4CaseCm04testC5Class_SaySS_yADKctG8allTeststGF
          55: 0x16bea5 - <unknown>!$s29swift_custom_dumpPackageTests6RunnerV4mainyyFZ
          56: 0x16bebd - <unknown>!$s29swift_custom_dumpPackageTests6RunnerV5$mainyyFZ
          57: 0x16bed1 - <unknown>!main
          58: 0xf5b600 - <unknown>!main
          59: 0xf5a59b - <unknown>!__main_void
          60: 0xf5a4e1 - <unknown>!__original_main
          61: 0x[26](https://github.com/pointfreeco/swift-custom-dump/actions/runs/10497958063/job/29081896686#step:6:27)85e - <unknown>!_start
          62: 0xf793fe - <unknown>!_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)

Copy link
Member

@mbrandonw mbrandonw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great @kateinoigakukun! Thanks so much for taking the time to help us out. We'll get Wasm CI on as many of our repos as possible :)

@mbrandonw mbrandonw merged commit 6752df6 into pointfreeco:main Aug 27, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants