-
Notifications
You must be signed in to change notification settings - Fork 134
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
Crash at closing after deleting a hop #116
Comments
|
Valgrind reports a bunch of invalid reads of size 8 at exit. |
From my first investigation, it seems that the crash happens because the error log occurs in the same time of the cleanup function. It crashes at the line |
Ok, so there is a race condition between logging and exiting we should fix.
|
This is a snotty bug. As far as I can tell, you don't even need to delete the hop. Just add it and then close brewtarget. Core will be dumped. Deleting an existing hop won't cause a problem. I can somewhat clean up the core dump, but then I get a mass of "database not open errors" and " Oddly enough. In MainWindow::closeEvent(), we call Database::instance().unload(). Control passes back to Brewtarget::run(), which tears the windows down and then calls Database::dropInstance(). If I move the unload() call to dropInstance, all the problems go away. I suspect the race condition is that we have closed the database before we have torn all the windows down. But I have no idea why the hops alone cause the problem. I've a simple patch if we are willing to accept "this fixes it, but I don't know why". |
Hmm. This fixes it too:
It still doesn't explain why every other bleeding dialog doesn't do this. |
What's really annoying me is that if you add a hop by pressing the + on the hop tab, this crash doesn't happen. So there's a difference between how the hop tab is opening the editor and how the tree is that I just don't understand |
Deleting had nothing to do with it, but adding a new hop did. For reasons I still do NOT understand, the hop table was attempting to refresh itself on delete. I went through any number of interations, but could never quite figure out why. This is the easiest of the fixes I found -- the database isn't closed until after we tear all the windows down. Since MainWindow doesn't open the DB, it shouldn't close it either. I still cannot explain why the hop editor alone does this, and not the misc editor.
Closes #116 - Crash at closing after deleting hop
Closed with merge request #300. Not the cleanest solution, but it solves the immediate problem |
This bug is very simple to reproduce:
The text was updated successfully, but these errors were encountered: