Issue 71300 - Crash when executing autotest format.bas / MenuSelect(0)
Summary: Crash when executing autotest format.bas / MenuSelect(0)
Status: CLOSED FIXED
Alias: None
Product: Draw
Classification: Application
Component: ui (show other issues)
Version: 680m185
Hardware: All All
: P2 Trivial (vote)
Target Milestone: OOo 2.3
Assignee: wolframgarten
QA Contact: issues@graphics
URL:
Keywords:
: 75420 (view as issue list)
Depends on:
Blocks:
 
Reported: 2006-11-07 15:14 UTC by wolframgarten
Modified: 2007-06-06 09:23 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description wolframgarten 2006-11-07 15:14:54 UTC
When executing the test I get a crash.
tiFormat3D_Effekte
--- created RECTANGLE; xPosition @ -2,50cm
   The 3D-Effects-dialogue was open. Check why.
- Perspective seems to work
--- created RECTANGLE 2
- Creating a lath object seems to work
--- created RECTANGLE 3
Server Timeout while waiting for answer. Sequence No: 648
global::system::inc::PleaseRecover: No office running while trying to recover: 

The ID of the error report is r7fdd6.
Comment 1 groucho266 2006-11-24 09:25:19 UTC
This crash is caused by the test script itself.  In the
graphics/level1/inc/global/g_format.inc script in the tiFormat3D_Effekte
function there is a MenuSelect(0) statement that is a workaround for issue 68585
to close context menus on Solaris.

This slot 0 is an invalid slot id.  Normally this is not a big problem because
nobody uses slot 0 (it is invalid).  In this case, however, there are the new
shells for the left and right pane.  They do no use any slots at all, but to
tell the SFX2 that, they provide a slot map with exactly one entry.  This entry
has the, supposedly, dummy slot id 0.

When now the MenuSelect(0) call is made there are two shells on the shell stack
which claim to support slot 0.  Therefore slot 0 is dispatched to one of the
side panes.  These, however, can not properly manage this slot (they procide a
zero callback pointer) and crash.

Other shells, like that of font work tool bar, use such a dummy slot map, too,
and would cause the same crash, were they active and on the shell stack at the
time the MenuSelect(0) is called.
Comment 2 groucho266 2006-11-24 09:46:41 UTC
I set the resolution to INVALID, because this crash is directly caused by the
test script, which tries to workaround issue 68585 by dispatching a slot that
normally would not be dispatched.  I talked with fredrikh about this and he
agreed to modify the test script so, that this workaround is not, or at least
not on Linux and Solaris, used anymore.
Comment 3 groucho266 2006-11-24 15:04:38 UTC
Please verify.
Comment 4 wolframgarten 2007-02-01 12:17:51 UTC
Does not occure anymore.
Comment 5 wolframgarten 2007-02-01 12:18:33 UTC
Closed.
Comment 6 wolframgarten 2007-02-01 13:33:13 UTC
Target changed.
Comment 7 groucho266 2007-03-16 11:17:45 UTC
It happens again in CWS components1.

One possible solution to this is to not call the tiFormat3D_Effekte test for all
platforms.  At the moment the test is called for all platforms except Solaris SPARC.
Comment 8 groucho266 2007-03-16 11:18:20 UTC
Please have a look.
Comment 9 groucho266 2007-03-16 11:19:24 UTC
*** Issue 75420 has been marked as a duplicate of this issue. ***
Comment 10 fredrik.haegg 2007-03-19 19:52:38 UTC
MenuSelect(0) is used to close an opened Contextmenu. 
(after for instance opening it to see what entries it contains)

And since this is the only official way to close an opened context-menu, 
without calling any slots in it, I reassign this issue to GH. 
Comment 11 fredrik.haegg 2007-03-19 19:53:47 UTC
Add myself to the cc-list.
Comment 12 groucho266 2007-03-23 12:57:50 UTC
Changed target to that of components1 cws.
Comment 13 gregor.hartmann 2007-03-23 16:19:34 UTC
andre if you can tell me a different way to close an open context menu (in C++
using VCL) I will be glad to implement it.
Originally the method to use MenuSelect(0) was recomended by mba, but that of
corse was pre framework (it is framework isn't it) So now we will have to change
something here.

Comment 14 groucho266 2007-03-23 16:34:55 UTC
I just talked with CD about this.  He said that calling slot 0 never was a good
idea.  When that does not crash it closes the context menu as side effect that
may or may not be present tomorrow.

A better alternative is the simulation of pressing the ESC key.

An even better one would use the API to directly access the currently open
context menu and tell it to close.
Comment 15 jogi 2007-03-27 09:54:46 UTC
cc'ing JSI
Comment 16 carsten.driesner 2007-03-27 09:56:30 UTC
cd: Set on CC.
Comment 17 carsten.driesner 2007-03-27 09:59:09 UTC
cd->gh: Please contact me so we can discuss this issue in detail.
Comment 18 groucho266 2007-03-28 15:26:54 UTC
We will fix this crash in SFX by (largely) ignoring the slot 0 call. 

The crash has its origin in the SfxDispatcher::GetShellAndSlot_Impl() method.
There the slot data for slot 0 is looked up.  This yields a valid structure with
NULL pointers for the Exec function.  That would be OK but missing Exec function
causes a call to GetRealSlot() at the interface which returns a NULL pointer as
slot data.  This pointer is not checked and GetShellAndSlot_Impl() returns
sal_True wich is interpreted by the calling function that the slot data is valid.

The fix will be to add the missing check of the final slot data and return
sal_False when that is NULL.
Comment 19 groucho266 2007-03-28 15:28:20 UTC
Checking the proposed fix.
Comment 20 groucho266 2007-03-30 12:07:53 UTC
Fixed as described above.

Modified file is sfx2/source/control/dispatch    rev. 1.46.120.1
Comment 21 groucho266 2007-03-30 12:08:39 UTC
Please verify.
Comment 22 wolframgarten 2007-03-30 15:05:18 UTC
Verified in CWS.
Comment 23 wolframgarten 2007-04-12 14:12:54 UTC
Tested in master m208. Closed.
Comment 24 gregor.hartmann 2007-06-06 09:23:51 UTC
changing title