radiusplugin-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Radiusplugin-users] Possible bug / weird occurence


From: Ralf Lübben
Subject: Re: [Radiusplugin-users] Possible bug / weird occurence
Date: Fri, 26 Aug 2011 14:33:26 +0200
User-agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.6.2; i686; ; )

Hi,

it seems that replace causes the error, but I'm not sure why. Maybe the string 
does not always contain "\n".

Maybe you can try

string getTime()
{
                time_t rawtime;
                struct tm * timeinfo;
                time ( &rawtime );
                timeinfo = localtime ( &rawtime );
                string t(ctime(&rawtime));
                size_t str_pos=t.find("\n");
                if (pos!=string::npos)
                {
                  t.replace(str_pos,1," ");
                }
                return t;
}


So the replacement only happens if the string contains "\n". 
Or you can add some more debugging output to see if the error really occurs 
there.

Regards
Ralf



Am Donnerstag, 25. August 2011, 23:29:09 schrieb Dequan:
> Following on from this, a 'find in files' for the word 'replace' only
> returns 1 entry -- radiusplugin.cpp line 1100:
> 
>       string getTime()
>       {
>               time_t rawtime;
>               struct tm * timeinfo;
>               time ( &rawtime );
>               timeinfo = localtime ( &rawtime );
>               string t(ctime(&rawtime));
>               t.replace(t.find("\n"),1," ");
>               return t;
>       }
> 
> Is it possible this is causing the error:
> 
>       std::out_of_range
>       what():  basic_string::replace
> 
> or, am I trying to find bugs where there are none?!
> 
> Regards,
> Dequan.
> 
> -----Original Message-----
> From: Dequan [mailto:address@hidden
> Sent: 25 August 2011 22:13
> To: address@hidden
> Subject: Possible bug / weird occurence
> 
> Hi Ralf,
> 
> I have 4 OpenVPN instances running on my server (2 TCP / 2 UDP) all
> running radiusplugin with 4 separate radiusplugin configs.
> 
> Normally everything runs fine, but say.. once every day (there is no real
> frequency or reliability in replicating this), one of the OpenVPN
> instances would crash with the following error in the OpenVPN log --
> leading me to assume it's either an OpenVPN or radiusplugin issue:
> 
>       Thu Aug 25 20:09:41 2011 219.147.190.77:3475 Data Channel Encrypt:
> Cipher 'AES-256-CBC' initialized with 256 bit key
>       Thu Aug 25 20:09:41 2011 219.147.190.77:3475 Datstd::out_of_range'
>       Thu Aug 25 20:09:41 2011 219.147.190.77:3475 Data Channel Decrypt:
> Cipher 'AES-256-CBC' initialized with 256 bit key
>       what():  basic_string::replaceT
>       Thu Aug 25 20:09:41 2011 219.147.190.77:3475 Data Channel Decrypt:
> Using 160 bit message hash 'SHA1' for HMAC authentication
> 
> This is the only thing I can find that is causing the issue which forces
> me to restart all instances and resetting everyone's connection. Sorry to
> presume, but I am guessing that something 'weird' is happening in the
> radiusplugin and giving the errors:
> 
>       std::out_of_range
>       what():  basic_string::replace
> 
> I can find nothing else except the above in the logs (corresponding to
> around the same timeframe) that would cause one of the OpenVPN instances
> to crash -- and assume it is a weird error arising for the radiusplugin.
> 
> I'm sorry I have nothing more to go on, but do you have any idea if this
> is actually caused by the radiusplugin? It's a bit of a leap, but is it
> possible that there is the ability to input something 'weird' into the
> radiusplugin -- somewhere -- that would result in this error? I am
> assuming I do not need a radiusplugin.so for every OpenVPN instance, and
> that a separate radiusplugin config file for each instance is the correct
> method?
> 
> Regards,
> Dequan.
> 
> 
> 
> 
> _______________________________________________
> Radiusplugin-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/radiusplugin-users




reply via email to

[Prev in Thread] Current Thread [Next in Thread]