We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Error in regex causes remote IIS manger to crash. [Answered]RSS

15 replies

Last post Dec 02, 2009 01:12 AM by qbernard

  • Error in regex causes remote IIS manger to crash.

    Nov 17, 2009 08:14 AM|RQuadling|LINK

    Hello.

    Not exactly sure whose issue this is but ...

    I'm using the IIS Manger on my desktop to administer our 3 IIS7 web servers.

    I'm attempting to create a URL Rewrite Rule.

    I had inadvertently made a mistake with the regex.

    When I come to test the regex pattern, the manager closes. I sometimes get an error first.

    If I try this via RDP on the server, I get the proper message about my broken regex and I can continue.

    It seems that the error dialog doesn't get handled remotely and causes the local manager to quit.

    My local Application Event Log has the following entry:

    <div style="BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BACKGROUND-COLOR: #f7f7f7; BORDER-TOP: black 1px solid; BORDER-RIGHT: black 1px solid">

    IISMANAGER_CRASH

    IIS Manager terminated unexpectedly.

    Exception:System.EntryPointNotFoundException: Unable to find an entry point named 'TaskDialogIndirect' in DLL 'comctl32'.

    at Microsoft.Web.Management.Iis.Rewrite.RewriteModule.MessageBoxEx.NativeMethods.TaskDialogIndirect(TaskDialogConfig& pTaskConfig, Int32& pnButton, Int32& pnRadioButton, Boolean& pfVerificationFlagChecked)

    at Microsoft.Web.Management.Iis.Rewrite.RewriteModule.MessageBoxEx.ShowErrorMessage(IntPtr hwndParent, String caption, String message, Exception ex, Boolean isWarning)

    at Microsoft.Web.Management.Iis.Rewrite.RewriteModule.DisplayErrorMessage(IntPtr handle, Exception exception, String caption, ResourceManager resourceManager)

    at Microsoft.Web.Management.Iis.Rewrite.RewriteTaskForm.DisplayErrorMessage(Exception exception, ResourceManager resourceManager)

    at Microsoft.Web.Management.Iis.Rewrite.TestPatternForm.OnTestButtonClick(Object sender, EventArgs e)

    at System.Windows.Forms.Control.OnClick(EventArgs e)

    at System.Windows.Forms.Button.OnClick(EventArgs e)

    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

    at System.Windows.Forms.Control.WndProc(Message& m)

    at System.Windows.Forms.ButtonBase.WndProc(Message& m)

    at System.Windows.Forms.Button.WndProc(Message& m)

    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)

    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

    at System.Windows.Forms.Application.RunDialog(Form form)

    at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)

    at System.Windows.Forms.Form.ShowDialog()

    at Microsoft.Web.Management.Iis.Rewrite.MatchUrlUserControl.OnTestPatternButton_Click(Object sender, EventArgs e)

    at System.Windows.Forms.Control.OnClick(EventArgs e)

    at System.Windows.Forms.Button.OnClick(EventArgs e)

    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

    at System.Windows.Forms.Control.WndProc(Message& m)

    at System.Windows.Forms.ButtonBase.WndProc(Message& m)

    at System.Windows.Forms.Button.WndProc(Message& m)

    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)

    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

    at System.Windows.Forms.Application.Run(Form mainForm)

    at Microsoft.Web.Management.Host.Shell.ShellApplication.Execute(Boolean localDevelopmentMode, Boolean resetPreferences, Boolean resetPreferencesNoLaunch)

    Process:InetMgr

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    </div>

    Regards,

     Richard Quadling.

  • Re: Error in regex causes remote IIS manger to crash.

    Nov 17, 2009 12:50 PM|ruslany|LINK

    Can you please post the regex pattern that causes the crash?

  • Re: Error in regex causes remote IIS manger to crash.

    Nov 17, 2009 01:14 PM|CarlosAg|LINK

    Just to confirm, are you connecting from Windows XP or Windows 2003?

     

  • Re: Error in regex causes remote IIS manger to crash.

    Nov 18, 2009 03:48 AM|RQuadling|LINK

    The incorrect regex was ...

    ^(authentication|supply_data|versions)(#([a-z]++))?$


    I'm not sure there is anything actually wrong with the regex. RegexBuddy tells me the regex is ... <div style="BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BACKGROUND-COLOR: #f7f7f7; BORDER-TOP: black 1px solid; BORDER-RIGHT: black 1px solid">

    ^(authentication|supply_data|versions)(#([a-z]++))?$

    Options: case insensitive; ^ and $ match at line breaks

    Assert position at the beginning of a line (at beginning of the string or after a line break character) «^»
    Match the regular expression below and capture its match into backreference number 1 «(authentication|supply_data|versions)»
       Match either the regular expression below (attempting the next alternative only if this one fails) «authentication»
          Match the characters “authentication” literally «authentication»
       Or match regular expression number 2 below (attempting the next alternative only if this one fails) «supply_data»
          Match the characters “supply_data” literally «supply_data»
       Or match regular expression number 3 below (the entire group fails if this one fails to match) «versions»
          Match the characters “versions” literally «versions»
    Match the regular expression below and capture its match into backreference number 2 «(#([a-z]++))?»
       Between zero and one times, as many times as possible, giving back as needed (greedy) «?»
       Match the character “#” literally «#»
       Match the regular expression below and capture its match into backreference number 3 «([a-z]++)»
          Match a single character in the range between “a” and “z” «[a-z]++»
             Between one and unlimited times, as many times as possible, without giving back (possessive) «++»
    Assert position at the end of a line (at the end of the string or before a line break character) «$»


    Created with RegexBuddy

    </div>

    But URL Rewrite was complaining about ++ and ?. Changing ++ to + allows the regex checker to pass.

    I've just checked with RegexBuddy and ...

    // Your regular expression could not be converted to the flavor required by this language:
    // The .NET regular expression flavor does not support possessive quantifiers

    // Because of this, the code snippet below will not work as you intended, if at all.

    But that isn't really the issue. The issue was the crash.
  • Re: Error in regex causes remote IIS manger to crash.

    Nov 18, 2009 03:51 AM|RQuadling|LINK

    I'm using Windows XP SP3 to connect to Windows Server 2008 Enterprise SP2.

    The IIS7 servers are all Windows Server 2008 and are running on a Sun ESX box as VMs.

     

  • Re: Error in regex causes remote IIS manger to crash.

    Nov 18, 2009 04:01 AM|qbernard|LINK

    It didn't crash mine. It reports that "the expression contains a repeat expression......" and basically need to take out the extra '+'

    I'm runing XP SP3 and connect to a local VPC2007 - w2k8 sp2 VM.
    Cheers,
    Bernard Cheah
  • Re: Error in regex causes remote IIS manger to crash.

    Nov 18, 2009 05:09 AM|RQuadling|LINK

    I think the issue is to do with my comctl32.dll. I've got several. Windows\System has V5.82.2900.5512. The NtServicePackUninstall has V5.82.2900.2180.

    I have some in the WinSxS folder, V6.0.2600.0, V6.0.2900.2180 and V6.0.2900.5512. None of them seem to have the TaskDialogIndirect exposed by name (as not seen using Depends.exe).
  • Re: Error in regex causes remote IIS manger to crash.

    Nov 18, 2009 02:06 PM|CarlosAg|LINK

    Yes, thanks for reporting it, we have confirmed this is a bug in our code, the problem will reproduce in Windows XP and Windows 2003, basically the code is trying to use an API that is only avaiable in Windows Vista and later, but the check to prevent this code path to happen in XP and 2003 failed so its causing to try to use it which will crash.

    We will fix this for the next release.

  • Re: Error in regex causes remote IIS manger to crash.

    Nov 18, 2009 10:08 PM|qbernard|LINK

    Errr, how come I can't repro on my setup? I used the same regex syntax.

    Cheers,
    Bernard Cheah
  • Re: Error in regex causes remote IIS manger to crash.

    Nov 19, 2009 05:43 AM|RQuadling|LINK

    Can you check the versions of the comctl32.dll's you have installed. Whilst that library may not be the library at fault, it is documented as the library containing the missing function that my system is having the issue with.
  • Re: Error in regex causes remote IIS manger to crash.

    Nov 21, 2009 10:49 AM|qbernard|LINK

    what's your version?
    Mine is 5.82.2900.5512. not issue.

    Cheers,
    Bernard Cheah
  • Re: Error in regex causes remote IIS manger to crash.

    Nov 24, 2009 06:52 AM|RQuadling|LINK

    Looks like CarlosAg has confirmed the bug.
  • Re: Error in regex causes remote IIS manger to crash.

    Nov 25, 2009 02:47 AM|qbernard|LINK

    I know.. but I can't repro :(
    This is what I do.. i fired up my vpc - w2k8 sp2. then from my xp machine i use IIS manager to connect as server admin, then of coz first time i was prompt to installed additional module binaries, like url rewrite, dynamic ip restriction, etc. then i picked default web site, go to url rewrite, new blank rule, type in name, paste your syntax in the pattern field, click test button, put in some junk, hit test button again.. it never crash :)
    Cheers,
    Bernard Cheah
  • Re: Error in regex causes remote IIS manger to crash.

    Nov 25, 2009 05:05 AM|RQuadling|LINK

    Do you get an error message? What other comctl32.dlls do you have? I wonder if the issue relates to me having first connected to the IIS servers with the beta of the URL Rewrite tool and then I upgraded to the new toll directly on the server.

    Not sure how to check what tools are known to _my_ pc.
  • Re: Error in regex causes remote IIS manger to crash.

    Nov 25, 2009 12:30 PM|CarlosAg|LINK

    You could try running removing the locally cached module in the client machine, and see if that helps.

    Open Windows Explorer in the client machine and navigate to:

    %appdata%\Microsoft\WebManagement\7.0.0.0\

    You should see a Modules directory, feel free to remove it entirely, next time you connect it will get downloaded again.

    You could also just run "inetmgr,exe /reset" however this will reset all your preferences including 'saved connections', column widths, sort order, etc.

  • Re: Error in regex causes remote IIS manger to crash.

    Dec 02, 2009 01:12 AM|qbernard|LINK

    I cleared all modules, reset the inetmgr, try again connect to my w2k8 vm, create new test rules, again it won't crash :)

    Is it something wrong with my repro steps? I'm on XP SP3, W2k8 VM is sp2
    IIS Manager version is 7.0.6001.18000

    Cheers,
    Bernard Cheah