Cuckoo icon indicating copy to clipboard operation
Cuckoo copied to clipboard

Segfault when running generator

Open JackCostigan opened this issue 6 years ago • 4 comments

Hi,

I'm using Cuckoo 1.1.1 with Carthage and it's causing my build to fail. When the generator runs against a specific file it causes a segfault.

I've created a demo project here that shows the issue.

JackCostigan avatar Oct 11 '19 15:10 JackCostigan

Sorry for the silence up until now. I'll take a look at the demo project and get back to you.

MatyasKriz avatar Nov 05 '19 14:11 MatyasKriz

Hey, @JackCostigan. I've just downloaded the project and I'm not well-versed in Carthage stuff, but I ran carthage update and now I've got Cuckoo cloned.

If you're saying it's the generator acting up, please, instead of a full project just separate the file that's causing the problem and instead of a complicated shell script just provide us with the command to run the generator on the problematic file.

When you're done with that, provided there are no complications in your path, I'll go over the minimal working example that you'll have left and fix the generator using that. Thank you.

MatyasKriz avatar Nov 14 '19 14:11 MatyasKriz

Thanks for the reply.

If I run the following command from the root of the example project I get an error:

Carthage/Checkouts/Cuckoo/cuckoo_generator generate --output Modules/Cuckoo-test-project/Cuckoo-test-projectTests/TestUtilities/Mocks/GeneratedMocks.swift --testable Dependencies/ProtocolKit Dependencies/ProtocolKit/ProtocolKit/DispatchQueueType.swift

The error message I get from the generator is: 'Carthage/Checkouts/Cuckoo/cucko…' terminated by signal SIGSEGV (Address boundary error)

I believe the offending file is Dependencies/ProtocolKit/ProtocolKit/DispatchQueueType.swift.

JackCostigan avatar Dec 20 '19 16:12 JackCostigan

I've been able to reproduce the issue thanks to the command you provided. I'm suspecting the @convention(block) inside the file, that's the only thing that is not seen very often. I'll try to see if I can pinpoint exactly where the problem occurs.

MatyasKriz avatar Apr 18 '20 10:04 MatyasKriz