Reputation: 7599
I have a little application which uses regular expressions under VB6. It works perfectly under XP but under Win7 I'm experiencing massive problems. Sometimes, when the text which is passed to the regex function is > 20KB, it freezes the application and also the whole Win7 system: it's getting really slow, almost completely freezes and only after ~30 seconds reacts for a few seconds and freezes again.
Strange thing - event if i terminate the VB6 task under task-manager the whole system remains slow, frozen and unstable. it's like if it's running on 100% cpu load although it's normal. Seems to be a system thing which eats up all resources and the only thing that helps is to reboot.
I've already googled but couldn't find anything. Anyone experienced the same thing / knows a solution? Is there at least some way to terminate the regex function in case it takes too long?
Upvotes: 0
Views: 222
Reputation: 75252
Is the application multithreaded? Did you also upgrade the hardware from a single-core CPU to multicore/multi-CPU?
Usually, when a regex goes rogue it either causes a stack overflow or goes into an (apparently) infinite loop, but it sounds like that's not happening to you. The symptoms you describe sound more like a deadlock: multiple threads of execution contending for the same resource.
There have been some bugs reported against Java's regex package that turned out to be concurrency related, and nothing to do with regexes per se. The root bug was there all along, but it couldn't manifest on a single-core machine, even in a nominally multithreaded app. It didn't get reported until large numbers of users shifted to multicore hardware.
I'm not suggesting that there's a concurrency bug in VB6 like there was in Java; more likely it's in your application. If the app is multithreaded, try eliminating that aspect and see what effect it has. If it's not, or if this doesn't help, we'll need more information; there isn't much to go on in your original question.
Upvotes: 1