Previous | Index | Next 

[PRB] PreProcess or PostProcess pragma can make VB Migration Partner to hung

A known problem with regular expressions engine is that some special patterns can “freeze” the running program. In reality, no regex pattern can actually crash a .NET application, but there is a category of search patterns that can take such a long time to complete – several minutes even when applied to short strings – that the running program appears to hung. In such cases, the only remedy is to kill the application from Windows Task Manager.

A typical regex pattern that can take long to complete is one that contains nested quantifiers, such as this one

        (.*)*

When working with VB Migration Partner, you can bump into this problem when you use the PreProcess and PostProcess pragmas. These pragmas can add a lot of flexibility, but you should be careful in how you use them. If you notice that VB Migration Partner hungs on a specific source code file either during the parse stage or the code generation stage, temporarily remove any PreProcess pragma (in the former case) or PostProcess pragma (in the latter case) and try again. If the problem goes away, it’s time to carefully revise the regex patterns used by your pragmas.

Please read this article for a quick way to temporarily disable all PreProcess and PostProcess pragmas.

 

Previous | Index | Next