Re:[3] Win32 version dying on startup


Subject: Re:[3] Win32 version dying on startup
From: Kenneth J.Davis (jeremyd@computer.org)
Date: Thu Nov 08 2001 - 01:13:07 CST


"Kenneth J.Davis" <jeremyd@computer.org> wrote on 11/7/2001 5:45:48 PM:
>
..
>
>I have made it a little further (compiling non-debug build, but with
>debug information) and found that it is dying in ev_Win32Menu.cpp,
>in synthesizeMenu(). The line:
>const UT_uint32 nrLabelItemsInLayout = m_pMenuLayout->getLayoutItemCount();
>is returning a really large value. If I hard code it to something
>like 3 (UT_uint32 nrLabelItemsInLayout = 3;) then AbiWord starts and
>I can enter text (editing, toolbars, etc all seem fine), but trying to
>open the file menu item (it only has the file one shown since I obviously
>set the count wrong above) cause AbiWord to die.
>
>I am going to continue and try and track down what is causing the wrong
>count in the UT_Vector. Hopefully I can provide a patch later tonight,
>but if not, maybe this will help who ever else tries and solves this issue.
>
>Jeremy
>jeremyd@computer.org

Hello all,

I am still trying to figure why its dying. If you change the
getLayoutItemCount() function to return a hard coded value instead of
the UT_Vector's size then you can set it to 74 which results in the
menu's shown up to the insert->break menu, if its increased to 75 then
the program once again dies. The shown menus appear to work.
In looking into how the menu's are created I am noticing something
odd (or maybe its too late and I should stop looking for now), it
appears as AP_MENU_ID__BOGUS1__ is supposed to be equal to 0 and
AP_MENU_ID__BOGUS2__ should be max menu item, so
AP_MENU_ID__BOGUS2__ - AP_MENU_ID__BOGUS1__ == # of menu items.
In debugging (and maybe there is just something screwed up in what
the debugger is showing?) the function AP_CreateMenuActionSet does
EV_Menu_ActionSet * pActionSet = new EV_Menu_ActionSet(AP_MENU_ID__BOGUS1__, AP_MENU_ID__BOGUS2__);
and stepping into EV_Menu_ActionSet::EV_Menu_ActionSet(XAP_Menu_Id first, XAP_Menu_Id last)
first is 4304542 and last is 0. The code expects first to be <= last, and from looking
at how the value of AP_MENU_ID__BOGUS1__ is generated I would expect this.
Anyway, if I modify this function to flip first and last if last < first and
add a if (!pAction) break; to synthesizeMenu() after pAction is set, then
abiword can once again start, however it only displays the menus
up to the insert menu and trying to use any menu causes the program to
die.

Its late so I am going to stop looking for now. I would appreciate
it if someone familar with the menu code could help me if I am
misunderstanding the code and possibly give me an idea where I
should be looking. (At all the places it dies I believe are the
result of trying to dereference a NULL pointer somewhere in the
menu logic. And in case you missed it, this only happens in the
release build not the abi_opt_debug build [not to be confused with
whether debugging information is compiled in or not])

Thank you,
Jeremy Davis
jeremyd@computer.org



This archive was generated by hypermail 2b25 : Thu Nov 08 2001 - 01:44:11 CST