-
Notifications
You must be signed in to change notification settings - Fork 153
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
AttributeGraph: cycle detected through attribute xx on macOS #63
Comments
Using "Memory Graph" tool + AGDebugKit + the following helper function, I managed to get the cycled graph. public func magic(_ inputs: String) {
let substrings = inputs.components(separatedBy: "0x")
// Convert each substring to an Int, using the `strtoul` function
var intArray: [Int] = []
for substring in substrings {
if substring.isEmpty {
continue
}
let intVal = strtoul(substring, nil, 16)
intArray.append(Int(intVal))
}
for (index, intValue) in intArray.enumerated() {
export(intValue, index: index+1)
}
}
func export(_ bitPattern: Int, index: Int) {
let graph = Graph(bitPattern: bitPattern)
let dot = graph.dot ?? ""
let path = URL(fileURLWithPath: "\(NSHomeDirectory())/Downloads/FT/\(index).dot")
do {
try dot.write(to: path, atomically: true, encoding: .utf8)
} catch {
print("Error writing to file: \(error)")
}
} cycled part graph svg full graph svg
With the "Evaluation stack" info, we can get a hint the issue occurs in
The root issue is upstream update: |
A more concise example to illustrate this issue: // Set AG_TRAP_CYCLES=1 in env
@main
struct DemoApp: App {
@State private var sheet = false
var body: some Scene {
WindowGroup {
Button("Open Sheet") { sheet.toggle() }
.sheet(isPresented: $sheet) {
GeometryReader { proxy in
let size = proxy.size // Thread 1: signal SIGABRT
ForEach(0..<10) { Text("\($0.debugDescription)") }
}
}
}
}
}
|
Before Apple fix it, I think we should consider reimplementing related modifiers(eg. |
Apple has disabled SwiftUI symbol since macOS 13. Reproduced the issue on macOS 12.6.1 + Xcode 13.4.1. Here is the full backtrace.
|
A mini reproductive demo.
Env:
Xcode 15.2.0 + Swift 5.9.1
macOS 14.4.1
Related Issue: Lakr233/FixTim#10
The text was updated successfully, but these errors were encountered: