-
Notifications
You must be signed in to change notification settings - Fork 135
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 when exporting recipe #821
Comments
The export seems to work on my machine, so I'm wondering if the bug only happens with some recipes. If you want to send me your database file (either here or by email to matt AT brewtarget.beer) I can have another look. Otherwise, if you're building from source, I can suggest how to get some more diagnostics. |
My database has been edited, repaired and converted many times so I went back to the default database. It also crashes when I try to export a recipe. I did a complete clean and rebuild. Still crashes. The recipe file has just an XML header. Log file attached. |
Thanks. I can see what it's doing now. It's trying to export the Style record, which is a sub-record of the Recipe one, but it's still using the Recipe field mappings instead of picking up the Style ones, so it goes round in circles, tries to find the style of a style and barfs. Should be a small fix (I hope). Will have a dig. |
I have a fix for the first crash. Found a subsequent one. I know what's causing it. Just having a think about the right way to fix it. |
There were basically three bugs here. The one I described above and two others. One of the other bugs was about pointer types: a place in the code where we assumed raw pointers were always returned, which used to be true, but which now needs to deal with the possibility of the returned value being a shared pointer. The other bug was about nested properties. Now that (because of BeerJSON), a fermentation and a boil are separate things from a recipe (ultimately making it easier to share boil profiles and fermentation profiles across recipes), we have to map that across to BeerXML where things such as primary fermentation temperature are direct properties of recipes. We have all the mechanism to do that, but it changes one of the assumptions in the code. In the old days we always had something, even if it was 0 or blank, to write out for secondary fermentation temperature. But now, it's possible there will not be a second stage on the recipe's fermentation, so we can't get any temperature for it. That's OK, we just don't skip the field and don't write it out in those circumstances (instead of asserting). |
As ever, please shout if you find other bugs. (There may still be a few "QMetaProperty::read: Unable to handle unregistered datatype" errors to crawl out of the woodwork. They are annoying but a one-line fix to remedy.) |
Fresh pull and build. Same error. Log file attached. |
The log looks like it comes from the "current" code rather than the 822 patch. (You can tell because the assert on line 149 of I'll merge the patch now, so you should see the fix in the main branch. |
Of course I didn't notice the patch. Will try again and let you know what happens. |
I can export again. The XML looks good. Everything in the log file is INFO, except for the two null warnings that don't appear to affect the export. Thanks. [13:07:36.481] (1bytoqnj5s) WARNING : QObject::connect(QPushButton, Unknown): invalid nullptr parameter [:0] |
Having a look at the warnings. It's a bit of plumbing etc I forgot to do for the new boil and fermentation editors. |
Warnings should be fixed in #825 (along with a few other things). Still a bit of tidy-up to do, but headed in the right direction. |
Fix included in 4.0.4. |
Brewtarget crashes when I try to export a recipe. Both BeerJSON and BeerXML formats are affected. The error is:
[15:56:04.678] (19qj0mxk8w) ERROR : ASSERT: "propertyIndex >= 0" in file /home/jim/Src/brewtarget/src/utils/PropertyPath.cpp, line 149 [utils/PropertyPath.cpp:149]
The text was updated successfully, but these errors were encountered: