tags:

views:

56

answers:

1

hi all,

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 taskmanager the whole system remains slow, freezed and instable. it's like if it's running on 100% cpu load although it's normal. seems to be a system thing which eats all ressources and the only thing that helps is to reboot.

anyone experienced the same thing / knows a solution? i've already googled but couldn't find anything.

is there at least some way to terminate the regex function in case it takes too long?

thx

+1  A: 

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.

Alan Moore
hi,i forgot to mention that i'm having an intel quadcore, but the vb6-app is singlethreaded (no external dll or multithreading, just normal app). is there maybe something to tweak in vb6/win7?thx
Fuxi
I don't know about tweaks. I was mainly suggesting that you not focus exclusively on regexes as the cause of your problem just because of their reputation for causing lockups. Another thing you could try is eliminating the regexes while keeping the structure of the app as much the same as possible. Of course, a good profiler would help the most, but I don't know what's available for VB6.
Alan Moore