Skip to content
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

Memory access crash on create new recipe #748

Closed
95ep opened this issue May 1, 2023 · 3 comments
Closed

Memory access crash on create new recipe #748

95ep opened this issue May 1, 2023 · 3 comments

Comments

@95ep
Copy link

95ep commented May 1, 2023

Brewtarget quits unexpectedly when trying to create a new recipe, unlike issue #747 the program crashes without any pop-up warning.

Brewtarget logs are as follows:

[16:19:31.541] (3yy7on4) WARNING : int ObjectStoreWrapper::insert(NE &) [NE = Recipe] Deprecated function  [database/ObjectStoreWrapper.h:149]
[16:19:31.541] (3yy7on4) WARNING : int ObjectStoreTyped<Recipe>::insert(NE &) [NE = Recipe] Deprecated function  [database/ObjectStoreTyped.h:106]

Apple crash report is more detailed. I tried to extract what I though to be relevant, I don't want to upload the full report..

rashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000058
Exception Codes:       0x0000000000000001, 0x0000000000000058

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [78585]

VM Region Info: 0x58 is not in any region.  Bytes before following region: 140722853593000
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      mapped file              7ffc97b34000-7ffca5fe0000 [228.7M] r-x/r-x SM=COW  ...t_id=86fb12f7

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   Brewtarget                    	       0x104a6299c Style::ogMin() const + 12
1   Brewtarget                    	       0x104857da3 MainWindow::showChanges(QMetaProperty*) + 755
2   Brewtarget                    	       0x10484dbaa MainWindow::setRecipe(Recipe*) + 1578
3   Brewtarget                    	       0x10484ee96 MainWindow::newRecipe() + 2854
4   Brewtarget                    	       0x10487264b QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (MainWindow::*)()>::call(void (MainWindow::*)(), MainWindow*, void**) + 123
5   Brewtarget                    	       0x1048725bd void QtPrivate::FunctionPointer<void (MainWindow::*)()>::call<QtPrivate::List<>, void>(void (MainWindow::*)(), MainWindow*, void**) + 77
6   Brewtarget                    	       0x104872512 QtPrivate::QSlotObject<void (MainWindow::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) + 146
7   QtCore                        	       0x10ede02e5 0x10ebc4000 + 2212581
8   QtWidgets                     	       0x110b0c356 QAction::activate(QAction::ActionEvent) + 310
9   QtWidgets                     	       0x110bffed0 0x110b05000 + 1027792
10  QtWidgets                     	       0x110c010ce QAbstractButton::mouseReleaseEvent(QMouseEvent*) + 270
11  QtWidgets                     	       0x110d0192f QToolButton::mouseReleaseEvent(QMouseEvent*) + 15
12  QtWidgets                     	       0x110b5147b QWidget::event(QEvent*) + 443
13  QtWidgets                     	       0x110d020e8 QToolButton::event(QEvent*) + 312
14  QtWidgets                     	       0x110b15886 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 262
15  QtWidgets                     	       0x110b18534 QApplication::notify(QObject*, QEvent*) + 6916
16  QtCore                        	       0x10edaed67 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 167
17  QtWidgets                     	       0x110b16182 QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) + 882
18  QtWidgets                     	       0x110b702de 0x110b05000 + 439006
19  QtWidgets                     	       0x110b6ea6f 0x110b05000 + 432751
20  QtWidgets                     	       0x110b15886 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 262
21  QtWidgets                     	       0x110b16c0d QApplication::notify(QObject*, QEvent*) + 477
22  QtCore                        	       0x10edaed67 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 167
23  QtGui                         	       0x10fccdd4c QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 3500
24  QtGui                         	       0x10fcb3d0c QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 204
25  libqcocoa.dylib               	       0x11427a218 0x11423e000 + 246296
26  CoreFoundation                	    0x7ff80abeea36 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
27  CoreFoundation                	    0x7ff80abee9d9 __CFRunLoopDoSource0 + 157
28  CoreFoundation                	    0x7ff80abee7b6 __CFRunLoopDoSources0 + 217
29  CoreFoundation                	    0x7ff80abed43a __CFRunLoopRun + 916
30  CoreFoundation                	    0x7ff80abeca4c CFRunLoopRunSpecific + 560
31  HIToolbox                     	    0x7ff814b1efcd RunCurrentEventLoopInMode + 292
32  HIToolbox                     	    0x7ff814b1ec14 ReceiveNextEventCommon + 199
33  HIToolbox                     	    0x7ff814b1eb38 _BlockUntilNextEventMatchingListInModeWithFilter + 64
34  AppKit                        	    0x7ff80dbde7a0 _DPSNextEvent + 858
35  AppKit                        	    0x7ff80dbdd64a -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1214
36  AppKit                        	    0x7ff80dbcfcb8 -[NSApplication run] + 586
37  libqcocoa.dylib               	       0x114278ef3 0x11423e000 + 241395
38  QtCore                        	       0x10edab336 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 502
39  QtCore                        	       0x10edaf302 QCoreApplication::exec() + 130
40  Brewtarget                    	       0x1046c4ae3 Application::run() + 323
41  Brewtarget                    	       0x104664d31 main + 4833
42  dyld                          	       0x20512341f start + 1903
@matty0ung
Copy link
Contributor

Thanks for including the stack trace. It's always useful!

More "good" news is that I can also reproduce this on Linux.

I can see the immediate cause of the problem. When we create a new recipe, it has no style, and then we try to display info about the style and hit a null pointer exception. I expect the fix is just to add a check "is style null".

This was referenced May 2, 2023
@matty0ung
Copy link
Contributor

Should be fixed in https://github.com/Brewtarget/brewtarget/releases/tag/v3.0.9. Please re-open if not!

@95ep
Copy link
Author

95ep commented May 15, 2023

Looks like it's working, greatly appreciated! Plan to do a brew later this week, so will test it out more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants