rustymyers / QnAGUI

A GUI for QnA, a tool for writing relevance for BigFix on the Mac.
4 stars 2 forks source link

QnA GUI crashes on 10.12.1 when evaluating `properties` #4

Closed jgstew closed 7 years ago

jgstew commented 7 years ago

other queries seem to work fine, but if I try to evaluate properties, which has a very large result, QnA GUI crashes.

Not sure if it always did this.

jgstew commented 7 years ago

If I had to guess, I'd say the results from properties is overflowing a buffer or something, or just returning a too large result.

jgstew commented 7 years ago

This does work: properties whose(it as string contains "client")

This returns a subset of the results of properties which suggests this is an issue of a result that is too large.

On windows, the properties command returns about 116537 characters.

jgstew commented 7 years ago

This crash happens at or after line 82 here: https://github.com/rustymyers/QnAGUI/blob/master/QnA/ViewController.swift#L82

I set breakpoints on all of the lines around here and stepped through them in the debugger and QnA GUI seemed to hang on Line #82

I feel like this: task.waitUntilExit() or this: outpipe.fileHandleForReading.readDataToEndOfFile() are the most likely culprits.

rustymyers commented 7 years ago

Latest commit resolves this issue. Disabled the task.waitUntilExit method and it seems to work fine. No real memory or cpu/thread run aways.

jgstew commented 7 years ago

Interesting. I guess I should have tried that. I wonder if there is some sort of drawback or alternative. to .waitUntilExit()

Fixed by this: https://github.com/rustymyers/QnAGUI/blob/8a3bf5619fa24ec4b196f9161defb5c2aca01a0a/QnA/ViewController.swift#L84

In this commit: https://github.com/rustymyers/QnAGUI/commit/8a3bf5619fa24ec4b196f9161defb5c2aca01a0a

jgstew commented 7 years ago

Also, I wonder what the value is to Updating deployment target to 10.10