mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 14
B
Pikka bird
OP Offline
Pikka bird
B
Joined: Jan 2003
Posts: 14
I have been using $regex alot lately to test out regexp's...
One thing I've noticed lately, it crashes mIRC frown
I don't know what that is causing it, but after doing a couple of advanced regexp's mIRC freezes.
This happens randomly, but still.. there is a bug there.

I wouldn't even report this if it wasn't for the fact that it is occuring a bit more too often than it should.

Sorry about not being able to give you any details to why this is happening, but since this happens randomly, I have no idea.

Memory leak?

I would recommend going through the regex library you are using and look for possible leaks, interferance with other classes(?) or basically other stuff that might be causing it.

Oh and another "bug" (not mIRC related though.. more of a windows bug, it's just funny);
In the Install/Uninstall features, it lists mIRC with a filesize of over 1GB (All directories are empty) smirk

Last edited by babyorphan; 19/05/03 09:48 PM.

Sincerely,
babyorphan, #Lobby @ geekIRC
-------
bOS2 - IRC client
version; 1.07
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
You really should try to write down the regex pattern used when mirc crashes. And btw, does it 'crash' or does it 'freeze'?

There are patterns that can crash mirc (more specifically the (?R) item) if they aren't used properly and other patterns that can freeze mirc for a long time, simply because they are causing a lot of internal iterations. Often these extremely slow patterns are as innocent-looking as this:
$regex($str(a,22),/(a+)*\d/)
Try it, you'll see it freezes mirc for a noticeable time.

$regsub can also crash mirc, but for reasons that have nothing to do with the regex part: mirc doesn't check the length of text to be put in the %var specified in $regsub(), so it overflows, fex:
$regsub($str(a,500),/a/g,aa,%a)


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jan 2003
Posts: 14
B
Pikka bird
OP Offline
Pikka bird
B
Joined: Jan 2003
Posts: 14
Some times it just freezes, other times it crashes and dissapears completely (without clearing the memory allocated mad)

It's pretty much innocent looking regexp's but why it happens is random..
since I can use the same pattern after opening mIRC again and it won't crash/freeze..
I have no idea why this keeps happening.

Overflows are messy wink


Sincerely,
babyorphan, #Lobby @ geekIRC
-------
bOS2 - IRC client
version; 1.07
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well give us the regex. If you paste the regex, I'll do some rigorous testing on both mIRC and PCRE alone. But if you just say it is an "innocent looking regexp" well then how is anyone supposed to determine what the problem is? A lot of regexps can eat all memory, try ((((a{1,100}){1,100}){1,100}){1,100}){1,100} and you'll see what I mean. If you don't post the actual regex though, we can't really help you.

Joined: Jan 2003
Posts: 14
B
Pikka bird
OP Offline
Pikka bird
B
Joined: Jan 2003
Posts: 14
Ok, I never said I needed any help, but the regexp that crashed the last time was simply:
Code:

  /^([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*)+(\.[a-z]{2,6})$/i

That regex is NOT something that should crash mIRC.

And I just use $regex so that I don't have to look in my console window/browser window all the time to check if the regex is valid smirk
The regex' didn't crash when testing them out with Perl etc.


Sincerely,
babyorphan, #Lobby @ geekIRC
-------
bOS2 - IRC client
version; 1.07
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
I tried your regex with various inputs and couldn't get it to crash. The regex itself does not contain any elements that would justify the crash. Possibly, it depends on the input too, so try to paste the exact $regex() identifier that crashes mirc, with all its parameters.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
I never suggested you did need help. This is the bug report forum, if you want to report a bug, you must provide the information necessary to find the bug. In this case, it will be the $regex line, if you don't want to provide it, that's your choice, but then don't complain when the bug still exists in the next version of mIRC.

Also note, Perl uses a different regex library than mIRC, so it may work in Perl and not in mIRC and that should not be suprising at all.

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
I realize this post is a couple months behind, but I didn't notice this thread until now (when Online linked to it) and feel like adding my own experience to it anyway.

qwerty's on the money about it crashing when $regsub dumps a string greater-than ~950 into %var.

In my experience, this happens most when I place user-input in the expression. For the longest time, I couldn't figure out why mIRC crashed whenever my nick was "Raccoon|" until I realized I used $me in a $regsub pattern and it was treating the "|" as "OR Nothing", so wherever it didn't match "Raccoon" it was matching the Nothing between each and every letter.

As far as I can tell, and from everyone I've asked, it's not possible to escape an entire string in PCRE.

I might propose the obvious and have mIRC crop the output text to ~950 chars before it gets dumped into %var, provided Khaled hasn't done this already.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard