Brewtarget / brewtarget

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

core dump when right clicking the OG label on the main screen #708

Closed mikfire closed 1 year ago

mikfire commented 1 year ago

This is repeatable but I haven't tested it against a clean database yet. I am opening this ticket because I am brewing and don't have time to fix it right now.

[12:48:35.771] (1drg8ygz40) ERROR : QString EnumStringMapping::enumToString(E) const [with E = Measurement::SystemOfMeasurement] Coding error: no string mapping found for 10
Stacktrace:
 0# Logging::getStackTrace() in ./brewtarget
 1# QString EnumStringMapping::enumToString<Measurement::SystemOfMeasurement>(Measurement::SystemOfMeasurement) const in ./brewtarget
 2# Measurement::getDisplayName(Measurement::SystemOfMeasurement) in ./brewtarget
 3# UnitAndScalePopUpMenu::create(QWidget*, Measurement::PhysicalQuantity, std::optional<Measurement::SystemOfMeasurement>, std::optional<Measurement::UnitSystem::RelativeScale>) in ./brewtarget
 4# BtLabel::initializeMenu() in ./brewtarget
 5# BtLabel::popContextMenu(QPoint const&) in ./brewtarget
 6# QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QPoint const&>, void, void (BtLabel::*)(QPoint const&)>::call(void (BtLabel::*)(QPoint const&), BtLabel*, void**) in ./brewtarget
 7# void QtPrivate::FunctionPointer<void (BtLabel::*)(QPoint const&)>::call<QtPrivate::List<QPoint const&>, void>(void (BtLabel::*)(QPoint const&), BtLabel*, void**) in ./brewtarget
 8# QtPrivate::QSlotObject<void (BtLabel::*)(QPoint const&), QtPrivate::List<QPoint const&>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) in ./brewtarget
 9# 0x00007FAE14768F4D in /usr/lib64/libQt5Core.so.5
10# QWidget::customContextMenuRequested(QPoint const&) in /usr/lib64/libQt5Widgets.so.5
11# QWidget::event(QEvent*) in /usr/lib64/libQt5Widgets.so.5
12# QFrame::event(QEvent*) in /usr/lib64/libQt5Widgets.so.5
13# QApplicationPrivate::notify_helper(QObject*, QEvent*) in /usr/lib64/libQt5Widgets.so.5
14# QApplication::notify(QObject*, QEvent*) in /usr/lib64/libQt5Widgets.so.5
15# QCoreApplication::notifyInternal2(QObject*, QEvent*) in /usr/lib64/libQt5Core.so.5
16# 0x00007FAE15194EC5 in /usr/lib64/libQt5Widgets.so.5
17# 0x00007FAE151977F0 in /usr/lib64/libQt5Widgets.so.5
18# QApplicationPrivate::notify_helper(QObject*, QEvent*) in /usr/lib64/libQt5Widgets.so.5
19# QCoreApplication::notifyInternal2(QObject*, QEvent*) in /usr/lib64/libQt5Core.so.5
20# QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) in /usr/lib64/libQt5Gui.so.5
21# QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) in /usr/lib64/libQt5Gui.so.5
22# 0x00007FAE10D7221A in /usr/lib64/libQt5XcbQpa.so.5
23# g_main_context_dispatch in /usr/lib64/libglib-2.0.so.0
24# 0x00007FAE133EACD8 in /usr/lib64/libglib-2.0.so.0
25# g_main_context_iteration in /usr/lib64/libglib-2.0.so.0
26# QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) in /usr/lib64/libQt5Core.so.5
27# QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) in /usr/lib64/libQt5Core.so.5
28# QCoreApplication::exec() in /usr/lib64/libQt5Core.so.5
29# Application::run() in ./brewtarget
30# main in ./brewtarget
31# 0x00007FAE13FF130A in /lib64/libc.so.6
32# __libc_start_main in /lib64/libc.so.6
33# _start in ./brewtarget
  [utils/EnumStringMapping.h:98]
[12:48:35.771] (1drg8ygz40) WARNING : Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt.
You must not let any exception whatsoever propagate through Qt code.
If that is not possible, in Qt 5 you must at least reimplement
QCoreApplication::notify() and catch all exceptions there.
  [:0]
mikfire commented 1 year ago

This also happens when right clicking the label on the brewnote.

matty0ung commented 1 year ago

Ah, hmm, interesting. That should hopefully be easy to fix by the looks of it. (Famous last words again.) Will try to have a look this week.

matty0ung commented 1 year ago

OK, I see what the problem is. I created a whole bunch of additional SystemOfMeasurement values but didn't add their names to the look-ups in measurement/SystemOfMeasurement.cpp. Will do a fix.

mikfire commented 1 year ago

If it doesn't show, I am trying to brew again. :grin:

matty0ung commented 1 year ago

This should be fixed in the 3.0.6 release.