Brewtarget / brewtarget

Main brewtarget source code repository.
GNU General Public License v3.0
312 stars 134 forks source link

Water Chemistry: Crash when selecting added salt name or amount #685

Closed OWoolland closed 1 year ago

OWoolland commented 1 year ago

Hello, I've been having a play with the water chemistry tool that has been added. It's looking really cool and really promising, thank you for the work on it.

I'm having trouble using the interface, receiving:

munmap_chunk(): invalid pointer

when selecting a salt name or amount on the Water Chemistry tool. I have attached a full backtrace gdb.txt

I attempted to chase the error out but not being super familiar with Brewtarget's source code, QT or more complex databases I may have been barking up the wrong tree. I got as far as finding that disabling this line allowed the water calculator to proceed as I hoped but presumably wasn't a good idea for the software as a whole!

Having a look around in the database generated during compilation I notice that (for me) the Salt table appears to be empty. foo Could this be related?

All the best and keep up the good work!

FWIW I am mostly clean building in a Docker container to try to keep things sane.

matty0ung commented 1 year ago

Hi, Thanks for the detailed bug report and diagnostics. I'll have a look and see if I can workout what's going on.

matty0ung commented 1 year ago

OK, good news is I can reproduce the bug and I know why it's happening. I need to think about the right fix, which might not be entirely trivial, but I have a couple of ideas...

OWoolland commented 1 year ago

That's great! Good luck and thank you for taking a look 🙂

matty0ung commented 1 year ago

I have uploaded a fix that works-on-my-machineâ„¢ to https://github.com/Brewtarget/brewtarget/pull/684. We'll include it in the 3.0.4 release.

As ever, please don't hesitate to let us know if you hit other problems.

OWoolland commented 1 year ago

First impressions for me are that the fix works really nicely! Thanks again for looking in to it - amazingly quick response and fix!

From my perspective I am happy for the issue to close whenever it is appropriate.

All the best :)

matty0ung commented 1 year ago

Closing now that release 3.0.4 is out.