Issue 84277 - Calc crashes if cell uses faulty macro for validation
Summary: Calc crashes if cell uses faulty macro for validation
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 2.3
Hardware: All All
: P2 Trivial (vote)
Target Milestone: ---
Assignee: oc
QA Contact: issues@sc
URL:
Keywords: crash
Depends on:
Blocks:
 
Reported: 2007-12-05 18:30 UTC by silvercapo
Modified: 2013-08-07 15:15 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Demonstrates the error (7.12 KB, application/vnd.sun.xml.calc)
2008-01-09 22:46 UTC, silvercapo
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description silvercapo 2007-12-05 18:30:29 UTC
(Actually this was found on OOo 2.3.1 but can't seem to select that in the Bug
Reporting tool yet)

Calc crashes when using a macro containing errors to generate list of values.

STEPS TO REPRODUCE THE PROBLEM
1. Open a new Calc spreadsheet, and define a macro with some errors in it such as:
Sub SubContainingErrors
   ' Some random text that BASIC won't understand
   This Is Not Code
End Sub

2. Select a cell, and goto Data -> Validity
3. In 'Allow', enter 'Cell Range'; and for 'Source', enter
'SubContainingErrors()'; also ensure that 'Show Selection List' is checked.
4. OK the Validity dialog.
5. Click on the dropdown for the cell. The BASIC Interpreter generates a few
errors, then Calc informs the user of an unexpected crash.

PROPOSED SOLUTION
Instead of crashing, the BASIC Interpreter should just generate the runtime
errors then allow the user to continue working on the spreadsheet / fix the macro.
Comment 1 kpalagin 2008-01-09 20:20:31 UTC
Can't reproduce with 2.4m241 on WinXP.

silvercapo,
could you, please, attach sample doc with macro etc defined?

Thanks.
Comment 2 silvercapo 2008-01-09 22:46:33 UTC
Created attachment 50768 [details]
Demonstrates the error
Comment 3 silvercapo 2008-01-09 22:48:17 UTC
Attached a document demonstrating this - try to open the dropdown in the first
cell A1, and Calc eventually crashes.

Apologies - in my original STEPS TO REPRODUCE THE PROBLEM - the Sub in step (1)
should be a Function
Comment 4 kpalagin 2008-01-10 07:01:18 UTC
Confirming with 2.4m241 on WinXP - as described.

Setting keyword, priority.
Comment 5 frank 2008-01-10 09:07:00 UTC
Hi Andreas,

seems to be yours.

Frank
Comment 6 ab 2008-01-10 10:24:54 UTC
ab->fst: It only seems... :-)

ab->nn: The crash happens in calc, Basic isn't even on the stack any more
(from src680 m239 wntmsci10.pro):

>	sc680mi.dll!ScGridWindow::DoAutoFilterMenue(short nCol=0, long nRow=0,
unsigned char bDataSelect='')  Line 963 + 0x6 bytes	C++
 	sc680mi.dll!ScGridWindow::HandleMouseButtonDown(const MouseEvent &
rMEvt={...})  Line 1671	C++
 	sc680mi.dll!ScGridWindow::MouseButtonDown(const MouseEvent & rMEvt={...}) 
Line 1375	C++
 	vcl680mi.dll!ImplHandleMouseEvent(Window * pWindow=0x06f32b28, unsigned short
nSVEvent=1, unsigned char bMouseLeave=0, long nX=16777367, long nY=0, unsigned
long nMsgTime=254241000, unsigned short nCode=1, unsigned short nMode=3)  Line
882	C++
 	vcl680mi.dll!ImplHandleSalMouseButtonDown(Window * pWindow=0x06f32b28,
SalMouseEvent * pEvent=0x00eafab4)  Line 2107 + 0x2e bytes	C++
 	vcl680mi.dll!ImplWindowFrameProc(Window * pWindow=0x06f32b28, SalFrame *
__formal=0x06f32368, unsigned short nEvent=3, const void * pEvent=0x00eafab4)
 Line 2360	C++
 	vcl680mi.dll!SalFrame::CallCallback(unsigned short nEvent=3, const void *
pEvent=0x00eafab4)  Line 304 + 0x16 bytes	C++
 	vcl680mi.dll!ImplHandleMouseMsg(HWND__ * hWnd=0x000f0824, unsigned int
nMsg=513, unsigned int wParam=1, long lParam=0)  Line 3445	C++
 	vcl680mi.dll!SalFrameWndProc(HWND__ * hWnd=0x000f0824, unsigned int nMsg=513,
unsigned int wParam=1, long lParam=9896057, int & rDef=1)  Line 5737 + 0xf bytes	C++
 	vcl680mi.dll!SalFrameWndProcW(HWND__ * hWnd=0x000f0824, unsigned int nMsg=513,
unsigned int wParam=1, long lParam=9896057)  Line 6148 + 0x15 bytes	C++
 	user32.dll!7739b6e3() 	

Obviously the ScGridWindow* this = 0x000000ac is corrupt. Maybe there's a
problem with deactivation / focus lost. Please have a look.
Comment 7 niklas.nebel 2008-05-30 10:51:30 UTC
Fixed on CWS "dr62". Changed: gridwin.cxx 1.95.12.1.
Comment 8 niklas.nebel 2008-06-18 18:04:03 UTC
Reassigning to QA for verification
Comment 9 oc 2008-06-24 09:43:27 UTC
verified in internal build cws_dr62
Comment 10 oc 2008-08-06 06:02:39 UTC
closed because fix available in builds OOO300_m1