-
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
Segfault merging database #291
Comments
Thanks for the report. I will dig into this later tonight. |
I am unable to replicate this. Could you make your database.sqlite file available via dropbox or something similar? |
email OK for the link? I see a gmail in the git log. |
That will be fine. Mik
|
I was afraid of that. I still cannot replicate the problem. The interesting bit in the stack trace is
It implies a compiler got a little aggressive in its optimizations. What OS and distro are you compiling on? gcc and qt versions would be helpful as well. Mik |
This is on Arch Linux, fully up to date (Qt 5.7, gcc 6.1). I'll try it with -O0 when I get home in a few hours. Arch defaults to -O2. |
Our builds, depending on a few flags, go for -O3. I will spin up an arch vm and see if I can see anything interesting. Mik
|
Doesn't seem to be optimization related, -O0 give me this bt:
|
Just did a build with gcc 5.4.0, same segfault |
It may be a Qt 5.7 thing. I am still on 5.6. I am building an arch vm instance today and tomorrow to see what I can see. What I find interesting is that both times "other" assumes some odd values -- optimized out in the first trace, a static 0x1 in the second. That should be a pointer, not NULL or 1. This is causing the object->metaObject()->className() call in copy() to fail. @rocketman768, can you explain what this line does:
It is way beyond my primitive understanding of C to parse that pointer magic. Mik |
|
Is it because we no longer have
|
Thanks for the explanation. Your question seems a very reasonable one, and leads immediately to a test. I would still be at a loss as to why it works fine on ubuntu 16.04 and gentoo. I've got archOS somewhat installed. Now it will be picking my way through the build to figure out what pieces I need or don't need. I should be able to test this in a bit. |
I still cannot reproduce on Arch OS. Even using your database. The only thing I can think of now is for me to generate a few patches send them to @Scimmia22 for testing. |
I'm willing to test, but if nobody can reproduce this, could it be something with my system? If so, it's likely not worth it. |
All segfaults are serious and wrong.
|
In that case, just let me know what you need to debug or if you have patches to try. |
Ok. I was able to track this down, finally. Thanks everybody for your patience with me. It isn't specific to your system, @Scimmia22. I realized I had to install the new database in /usr/local/share/brewtarget before the merge happened correctly. Once I did that, brewtarget crashed every time. Yes, as @rocketman768 suggested I had to change the function signature. I then ran into another bug that I think has been resident for a while, so had to fix that. I will be commit a branch tonight that seems to address the issues. |
In all of my wonderful refactors, I missed the function pointers in Database::makeTableParams(). The function pointers resulted in newYeast (for example) being called with 0x1 as the pointer to other, which lead to a sigsegv. I've modified the function pointers so they do the approximate right thing, and no cores. I also had to clean up a small problem with an insert statement.
Try that, please. |
That seems to do the job. No segfault. |
Closes #291 - Segfault merging database
Ok. The solution isn't quite as clean as I would like, but mr #293 seems to do the work. |
When updating from 2.3.1 to current develop branch (matches 2.4 branch), I get a popup "There may be new ingredients and recipes available. Would you like to add these to your database?". If I choose yes, brewtarget segfaults with this trace:
The text was updated successfully, but these errors were encountered: