Raised This Month: $51 Target: $400
 12% 

Regex issue/bug?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Clauu
Senior Member
Join Date: Feb 2008
Location: RO
Old 01-13-2018 , 18:52   Regex issue/bug?
Reply With Quote #1

Hello, long time no see
I recently starting playing again with amxx, especially with the regex module:
Code:
#define RegexMatch(%1,%2) ( regex_match_c(%1,%2,ret) > 0 )
stock checkName(const pName[], dataCfg[structConfig], dataMatch[], &pid) {

	if(arrConfigTotalSize<1 || arrNamesSize<1)
		return false;
		
	static lpName[64], repl[64];

	copy(lpName, charsmax(lpName), pName);
	strtolower(lpName);
	
	if(containi(lpName, "replaced" )!=-1)
		return false;
	
	for (new i=0; i<arrNamesSize; i++) {
	
		ArrayGetArray(arrConfigNames, i, dataCfg);
		if(dataCfg[regexC] < REGEX_OK)
			continue;
			
		if ( RegexMatch(lpName, dataCfg[regexC]) ) {
		
			split_string(dataCfg[replacement]," ",repl,charsmax(repl));
			if(containi(lpName, repl )!=-1)
				return false;
			
			regex_substr(dataCfg[regexC], 0, dataMatch, 127);
			pid = i;
			return true;
		}
	}
	return false;
}
With this piece of code server randomly hangs, i'm testing it on both win & linux with the same amxx build 1.8.3
On windows it hangs without any error, the funny thing is if i type any char in console it will 'un'hang and everything will be fine until next random hang, on linux it will hang with this error:
Code:
PM Got a NaN velocity 2
Is there any knowing issue/problem with the regex module?
I also tested without split_string & regex_substr and the problem is the same.. so i'm suspecting regex_match_c/regex_match?

Last edited by Clauu; 01-13-2018 at 18:53.
Clauu is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode