7.1 C
Canberra
Wednesday, May 6, 2026

swift – JSONEncoder.encode causes stack overflow crash (thread_chkstk_darwin) on iOS 26.3.1 solely — deeply nested Codable mannequin


My app crashes on iOS 26.3.1 (a) solely (can not reproduce on earlier variations) with the next crash kind:

Crashed: com.apple.main-thread

0 libsystem_pthread.dylib thread_chkstk_darwin + 60

1 libsystem_pthread.dylib ___chkstk_darwin + 60

2 libswiftCore.dylib KeyedEncodingContainerProtocol.encodeIfPresent(_:forKey:) + 272

3 Basis + 36

4 libswiftCore.dylib _KeyedEncodingContainerBox.encodeIfPresent(_:forKey:) + 372

5 libswiftCore.dylib KeyedEncodingContainer.encodeIfPresent(_:forKey:) + 76

27 Basis specialised __JSONEncoder.wrapGeneric(_:for:) + 4916

28 Basis JSONEncoder.encode(_:) + 296

The sample repeats encodeIfPresent → encodeIfPresent a number of instances earlier than the overflow. The crash originates from a JSONEncoder.encode() name triggered from the primary thread through an Alamofire response callback.

Stack hint (simplified)

Body 34: TransferFundsVM.validateAndSubmit(knowledge:processId:) (TransferFundsVM.swift:1112)

Body 35: closure in TransferFundsViewModel.fetchTransfer(kind:processId:) (TransferFundsVM.swift:1087)

Body 28: JSONEncoder.encode(_:) + 296 ← crash right here

Body 0: thread_chkstk_darwin ← stack overflow

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles