Bad Access crash - seeking advice/ideas


I'm hoping someone who has a little more knowledge of deep-Swift can help me interpret this rather frustrating crash that I'm experiencing. The problem seems to be mixed up with my usage of Combine, which I believe is part of why it is so difficult to hone in on the actual source of the problem. Based on the screenshot below this looks to me like it comes down to some sort of infinite recursion, maybe due to a carelessly wired synchronous publisher or something like that, so my main question is whether that seems correct or if perhaps "buildDemanglingForMetadata" is a clue that someone else can see points in a different direction. Thanks very much!

It looks like that at runtime, you are building a type with a recursive type definition. At some point, the runtime tries to construct metadata for this type, and crashes on stack overflow — that's what causes bad access here.

I can't come up with a minimal example, unfortunately, but perhaps you have something like a publisher generic over a function that returns the same publisher. You might want to look for those cases, if nobody else answers with a better explanation.

Thanks for giving me another possible lead. Here's the stack trace before it hits the infinite recursion - does anything in here shed more light on your theory?

@wtedst Do you have any suggestions about how I could go about tracking down the source of the issue? I still haven't fixed it and it's very demoralizing :/

There is nothing that I personally can say without being able to reproduce the issue — what I said earlier about recursive type definitions just was my best guess — so you might want to wait for somebody else who knows more about Swift's RTTI generation to come by :man_shrugging:t3:

Terms of Service

Privacy Policy

Cookie Policy