EXC_BAD_ACCESS/SIGABRT in debugCaseOutput #1128
Replies: 9 comments
-
@finestructure Huh! Do you think you could get us more info or ideally a way to repro? E.g., what does the action being fed to |
Beta Was this translation helpful? Give feedback.
-
I can literally just add a |
Beta Was this translation helpful? Give feedback.
-
Ok, I've had a look and I've not managed to reproduce it in Tic Tac Toe nor another simple TCA example of mine. So it must be something specific to this project. I can try and make it available to you somehow if you'd like. |
Beta Was this translation helpful? Give feedback.
-
@finestructure I'm happy to take a look if you want as well. You could invite me to a private repo or extract part of your existing project that reproduces the issue and post it here. |
Beta Was this translation helpful? Give feedback.
-
Ok, this definitely looks like a memory layout issue. My app fires three events on startup. I've just changed the associated value payload of an action and suddenly three different actions fired. It was very obvious this time, because the normal launch actions load data whereas the replacements had no effect. A clean-build-run fixed it. So it seems like I'll try and reduce the sample to something I can share. |
Beta Was this translation helpful? Give feedback.
-
@finestructure thanks for the update. Keen to see what's going on! |
Beta Was this translation helpful? Give feedback.
-
I encountered a very similar bug, however in my case I had just added a new variable (containing an optional enum that had one case with an associated string value) in my A memory layout issue seems likely - if I moved the definition of the new variable around, I could reliably reproduce/fix the issue - with no other changes. Early on the EXC_BAD_ACCESS crashes were all happening in CustomDump, but by the time I thought to take screenshots, it was consistently occurring in Store instead. And as with @finestructure - a clean-build-run seems to have fixed it. Very weird. |
Beta Was this translation helpful? Give feedback.
-
I'm going to convert this to a discussion for now, since we have no way of reproducing, and because cleaning the build fixes. It's hard to know if it's a Swift bug or a bug with a library of ours. If there are changes we can make to fix the problem, we'd love to make them here and/or in Custom Dump, wherever it makes sense, but for now we'll leave the discussion open for folks to discover a workaround to the problem. |
Beta Was this translation helpful? Give feedback.
-
According to the first screenshot, the code executes on a background queue (which is expected). The stack size is thus way smaller than on the main thread (512kB on macOS & iOS instead of 8MB and 1MB), and there is potentially a fair amount of recursion here, or when using |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When adding (or removing) a new action with an associated value, for instance
case foo(String)
, calling.debugActions(actionFormat: .labelsOnly)
(not sure if.labelsOnly
is relevant) crashes with anEXC_BAD_ACCESS
orSIGBART
. (I've seen both happen, mostly it'sEXC_BAD_ACCESS
.)This is reproducible in my TCA project but I haven't tried it in any of the official examples yet.
What's interesting (and leads me to believe this is a compiler issue): "Clean Build Folder" + "Run" fixes the issue. It's not a big deal to work around this (as it's a debugging tool only anyway) so I'm really just raising the issue to report the workaround in case others are seeing this as well :)
This is on macOS 12.2 with Xcode 13.2.1 and TCA 0.33.1
Beta Was this translation helpful? Give feedback.
All reactions