Skip to content
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

[SR-11235] Package Manager crashes even with non-cyclic dependencies per product. #4680

Closed
YOCKOW opened this issue Jul 30, 2019 · 3 comments
Labels

Comments

@YOCKOW
Copy link
Contributor

YOCKOW commented Jul 30, 2019

Previous ID SR-11235
Radar None
Original Reporter @YOCKOW
Type Bug
Environment

swift-DEVELOPMENT-SNAPSHOT-2019-07-28-a

  • Apple Swift version 5.1-dev (LLVM 200186e28b, Swift 37abe9d4d3)

  • Swift Package Manager - Swift 5.1.0 (62e9683)

Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: e2321dad8765380249f0a7d1b4a50398

Issue Description:

(Although this might be a reduced case of SR-10793, stack traces differ. That is why this is filed separately.)

[How to reproduce]

$ git clone https://github.com/YOCKOW/SwiftPMUncycledCycle
$ cd ./SwiftPMUncycledCycle/PackageA
$ swift build

Then, Package Manager crashes.

[Explanation]

  • The repository contains two packages: "PackageA" and "PackageB".

  • "PackageA" has two targets: "TargetA1" and "TargetA2"

  • "PackageB" has only one target: "TargetB"

  • "TargetA2" depends on "TargetB"(ProdcutB). "TargetB" depends on "TargetA1"(ProdcutA1).

    • It is NOT cyclic dependency per product.
@YOCKOW
Copy link
Contributor Author

YOCKOW commented Jul 30, 2019

