[Bug 12171] New: adding popupmenu to itself, then using finditem causes stack overflow

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Mar 23 11:31:13 CDT 2008


http://bugs.winehq.org/show_bug.cgi?id=12171

           Summary: adding popupmenu to itself, then using finditem causes
                    stack overflow
           Product: Wine
           Version: 0.9.58.
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: user32
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: mark.dufour at gmail.com


The following code crashes WINE, but not Windows. It adds a popupmenu to the
popupmenu itself, then calls MENU_FindItem via GetMenuState. MENU_FindItem
keeps following the loop until it crashes with a stack overflow. Windows reacts
a bit strangely, too, but does not crash. Messing around in MENU_FindItem
allows WZebra (othello program, listed in the appdb) to start, but I was unable
to figure out the correct solution. Not sure if WZebra accidentally creates a
temporary loop, or that this is caused by some other regression. WZebra used to
work great a long time ago.

        /* sub menu */
        hSubMenu = CreatePopupMenu();
        InsertMenu(hSubMenu, -1, MF_BYPOSITION, 1234, "loop");

        /* main menu */
        hMenu = CreateMenu();
        InsertMenu(hMenu, -1, MF_BYPOSITION | MF_POPUP, (UINT)hSubMenu,
"&File");

        /* add popupmenu to itself */
        ModifyMenu(hSubMenu, 1234, MF_POPUP, (UINT)hSubMenu, "loop");

        /* MENU_FindItem ends up in infinite recursion */
        GetMenuState(hMenu, (UINT)hSubMenu, 0);


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list