mIRC Home    About    Download    Register    News    Help

Topic Options
#25106 - 19/05/03 10:45 PM Ok.. I thought it was a temporary bug or exception
babyorphan Offline
Pikka bird

Registered: 10/01/03
Posts: 14
Loc: Østfold, Norway.
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


Edited by babyorphan (19/05/03 10:48 PM)
_________________________
Sincerely,
babyorphan, #Lobby @ geekIRC
-------
bOS2 - IRC client
version; 1.07

Top
#25107 - 20/05/03 01:54 AM Re: Ok.. I thought it was a temporary bug or exception
qwerty Offline
Hoopy frood

Registered: 07/01/03
Posts: 2523
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

Top
#25108 - 20/05/03 09:16 AM Re: Ok.. I thought it was a temporary bug or exception
babyorphan Offline
Pikka bird

Registered: 10/01/03
Posts: 14
Loc: Østfold, Norway.
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

Top
#25109 - 20/05/03 05:54 PM Re: Ok.. I thought it was a temporary bug or exception
codemastr Offline
Hoopy frood

Registered: 12/12/02
Posts: 2809
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.

Top
#25110 - 26/05/03 09:17 AM Re: Ok.. I thought it was a temporary bug or exception
babyorphan Offline
Pikka bird

Registered: 10/01/03
Posts: 14
Loc: Østfold, Norway.
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

Top
#25111 - 26/05/03 10:34 AM Re: Ok.. I thought it was a temporary bug or exception
qwerty Offline
Hoopy frood

Registered: 07/01/03
Posts: 2523
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

Top
#25112 - 26/05/03 06:28 PM Re: Ok.. I thought it was a temporary bug or exception
codemastr Offline
Hoopy frood

Registered: 12/12/02
Posts: 2809
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.

Top
#25113 - 30/07/03 05:31 AM Re: Ok.. I thought it was a temporary bug or exception
Raccoon Offline
Hoopy frood

Registered: 18/02/03
Posts: 2590
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!

Top