Ticket #1560 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

"Fit" button causes crash in FitFunction

Reported by: Michael Whitty Owned by: Roman Tolchenov
Priority: major Milestone: Iteration 25
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Michael Whitty

Description

Present in [5983]

Reproduction steps:

  • Load raw file IRS38633 (or any other file, it seems)
  • Plot a single spectra
  • Open the Fit Function dialog
  • Right click on graph and "Add other function"
  • Click ok, then select the CompositeFunction and change it anything other than the options presented in the previous steps.
  • Click fit.

Causes a break point at this part of compositefunction.cpp (lines 622 to 629):

int CompositeFunction::functionIndex(int i)const
{
  if (i >= nParams() || i < 0)
  {
    throw std::out_of_range("Function parameter index out of range.");
  }
  return m_iFunction[i];
}

Call stack from debugger:

>	MantidAPI.dll!Mantid::API::CompositeFunction::functionIndex(int i=0)  Line 628 + 0xf bytes	C++
 	MantidAPI.dll!Mantid::API::CompositeFunction::getParameter(int i=0)  Line 202 + 0xc bytes	C++
 	MantidPlot.exe!0081d2c1() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for MantidPlot.exe]	
 	QtCored4.dll!QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject * receiver=0x0012b9c0, QEvent * event=0x0012c26c)  Line 692 + 0x24 bytes	C++
 	QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver=0x0ddcc0c0, QEvent * e=0x0012b9c0)  Line 3809 + 0x11 bytes	C++
 	QtGuid4.dll!QApplication::notify(QObject * receiver=0x0ddcc0c0, QEvent * e=0x0012b9c0)  Line 3774 + 0x10 bytes	C++
 	MantidPlot.exe!0077d434() 	
 	ntdll.dll!7c9374ba() 	
 	QtGuid4.dll!QWidget::qt_metacall(QMetaObject::Call _c=InvokeMetaMethod, int _id=21, void * * _a=0x0012bb34)  Line 176 + 0x18 bytes	C++
 	QtGuid4.dll!QDockWidget::qt_metacall(QMetaObject::Call _c=WriteProperty, int _id=1227336, void * * _a=0x00937d9d)  Line 99 + 0x14 bytes	C++
 	MantidPlot.exe!009fe29e() 	
 	QtCored4.dll!QMetaObject::activate(QObject * sender=0x0de16770, int from_signal_index=29, int to_signal_index=30, void * * argv=0x0012bb34)  Line 3028 + 0x2b bytes	C++
 	QtCored4.dll!QMetaObject::activate(QObject * sender=0x0de16770, const QMetaObject * m=0x01b363a4, int from_local_signal_index=2, int to_local_signal_index=3, void * * argv=0x0012bb34)  Line 3118 + 0x15 bytes	C++
 	QtGuid4.dll!QAbstractButton::clicked(bool _t1=false)  Line 185 + 0x17 bytes	C++
 	QtGuid4.dll!QAbstractButtonPrivate::emitClicked()  Line 546	C++
 	QtGuid4.dll!QAbstractButtonPrivate::click()  Line 538	C++
 	QtGuid4.dll!QAbstractButton::mouseReleaseEvent(QMouseEvent * e=0x0012c38c)  Line 1117	C++
 	QtGuid4.dll!QWidget::event(QEvent * event=0x0012c38c)  Line 7170	C++
 	QtGuid4.dll!QAbstractButton::event(QEvent * e=0x0012c38c)  Line 1079	C++
 	QtGuid4.dll!QPushButton::event(QEvent * e=0x0012c38c)  Line 659	C++
 	QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver=0x0de16770, QEvent * e=0x0012c38c)  Line 3809 + 0x11 bytes	C++
 	QtGuid4.dll!QApplication::notify(QObject * receiver=0x0de16770, QEvent * e=0x0012c38c)  Line 3534 + 0x2f bytes	C++
 	MantidPlot.exe!0077d434() 	
 	ntdll.dll!7c9101db() 	
 	msvcr80d.dll!_heap_alloc_base(unsigned int size=271658048)  Line 105 + 0x28 bytes	C
 	msvcr80d.dll!_unlock(int locknum=4)  Line 376	C
 	msvcr80d.dll!_heap_alloc_dbg(unsigned int nSize=16, int nBlockUse=1, const char * szFileName=0x00000000, int nLine=0)  Line 475 + 0x7 bytes	C++
 	msvcr80d.dll!_heap_alloc_dbg(unsigned int nSize=16, int nBlockUse=1, const char * szFileName=0x00000000, int nLine=0)  Line 472 + 0xc bytes	C++
 	msvcr80d.dll!_nh_malloc_dbg(unsigned int nSize=1229068, int nhFlag=31361825, int nBlockUse=0, const char * szFileName=0x020c2648, int nLine=1229120)  Line 266 + 0x15 bytes	C++
 	QtCored4.dll!___native_vcclrit_reason()  + 0x193 bytes	C++
 	QtCored4.dll!qMalloc(unsigned int size=1229376)  Line 57 + 0xa bytes	C++
 	QtCored4.dll!QHash<QObject *,QObject * *>::createNode(unsigned int ah=32748939, QObject * const & akey=0x00a8382c, QObject * * const & avalue=0x01abde7c, QHashNode<QObject *,QObject * *> * * anextNode=0x549d2b52)  Line 521 + 0x3b bytes	C++
 	0012c1d4()	
 	QtCored4.dll!QMutexLocker::unlock()  Line 116	C++
 	QtCored4.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver=0x0de16770, QEvent * event=0x0012c38c)  Line 218 + 0x38 bytes	C++
 	QtGuid4.dll!QApplicationPrivate::sendMouseEvent(QWidget * receiver=0x0de16770, QMouseEvent * event=0x0012c38c, QWidget * alienWidget=0x0de16770, QWidget * nativeWidget=0x0ddcc0c0, QWidget * * buttonDown=0x01d1874c, QPointer<QWidget> & lastMouseReceiver={...})  Line 2799 + 0xe bytes	C++
 	QtGuid4.dll!QETWidget::translateMouseEvent(const tagMSG & msg={...})  Line 3091 + 0x28 bytes	C++
 	QtGuid4.dll!QtWndProc(HWND__ * hwnd=0x00040860, unsigned int message=514, unsigned int wParam=0, long lParam=20119623)  Line 1549 + 0xc bytes	C++
 	user32.dll!7e418734() 	
 	user32.dll!7e418816() 	
 	user32.dll!7e4189cd() 	
 	user32.dll!7e418a10() 	
 	QtCored4.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Line 743 + 0x21 bytes	C++
 	QtGuid4.dll!QGuiEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Line 1090 + 0x15 bytes	C++
 	QtCored4.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Line 150	C++
 	QtCored4.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...})  Line 200 + 0x1c bytes	C++
 	QtCored4.dll!QCoreApplication::exec()  Line 851 + 0x15 bytes	C++
 	QtGuid4.dll!QApplication::exec()  Line 3338	C++
 	MantidPlot.exe!006c4642() 	
 	msvcr80d.dll!_heap_alloc_dbg(unsigned int nSize=2127052093, int nBlockUse=0, const char * szFileName=0x0ddcc0c0, int nLine=232571072)  Line 472 + 0xc bytes	C++
 	msvcr80d.dll!_onexit_nolock(int (void)* func=0x0d791850)  Line 157 + 0x9 bytes	C
 	00212a0e()	
 	MantidPlot.exe!00974d66() 	
 	MantidPlot.exe!00974bbd() 	
 	kernel32.dll!7c817077() 	
 	MantidPlot.exe!0070002c() 	
 	MantidPlot.exe!00720041() 	
 	MantidPlot.exe!00750074() 	
 	MantidPlot.exe!0070002c() 	
 	MantidPlot.exe!00690068() 	
 	MantidPlot.exe!005c0053() 	
 	MantidPlot.exe!00740052() 	
 	MantidPlot.exe!00690068() 	
 	MantidPlot.exe!005c0053() 	
 	MantidPlot.exe!00740052() 	
 	MantidPlot.exe!00740052() 	
 	MantidPlot.exe!00690068() 	
 	MantidPlot.exe!005c0053() 	
 	MantidPlot.exe!00690068() 	
 	MantidPlot.exe!005c0053() 	

Change History

comment:1 Changed 10 years ago by Roman Tolchenov

  • Status changed from new to accepted

comment:2 Changed 10 years ago by Roman Tolchenov

(In [5993]) CompositeFunction::replaceFunction accepts now that the old function may not have any parameters. re #1560

comment:3 Changed 10 years ago by Roman Tolchenov

(In [5995]) Added a test for that situation. re #1560

comment:4 Changed 10 years ago by Roman Tolchenov

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:5 Changed 10 years ago by Michael Whitty

  • Status changed from verify to verifying
  • Component set to Mantid
  • Tester set to Michael Whitty

comment:6 Changed 10 years ago by Michael Whitty

  • Status changed from verifying to closed

this problem no longer exists in r[7139].

comment:7 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 2407

Note: See TracTickets for help on using tickets.