-
-
Notifications
You must be signed in to change notification settings - Fork 838
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
Stats crashes on startup #2122
Comments
Thx, please use the latest version of the Stats. Does it crash at the start or after some time? |
I am using the latest version, you can find all the reports for the 2.11.9 version here. It crashes right away. The icon does not appear anywhere at all, there is no sign of life. It stopped working in the last couple of days. I can't be more precise due to the fact that I was away from my computer during this period of time. |
try to run this build: |
hmm, thx. What about this one? PS: I'm just disabling the features till the crash stops cause don't see the crash reason( |
Fair enough. Console also shows the following error: |
In order to help you out - and avoid you having to "waste" time on this: are you able to reproduce the error? Could it be on my end? Or it would not generate a crash report in that case? |
nope, don't care about the logs. There is nothing useful in 99% cases. Only for fine tune/debug. |
This one works! |
Did you manage to fix/identify the issue? Will you be releasing a patch? The last one produces this Crash Report |
Running the app from Xcode, the error appears on
|
hmm, looks like disk module causes the crash. Now we need to fix the problematic place. PS: wow, I was not expecting this part. |
please put: And try to run the app. |
Output:
|
wow. Please put |
Code: public init(width: CGFloat, size: Int64, free: Int64) {
self.size = size
super.init(frame: NSRect(x: 0, y: 0, width: width, height: 10))
let view: NSView = NSView(frame: NSRect(x: 1, y: 0, width: self.frame.width - 2, height: self.frame.height))
view.wantsLayer = true
view.layer?.borderColor = NSColor.secondaryLabelColor.cgColor
view.layer?.borderWidth = 0.25
view.layer?.cornerRadius = 3
self.background = view
print("Size, Free, Size")
print(size, free, size)
let percentage = CGFloat(size - free) / CGFloat(size)
let width: CGFloat = (view.frame.width * (percentage < 0 ? 0 : percentage)) / 1
print("Width, view.frame.width, percentage")
print(width, view.frame.width, percentage)
self.usedBarSpace = NSView(frame: NSRect(x: 0, y: 0, width: width, height: view.frame.height))
self.usedBarSpace?.wantsLayer = true
self.usedBarSpace?.layer?.backgroundColor = NSColor.controlAccentColor.cgColor
view.addSubview(self.usedBarSpace!)
self.addSubview(view)
self.widthAnchor.constraint(equalToConstant: self.frame.width).isActive = true
self.heightAnchor.constraint(equalToConstant: self.frame.height).isActive = true
} Output:
|
wtf. Looks like some of your disk have 0 - size and free. Strange. |
Very weird, I will check that as well; glad I've found an edge case for Stats though :D |
By the way, running Edit: ejected the multiple .dmg disks to clean up (error persists)
|
please try this build: |
Works correctly; only shows two disks (MHD and LaCie - which are the only ones I have) |
thx. |
Surely! I am available |
At this point, I am wondering whether this is an issue with Stats, or whether there is some kind of phantom disk in my machine |
After the night, during which I turned off the mac, the error represents itself. Crash Report |
One point of failure might be here: private func freeDiskSpaceInBytes(_ path: URL) -> Int64 {
do {
if let url = URL(string: path.absoluteString) {
let values = try url.resourceValues(forKeys: [.volumeAvailableCapacityForImportantUsageKey])
if let capacity = values.volumeAvailableCapacityForImportantUsage, capacity != 0 {
return capacity
}
}
} catch let err {
error("error retrieving free space #1: \(err.localizedDescription)", log: self.log)
}
do {
let systemAttributes = try FileManager.default.attributesOfFileSystem(forPath: path.path)
if let freeSpace = (systemAttributes[FileAttributeKey.systemFreeSize] as? NSNumber)?.int64Value {
return freeSpace
}
} catch let err {
error("error retrieving free space: \(err.localizedDescription)", log: self.log)
}
return 0
}
private func totalDiskSpaceInBytes(_ path: URL) -> Int64 {
do {
let systemAttributes = try FileManager.default.attributesOfFileSystem(forPath: path.path)
if let totalSpace = (systemAttributes[FileAttributeKey.systemSize] as? NSNumber)?.int64Value {
return totalSpace
}
} catch let err {
error("error retrieving total space: \(err.localizedDescription)", log: self.log)
}
return 0
} Where, on error, you just return 0 for both the total disk space and the free disk space However, I can't consistantly get the error to raise: my Lacie sometimes appears as |
Looks like some problems with the disk driver or the disk itself. I have never seen something like this. |
I am currently running some diagnostics on the LaCie disk, brb |
First Aid is taking far more than expected (it's a 4TB HDD working on USB-C). I'll post the results here as soon as available (probably tomorrow morning) |
@exelban I can confirm that the disk does NOT appear to have any issues |
so maybe drivers |
I did a quick health checkup on the drivers as well, but there isn't anything out of the ordinary. |
thx for your feedback and quick help) |
Describe the bug
When opening the app - in any way and any circumstances - it fails to do so, producing a crash report.
This is a reopening of #2121 since I previously thought there was no crash report.
This issue might be related to #2047
Full Crash Report can be found here
Translated Crash Report here
Console produces this related error:
Details:
@exelban let me know if I should have continued on the other thread or if I am right opening this new one. Not trying to bother or create any inconvenience :D
I am available for further debugging if needed
The text was updated successfully, but these errors were encountered: