Skip to content

Crash on view.layer.render(in: ctx.cgContext) #522

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

Closed
hilalalhakani opened this issue Oct 8, 2021 · 3 comments
Closed

Crash on view.layer.render(in: ctx.cgContext) #522

hilalalhakani opened this issue Oct 8, 2021 · 3 comments

Comments

@hilalalhakani
Copy link

the error is Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
Screen Shot 2021-10-08 at 10 27 10 AM

@stephencelis
Copy link
Member

Hi @hilalalhakani! Thanks for taking the time to report. Unfortunately we need more information to debug/reproduce the problem. I'm going to close this issue out, but can re-open if you provide a way for us to reproduce. Or feel free to open a new issue with more information. Thanks!

@hilalalhakani
Copy link
Author

hilalalhakani commented Jan 8, 2022

there's nothing wrong with the library, it was my bad because i copy pasted a storyboard from one project to another which resulted the crash .

@mrackwitz
Copy link

I see a similar crash when testing a SwiftUI view which is using an inset shadow. 🤔

public struct BarView: View {
    public var body: some View {
        Rectangle()
            .fill(Color.red.shadow(.inner(color: Color.black, radius: 6, x: 0, y: 0)))
    }
}
Full Stack Trace
Thread 1 Queue : com.apple.main-thread (serial)
#0	0x000000018002d054 in objc_retain ()
#1	0x000000018838e030 in CGGStateSetFillColor ()
#2	0x00000001880a7bec in rip_auto_context_begin_layer ()
#3	0x0000000188399604 in CGContextBeginTransparencyLayerWithRect ()
#4	0x0000000188399b70 in CGContextBeginTransparencyLayer ()
#5	0x000000019fa1803c in RB::Coverage::Primitive::fill(RB::CGContext&, RB::Fill::Color const&) const ()
#6	0x000000019f9f63dc in RB::DisplayList::GenericItem1<RB::Coverage::Primitive, RB::Fill::Color>::render(RB::CGContext&) const ()
#7	0x000000019fa54318 in RB::DisplayList::LayerItem::render(RB::CGContext&) const ()
#8	0x000000019fa540f0 in RB::DisplayList::Contents::render(RB::CGContext&, RB::DisplayListPredicate::Invertible const*, void*) const ()
#9	0x000000019f9eded4 in render_contents(CGContext*, NSDictionary*, RB::DisplayList::Contents const&, RB::DisplayListPredicate::Invertible const*) ()
#10	0x000000019f9edd14 in -[RBDisplayList renderInContext:options:] ()
#11	0x000000019fa23170 in -[RBLayer _renderForegroundInContext:] ()
#12	0x0000000187f0f370 in -[CALayer renderInContext:] ()
#13	0x0000000187f106fc in -[CALayer _renderSublayersInContext:] ()
#14	0x0000000187f0f37c in -[CALayer renderInContext:] ()
#15	0x000000010d8e6670 in closure #1 in closure #1 in closure #1 in implicit closure #1 in snapshotView(config:drawHierarchyInKeyWindow:traits:view:viewController:) at $BUILD_DIR/SourcePackages/checkouts/swift-snapshot-testing/Sources/SnapshotTesting/Common/View.swift:744
#16	0x000000010d8e2d6c in thunk for @callee_guaranteed (@guaranteed UIGraphicsImageRendererContext) -> () ()
#17	0x000000010d8e2db0 in thunk for @escaping @callee_guaranteed (@guaranteed UIGraphicsImageRendererContext) -> () ()
#18	0x0000000109f45b88 in -[UIGraphicsRenderer runDrawingActions:completionActions:format:error:] ()
#19	0x0000000109f45a24 in -[UIGraphicsRenderer runDrawingActions:completionActions:error:] ()
#20	0x0000000109f41d74 in -[UIGraphicsImageRenderer imageWithActions:] ()
#21	0x000000010d8e6384 in closure #1 in closure #1 in implicit closure #1 in snapshotView(config:drawHierarchyInKeyWindow:traits:view:viewController:) at $BUILD_DIR/SourcePackages/checkouts/swift-snapshot-testing/Sources/SnapshotTesting/Common/View.swift:740
#22	0x000000010d8a499c in closure #1 in Async.init(value:) at $BUILD_DIR/SourcePackages/checkouts/swift-snapshot-testing/Sources/SnapshotTesting/Async.swift:28
#23	0x000000010d8e6038 in closure #1 in implicit closure #1 in snapshotView(config:drawHierarchyInKeyWindow:traits:view:viewController:) at $BUILD_DIR/SourcePackages/checkouts/swift-snapshot-testing/Sources/SnapshotTesting/Common/View.swift:738
#24	0x000000010d8a4c18 in closure #1 in Async.map<τ_0_0>(_:) at $BUILD_DIR/SourcePackages/checkouts/swift-snapshot-testing/Sources/SnapshotTesting/Async.swift:36
#25	0x000000010d8f3408 in closure #1 in closure #1 in Snapshotting.asyncPullback<τ_0_0>(_:) at $BUILD_DIR/SourcePackages/checkouts/swift-snapshot-testing/Sources/SnapshotTesting/Snapshotting.swift:85
#26	0x000000010d8f4124 in partial apply for closure #1 in closure #1 in Snapshotting.asyncPullback<τ_0_0>(_:) ()
#27	0x000000010d8a07b4 in verifySnapshot<τ_0_0, τ_0_1>(matching:as:named:record:snapshotDirectory:timeout:file:testName:line:) at $BUILD_DIR/SourcePackages/checkouts/swift-snapshot-testing/Sources/SnapshotTesting/AssertSnapshot.swift:209
#28	0x000000010d89f860 in assertSnapshot<τ_0_0, τ_0_1>(matching:as:named:record:timeout:file:testName:line:) at $BUILD_DIR/SourcePackages/checkouts/swift-snapshot-testing/Sources/SnapshotTesting/AssertSnapshot.swift:41
#29	0x000000010d8058e4 in FooTests.testBar() at $SRC_DIR/Tests/FooTests/FooTests.swift:14
#30	0x000000010d805bcc in @objc FooTests.testBar() ()
#31	0x0000000180414d20 in __invoking___ ()
#32	0x0000000180411f0c in -[NSInvocation invoke] ()
#33	0x0000000104f79b58 in +[XCTFailableInvocation invokeStandardConventionInvocation:completion:] ()
#34	0x0000000104f79b10 in __90+[XCTFailableInvocation invokeInvocation:withTestMethodConvention:lastObservedErrorIssue:]_block_invoke_3 ()
#35	0x0000000104f795b8 in __81+[XCTFailableInvocation invokeWithAsynchronousWait:lastObservedErrorIssue:block:]_block_invoke.5 ()
#36	0x0000000104f41538 in +[XCTSwiftErrorObservation observeErrorsInBlock:] ()
#37	0x0000000104f7944c in +[XCTFailableInvocation invokeWithAsynchronousWait:lastObservedErrorIssue:block:] ()
#38	0x0000000104f798d0 in +[XCTFailableInvocation invokeInvocation:withTestMethodConvention:lastObservedErrorIssue:] ()
#39	0x0000000104f79bc8 in +[XCTFailableInvocation invokeInvocation:lastObservedErrorIssue:] ()
#40	0x0000000104f69ee4 in __24-[XCTestCase invokeTest]_block_invoke.78 ()
#41	0x0000000104f3a8cc in -[XCTestCase(XCTIssueHandling) _caughtUnhandledDeveloperExceptionPermittingControlFlowInterruptions:caughtInterruptionException:whileExecutingBlock:] ()
#42	0x0000000104f69b2c in -[XCTestCase invokeTest] ()
#43	0x0000000104f6af64 in __26-[XCTestCase performTest:]_block_invoke.119 ()
#44	0x0000000104f3a8cc in -[XCTestCase(XCTIssueHandling) _caughtUnhandledDeveloperExceptionPermittingControlFlowInterruptions:caughtInterruptionException:whileExecutingBlock:] ()
#45	0x0000000104f6aad4 in __26-[XCTestCase performTest:]_block_invoke.110 ()
#46	0x0000000104f53a60 in +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] ()
#47	0x0000000104f5398c in +[XCTContext runInContextForTestCase:markAsReportingBase:block:] ()
#48	0x0000000104f6a7a0 in -[XCTestCase performTest:] ()
#49	0x0000000104f2aa78 in -[XCTest runTest] ()
#50	0x0000000104f56300 in -[XCTestSuite runTestBasedOnRepetitionPolicy:testRun:] ()
#51	0x0000000104f561e4 in __27-[XCTestSuite performTest:]_block_invoke ()
#52	0x0000000104f55cf8 in __59-[XCTestSuite _performProtectedSectionForTest:testSection:]_block_invoke ()
#53	0x0000000104f53a60 in +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] ()
#54	0x0000000104f5398c in +[XCTContext runInContextForTestCase:markAsReportingBase:block:] ()
#55	0x0000000104f55ca0 in -[XCTestSuite _performProtectedSectionForTest:testSection:] ()
#56	0x0000000104f55f10 in -[XCTestSuite performTest:] ()
#57	0x0000000104f2aa78 in -[XCTest runTest] ()
#58	0x0000000104f56300 in -[XCTestSuite runTestBasedOnRepetitionPolicy:testRun:] ()
#59	0x0000000104f561e4 in __27-[XCTestSuite performTest:]_block_invoke ()
#60	0x0000000104f55cf8 in __59-[XCTestSuite _performProtectedSectionForTest:testSection:]_block_invoke ()
#61	0x0000000104f53a60 in +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] ()
#62	0x0000000104f5398c in +[XCTContext runInContextForTestCase:markAsReportingBase:block:] ()
#63	0x0000000104f55ca0 in -[XCTestSuite _performProtectedSectionForTest:testSection:] ()
#64	0x0000000104f55f10 in -[XCTestSuite performTest:] ()
#65	0x0000000104f2aa78 in -[XCTest runTest] ()
#66	0x0000000104f56300 in -[XCTestSuite runTestBasedOnRepetitionPolicy:testRun:] ()
#67	0x0000000104f561e4 in __27-[XCTestSuite performTest:]_block_invoke ()
#68	0x0000000104f55cf8 in __59-[XCTestSuite _performProtectedSectionForTest:testSection:]_block_invoke ()
#69	0x0000000104f53a60 in +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] ()
#70	0x0000000104f5398c in +[XCTContext runInContextForTestCase:markAsReportingBase:block:] ()
#71	0x0000000104f55ca0 in -[XCTestSuite _performProtectedSectionForTest:testSection:] ()
#72	0x0000000104f55f10 in -[XCTestSuite performTest:] ()
#73	0x0000000104f2aa78 in -[XCTest runTest] ()
#74	0x0000000104f2c2ec in __89-[XCTTestRunSession executeTestsWithIdentifiers:skippingTestsWithIdentifiers:completion:]_block_invoke ()
#75	0x0000000104f53a60 in +[XCTContext _runInChildOfContext:forTestCase:markAsReportingBase:block:] ()
#76	0x0000000104f5398c in +[XCTContext runInContextForTestCase:markAsReportingBase:block:] ()
#77	0x0000000104f2c1e8 in -[XCTTestRunSession executeTestsWithIdentifiers:skippingTestsWithIdentifiers:completion:] ()
#78	0x0000000104f859d0 in __72-[XCTExecutionWorker enqueueTestIdentifiersToRun:testIdentifiersToSkip:]_block_invoke_2 ()
#79	0x0000000104f85af0 in -[XCTExecutionWorker runWithError:] ()
#80	0x0000000104f50f90 in __25-[XCTestDriver _runTests]_block_invoke.184 ()
#81	0x0000000104f34224 in -[XCTestObservationCenter _observeTestExecutionForBlock:] ()
#82	0x0000000104f50c2c in -[XCTestDriver _runTests] ()
#83	0x0000000104f2af60 in _XCTestMain ()
#84	0x0000000102dd88e4 in main ()
#85	0x00000001030f5fa0 in start_sim ()
#86	0x0000000102e1d08c in start ()

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

No branches or pull requests

3 participants