Simultaneous accesses to 0x7fca33c13508, but modification requires exclusive access.
Previous access (a modification) started at swift-build`CacheableSequence.subscript.getter + 1565 (0x10db5dded).
Current access (a read) started at:
0    libswiftCore.dylib                 0x000000010e617cd0 swift_beginAccess + 568
1    swift-build                        0x000000010db5d7d0 CacheableSequence.subscript.getter + 1210
2    swift-build                        0x000000010db5e600 CacheableSequenceIterator.next() + 321
3    swift-build                        0x000000010db5e9d0 protocol witness for IteratorProtocol.next() in conformance CacheableSequenceIterator<A> + 16
4    libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
5    libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
6    libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
7    libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
8    libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
9    libswiftCore.dylib                 0x000000010e3af810 LazyFilterSequence.Iterator.next() + 242
10   libswiftCore.dylib                 0x000000010e3afa20 protocol witness for IteratorProtocol.next() in conformance LazyFilterSequence<A>.Iterator + 9
11   libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
12   libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
13   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
14   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
15   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
16   libswiftCore.dylib                 0x000000010e3b5e70 FlattenSequence.Iterator.next() + 666
17   libswiftCore.dylib                 0x000000010e3b6300 protocol witness for IteratorProtocol.next() in conformance FlattenSequence<A>.Iterator + 9
18   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
19   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
20   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
21   libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
22   libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
23   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
24   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
25   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
26   libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
27   libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
28   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
29   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
30   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
31   libswiftCore.dylib                 0x000000010e5f1500 dispatch thunk of IteratorProtocol.next() + 7
32   swift-build                        0x000000010db5d7d0 CacheableSequence.subscript.getter + 1807
33   swift-build                        0x000000010db5e600 CacheableSequenceIterator.next() + 321
34   swift-build                        0x000000010db5e9d0 protocol witness for IteratorProtocol.next() in conformance CacheableSequenceIterator<A> + 16
35   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
36   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
37   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
38   libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
39   libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
40   libswiftCore.dylib                 0x000000010e3af810 LazyFilterSequence.Iterator.next() + 242
41   libswiftCore.dylib                 0x000000010e3afa20 protocol witness for IteratorProtocol.next() in conformance LazyFilterSequence<A>.Iterator + 9
42   libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
43   libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
44   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
45   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
46   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
47   libswiftCore.dylib                 0x000000010e3b5e70 FlattenSequence.Iterator.next() + 666
48   libswiftCore.dylib                 0x000000010e3b6300 protocol witness for IteratorProtocol.next() in conformance FlattenSequence<A>.Iterator + 9
49   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
50   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
51   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
52   libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
53   libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
54   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
55   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
56   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
57   libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
58   libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
59   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
60   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
61   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
62   libswiftCore.dylib                 0x000000010e5f1500 dispatch thunk of IteratorProtocol.next() + 7
63   swift-build                        0x000000010db5d7d0 CacheableSequence.subscript.getter + 1807
64   swift-build                        0x000000010db5e600 CacheableSequenceIterator.next() + 321
65   swift-build                        0x000000010db5e9d0 protocol witness for IteratorProtocol.next() in conformance CacheableSequenceIterator<A> + 16
66   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
67   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
68   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
69   libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
70   libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
71   libswiftCore.dylib                 0x000000010e3af810 LazyFilterSequence.Iterator.next() + 242
72   libswiftCore.dylib                 0x000000010e3afa20 protocol witness for IteratorProtocol.next() in conformance LazyFilterSequence<A>.Iterator + 9
73   libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
74   libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
75   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
76   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
77   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
78   libswiftCore.dylib                 0x000000010e3b5e70 FlattenSequence.Iterator.next() + 666
79   libswiftCore.dylib                 0x000000010e3b6300 protocol witness for IteratorProtocol.next() in conformance FlattenSequence<A>.Iterator + 9
80   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
81   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
82   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
83   libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
84   libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
85   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
86   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
87   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
88   libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
89   libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
90   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
91   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
92   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
93   libswiftCore.dylib                 0x000000010e5f1500 dispatch thunk of IteratorProtocol.next() + 7
94   swift-build                        0x000000010db5d7d0 CacheableSequence.subscript.getter + 1807
95   swift-build                        0x000000010db5e600 CacheableSequenceIterator.next() + 321
96   swift-build                        0x000000010db5e9d0 protocol witness for IteratorProtocol.next() in conformance CacheableSequenceIterator<A> + 16
97   libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
98   libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
99   libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
100  libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
101  libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
102  libswiftCore.dylib                 0x000000010e3af810 LazyFilterSequence.Iterator.next() + 242
103  libswiftCore.dylib                 0x000000010e3afa20 protocol witness for IteratorProtocol.next() in conformance LazyFilterSequence<A>.Iterator + 9
104  libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
105  libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
106  libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
107  libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
108  libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
109  libswiftCore.dylib                 0x000000010e3b5e70 FlattenSequence.Iterator.next() + 666
110  libswiftCore.dylib                 0x000000010e3b6300 protocol witness for IteratorProtocol.next() in conformance FlattenSequence<A>.Iterator + 9
111  libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
112  libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
113  libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
114  libswiftCore.dylib                 0x000000010e40eb40 LazyMapSequence.Iterator.next() + 184
115  libswiftCore.dylib                 0x000000010e40ec60 protocol witness for IteratorProtocol.next() in conformance LazyMapSequence<A, B>.Iterator + 9
116  libswiftCore.dylib                 0x000000010e527f70 _IteratorBox.next() + 26
117  libswiftCore.dylib                 0x000000010e37ec50 AnyIterator.next() + 16
118  libswiftCore.dylib                 0x000000010e527dc0 protocol witness for IteratorProtocol.next() in conformance AnyIterator<A> + 13
119  libswiftCore.dylib                 0x000000010e439a40 Sequence.first(where:) + 366
120  swift-build                        0x000000010dcdd8d0 DependencyResolver.resolveAssignment(constraints:pins:) + 2667
121  swift-build                        0x000000010dcdcd70 DependencyResolver.resolve(constraints:pins:) + 66
122  swift-build                        0x000000010dcda860 DependencyResolver.resolve(dependencies:pins:) + 230
123  swift-build                        0x000000010dee2db0 PackageResolver.resolve(dependencies:pins:) + 395
124  swift-build                        0x000000010def4980 Workspace.resolveDependencies(resolver:dependencies:pins:diagnostics:) + 196
125  swift-build                        0x000000010deee800 Workspace._resolve(root:forceResolution:extraConstraints:diagnostics:retryOnPackagePathMismatch:) + 3779
126  swift-build                        0x000000010def69f0 Workspace.loadPackageGraph(root:createMultipleTestProducts:createREPLProduct:forceResolvedVersions:diagnostics:) + 630
Fatal access conflict detected.
Abort trap: 6

@ankitspd
Copy link
Member

This is not expected to work but SwiftPM shouldn't crash..

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
@sjavora
Copy link
Contributor

sjavora commented Jan 30, 2024

@tomerd with Swift 5.9.2 I get the following output, not a crash:

error: cyclic dependency declaration found: PackageA -> PackageB -> PackageA

@tomerd tomerd closed this as completed Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants